This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function readStdString (str) { | |
| const isLong = (capU8) => { return (capU8 & 0x01) !== 1; } | |
| const cap0 = str.readU8(); | |
| let data = null; | |
| let size = 0; | |
| if (isLong(cap0)) { | |
| data = str.readPointer().readUtf8String(); | |
| size = str.add(Process.pointerSize).readU64(); | |
| } else { | |
| size = str.add(23).readU8(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const thread_suspend = Module.getExportByName(null, "thread_suspend"); | |
| Interceptor.attach(thread_suspend, { | |
| onEnter(args) { | |
| console.log("DEBUG: thread_suspend CALLED" + Thread.backtrace(this.context, Backtracer.ACCURATE).map(DebugSymbol.fromAddress).join('\n') + '\n'); | |
| args[0] = NULL; | |
| }, | |
| onLeave(retval) { | |
| retval.replace(NULL); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function disasm (from, end) { | |
| let cursor = from; | |
| while (cursor.compare(end) < 0) { | |
| try { | |
| const inst = Instruction.parse(cursor); | |
| console.log(cursor, inst); | |
| } catch (e) { | |
| console.log(cursor, cursor.readU32().toString(16), "invalid"); | |
| } | |
| cursor = cursor.add(4); |