Skip to content

Instantly share code, notes, and snippets.

View shinyquagsire23's full-sized avatar
💭
Messing with Apple Vision

Max Thomas shinyquagsire23

💭
Messing with Apple Vision
View GitHub Profile
@shinyquagsire23
shinyquagsire23 / aboot-verify.py
Last active June 18, 2019 00:35
Python script for verifying ELF aboot images
#!/usr/bin/env python2
import struct
import sys
import hashlib
from pyasn1_modules import rfc2437,rfc2459
from pyasn1.codec.der import decoder
from pyasn1.codec.native import encoder
@shinyquagsire23
shinyquagsire23 / tbv_extract.c
Created May 7, 2019 22:59
TBV package extraction for Lionel Train Town
#include <stdint.h>
#include <stdio.h>
struct pkx_header
{
uint32_t magic1;
uint32_t magic2;
uint32_t magic3;
uint32_t type;
uint32_t comp_size;
@shinyquagsire23
shinyquagsire23 / assist_dec.txt
Last active January 6, 2019 21:01
lua vs lua2cpp vs luac vs nrooooooo tokens
function <?:27,31> (25 instructions at 0x563b8aad94d0)
0 params, 17 slots, 1 upvalue, 0 locals, 7 constants, 0 functions
1 [-] GETTABUP 0 0 -1 ; - "sv_animcmd"
2 [-] GETTABLE 0 0 -2 ; "is_excute"
3 [-] CALL 0 1 2
4 [-] TEST 0 0
5 [-] JMP 0 19 ; to 25
6 [-] GETTABUP 0 0 -1 ; - "sv_animcmd"
7 [-] GETTABLE 0 0 -3 ; "LANDING_EFFECT"
8 [-] LOADK 1 -4 ; 85833409598
@shinyquagsire23
shinyquagsire23 / ida_pseudocode.txt
Created January 6, 2019 01:04
nrooooooo convergence/divergence test: multiple ifs and if..else
lib::L2CValue::L2CValue((lib::L2CValue *)&v21, 1);
lib::L2CAgent::clear_lua_stack((lib::L2CAgent *)v2);
lib::L2CAgent::push_lua_stack((lib::L2CAgent *)v2, (const lib::L2CValue *)&v21);
v4 = *(_QWORD *)(v2 + 8);
lib::L2CValue::as_number((lib::L2CValue *)&v21);
app::sv_animcmd::frame();
lib::L2CAgent::pop_lua_stack((L2CValue *)&v20, (lib::L2CAgent *)v2, 1);
lib::L2CValue::~L2CValue((lib::L2CValue *)&v20);
lib::L2CValue::~L2CValue((lib::L2CValue *)&v21);
lib::L2CAgent::clear_lua_stack((lib::L2CAgent *)v2);
@shinyquagsire23
shinyquagsire23 / main.c
Last active December 23, 2018 14:44
iPod 'Photo Database' extraction
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <uchar.h>
#include <png.h>
typedef struct section
{
uint32_t magic;
uint32_t size;
{"CalibrationInformation":{"Cameras":[{"Intrinsics":{"ModelParameterCount":15,"ModelParameters":[0.5056072473526001,0.51121383905410767,0.41733670234680176,0.55639612674713135,0.536751925945282,0.49938720464706421,0.0064958259463310242,0.79876220226287842,0.56841433048248291,0.07316143810749054,0.00090526352869346738,-0.00026460731169208884,4.882114808424376E-5,-0.00015969532250892371,2.7959318161010742],"ModelType":"CALIBRATION_LensDistortionModelRational6KT"},"Location":"CALIBRATION_CameraLocationHT0","Purpose":"CALIBRATION_CameraPurposeHeadTracking","MetricRadius":2.7959318161010742,"Rt":{"Rotation":[1,0,0,0,1,0,0,0,1],"Translation":[0,0,0]},"SensorHeight":480,"SensorWidth":640,"Shutter":"CALIBRATION_ShutterTypeUndefined","ThermalAdjustmentParams":{"Params":[0,0,0,0,0,0,0,0,0,0,0,0]}},{"Intrinsics":{"ModelParameterCount":15,"ModelParameters":[0.49853116273880005,0.49842718243598938,0.41769698262214661,0.55702918767929077,0.54305106401443481,0.81650543212890625,0.0025251691695302725,0.79530555009841919,0.92
@shinyquagsire23
shinyquagsire23 / wmr-dec.py
Last active October 28, 2018 09:29
Windows Mixed Reality Calibration Decryption
import struct
random_garbage = [0x2F, 0xC8, 0x0F, 0x38, 0xDD, 0x00, 0xF6, 0x5C, 0xA1, 0x31, 0xEF, 0xF1, 0xEA, 0x6F, 0xA0,
0xF8, 0x26, 0xB5, 0x9B, 0x39, 0xCF, 0x3A, 0x88, 0xC8, 0x2E, 0x17, 0xC0, 0x63, 0x5B, 0x46, 0x27, 0xBB, 0x98,
0x2F, 0x0E, 0x2A, 0x90, 0x4B, 0x28, 0x2D, 0x82, 0x76, 0xE5, 0x28, 0x72, 0x50, 0x8A, 0xF0, 0xBF, 0x84, 0x54,
0x3B, 0xA8, 0x77, 0x91, 0xCE, 0x87, 0x80, 0x53, 0x2F, 0x07, 0xAD, 0x1B, 0x3F, 0x8C, 0x67, 0x33, 0x2E, 0xEB,
0x6A, 0x2A, 0x52, 0x77, 0x7C, 0x1F, 0x02, 0x11, 0x9E, 0x2A, 0x59, 0x5C, 0x94, 0x0E, 0x4F, 0xF5, 0x44, 0x54,
0x01, 0xE7, 0x8F, 0x66, 0xF0, 0xAD, 0x68, 0x71, 0x3C, 0x6D, 0x2E, 0x1C, 0xE3, 0x11, 0x46, 0xF7, 0x7F, 0x02,
0x6C, 0x15, 0xA0, 0x10, 0xEE, 0x3B, 0x14, 0xAE, 0x6C, 0xA7, 0x3F, 0xAF, 0x83, 0x6A, 0xD7, 0x12, 0x88, 0x53,
0xFE, 0xEB, 0x5C, 0x78, 0x85, 0xAF, 0x1F, 0x80, 0x7F, 0xB6, 0xDA, 0x7C, 0x0E, 0x84, 0xB5, 0x02, 0x8E, 0x92,
@shinyquagsire23
shinyquagsire23 / rf-extract.py
Last active September 6, 2023 22:09
LEGO LOCO RFH/RFD unpacker
import struct
import os
contents = open("resource.RFH", "rb").read()
blob_f = open("resource.RFD", "rb")
def huff_decompress(data):
bits = 0
node = struct.unpack("<H", data[4:6])[0]
decomp = ""
#!/bin/bash
if [ "$1" = "" ]
then
echo "Usage: thumb <input file> {output file}"
exit
fi
if [ "$2" = "" ]
then
output=${1%.asm}.bin
@shinyquagsire23
shinyquagsire23 / ardsitest.cpp
Last active October 9, 2017 21:31
AR DSi Flasher
// Compile with g++ -lusb-1.0 ardsitest.cpp
#ifdef WIN32
#include <windows.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <libusb-1.0/libusb.h>