Skip to content

Instantly share code, notes, and snippets.

View maxton's full-sized avatar

Max maxton

View GitHub Profile
@maxton
maxton / hax.patch
Created August 28, 2020 01:10
Xenia patch for TB:RB fun
diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc
index f6a688b0..4cc82d2d 100644
--- a/src/xenia/cpu/backend/x64/x64_sequences.cc
+++ b/src/xenia/cpu/backend/x64/x64_sequences.cc
@@ -54,6 +54,112 @@ using xe::cpu::hir::Instr;
typedef bool (*SequenceSelectFn)(X64Emitter&, const Instr*);
std::unordered_map<uint32_t, SequenceSelectFn> sequence_table;
+typedef struct {
+ xe::be<uint32_t> vtbl;
@maxton
maxton / ExportXeniaMap.java
Last active July 17, 2021 05:20
Ghidra script to export .map files for the Xenia debugger. Load maps by launching Xenia with the --load_module_map="C:\path\to\ghidra.map" argument.
//Saves function names and addresses for Xenia
//@author Maxton
//@category Functions
//@keybinding
//@menupath File.Export Xenia Map File...
//@toolbar
import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
@maxton
maxton / ios_enc_re.c
Last active September 17, 2019 01:19
GHL iOS Title Update 2.0 arm32 RE
// 1b7cdc
string get_key_prefix(int key_type)
{
key_prefixes = {
0 => "a",
1 => "b",
2 => "c",
3 => "d",
4 => "e",
5 => "f",
@maxton
maxton / Decrypt.csx
Created January 19, 2019 05:19
c# script for some app
using System.Security.Cryptography;
using System.IO;
byte[][] LoadKeys(string fn)
{
var blobKey = new byte[] { 0xE4, 0xC5, 0x1B, 0x30, 0xDB, 0x7E, 0xE, 0x20, 0x15, 0xB5, 0xD8, 0x2E, 0x1A, 0xF6, 0x3F, 0x6E };
var decrypted = new MemoryStream();
using(var f = File.OpenRead(fn))
{
var iv = new byte[16];
//--------------------------------------
//--- 010 Editor v6.0.2 Binary Template
//
// File:
// Author:
// Revision:
// Purpose:
//--------------------------------------
BigEndian();
@maxton
maxton / Allow-decoding-up-to-16-channels-of-xma.patch
Created February 21, 2018 07:26
ffmpeg patch to allow decoding Power Gig XMA
From: Maxton <>
Date: Wed, 21 Feb 2018 02:21:42 -0500
Subject: [PATCH] Allow decoding up to 16 channels of xma
---
libavcodec/wmaprodec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 77a49c9..0460fce 100644
@maxton
maxton / PowerGigDecryptor.cs
Last active May 24, 2018 01:33
Decrypt xma/fsb.e.2 files from Power Gig
using System;
using System.IO;
using GameArchives.Seven45;
namespace PowerGigDecryptor
{
class Program
{
static void Main(string[] args)
{
@maxton
maxton / GHL_xmk.bt
Created February 7, 2018 18:43
Guitar Hero Live XMK 010 Editor Template
BigEndian();
typedef struct {
int version;
int checksum;
uint numEvents;
uint stringTableSize;
uint unk1;
uint numChunks;
uint numTimeSigs;