Skip to content

Instantly share code, notes, and snippets.

@MCMrARM
MCMrARM / 91-pulseaudio-custom.rules
Created August 30, 2019 19:22
System configuration files for the T2 audio driver (https://github.com/MCMrARM/mbp2018-bridge-drv/)
SUBSYSTEM!="sound", GOTO="pulseaudio_end"
ACTION!="change", GOTO="pulseaudio_end"
KERNEL!="card*", GOTO="pulseaudio_end"
SUBSYSTEMS=="pci", ATTRS{vendor}=="0x106b", ATTRS{device}=="0x1803", ENV{PULSE_PROFILE_SET}="apple-t2.conf"
LABEL="pulseaudio_end"
#include <cstdlib>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <unistd.h>
#include <fcntl.h>
#include <libudev.h>
#include <libevdev-1.0/libevdev/libevdev.h>
public static void extractInfo(ClassLoader loader) throws Exception {
BaseDexClassLoader dexLoader = (BaseDexClassLoader) loader;
Field pathListField = BaseDexClassLoader.class.getDeclaredField("pathList");
pathListField.setAccessible(true);
Object pathList = pathListField.get(dexLoader);
Field dexElementsField = pathList.getClass().getDeclaredField("dexElements");
dexElementsField.setAccessible(true);
Object[] dexElements = (Object[]) dexElementsField.get(pathList);
Field elementFileField = null;
@MCMrARM
MCMrARM / PKGBUILD
Last active December 13, 2018 15:36
PKGBUILD for mcpelauncher-ui
pkgname=mcpelauncher-ui-git
pkgver=v0.1
pkgrel=1
pkgdesc="Minecraft: PE Linux launcher UI"
arch=('x86_64')
url="https://github.com/minecraft-linux/mcpelauncher-ui-manifest"
license=('MIT' 'GPL3')
makedepends=('git' 'cmake')
depends=('qt5-base' 'qt5-webengine' 'qt5-declarative' 'qt5-quickcontrols' 'qt5-quickcontrols2' 'libzip' 'protobuf' 'mcpelauncher-linux')
provides=('mcpelauncher-ui')
@MCMrARM
MCMrARM / PKGBUILD
Last active July 12, 2018 20:23
mcpelauncher-linux PKGBUILD
pkgname=mcpelauncher-linux-git
pkgver=1.0
pkgrel=1
pkgdesc="Minecraft: Pocket Edition launcher for Linux"
arch=('x86_64')
url="https://github.com/minecraft-linux/mcpelauncher-manifest"
license=('custom')
makedepends=('git' 'cmake' 'gcc-multilib')
depends=('lib32-curl' 'lib32-libx11' 'lib32-zlib' 'lib32-libpng' 'lib32-libevdev' 'lib32-systemd' 'lib32-libxi' 'lib32-libegl')
optdepends=('mcpelauncher-msa: Xbox Live support')
@MCMrARM
MCMrARM / PKGBUILD
Last active July 4, 2018 13:04
MSA Arch PKGBUILD
pkgname=mcpelauncher-msa-git
pkgver=v0.1.beta.1.r0.ga677606
pkgrel=1
pkgdesc="Microsoft Account authentication daemon for mcpelauncher"
arch=('x86_64')
url="https://github.com/minecraft-linux/msa-manifest"
license=('MIT')
makedepends=('git' 'cmake')
depends=('curl' 'openssl')
provides=('mcpelauncher-msa')
@MCMrARM
MCMrARM / BrickBCT.py
Created May 15, 2018 21:17
A simple script to brick the BCT
import os
def do_brick(file, bct_offset, unbrick):
os.lseek(file, bct_offset + 0x0530, os.SEEK_SET)
print("Org = " + str(os.read(file, 1)))
os.lseek(file, bct_offset + 0x0530, os.SEEK_SET)
new_val = b'\01' if unbrick else b'\00'
print("New = " + str(new_val))
os.write(file, new_val)
@MCMrARM
MCMrARM / kek.py
Last active June 17, 2018 19:14
A Python script to decrypt Switch's SSL private key
# A Python script to decrypt Switch's SSL private key
# Thanks to roblabla for help
# Heavily based on Atmosphere's exosphere
# Usage: kek.py <source> <destination>
# Make sure to fill in the proper keys in the script
import struct
import sys
from Crypto.Cipher import AES
from Crypto.Util import Counter
@MCMrARM
MCMrARM / jws_x509.ex
Created March 10, 2018 15:34
JWS X.509 validation
defmodule JwsX509 do
require Record
# Some code taken from https://github.com/hexpm/hex/blob/8410f8d48607a67bec713a6cbb760bbba8447aab/lib/hex/http/ssl.ex
# Licensed under Apache 2.0
Record.defrecordp(
:certificate,
:OTPCertificate,