Skip to content

Instantly share code, notes, and snippets.

@adrian154
Created December 27, 2023 12:14
Show Gist options
  • Save adrian154/6c5f776cb3f4c5dda5145de1a6bf0e28 to your computer and use it in GitHub Desktop.
Save adrian154/6c5f776cb3f4c5dda5145de1a6bf0e28 to your computer and use it in GitHub Desktop.
// for parsing rev 6 QT metadata
data = //..
meta = //..
readNullStr = (buf, idx) => {
chars = []
while(buf[idx] != 0) {
chars.push(buf[idx])
idx++;
}
return Buffer.from(chars).toString("ascii");
};
console.log("CLASS: " + readNullStr(data, 0));
console.log("=".repeat(30));
const methodCount = meta.readInt32LE(16);
for(let i = 0; i < methodCount; i++) {
const index = meta.readInt32LE(56 + i * 20);
console.log('0x' + i.toString(16).padEnd(3, ' ') + ' : ' + readNullStr(data, index));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment