Created
January 30, 2023 10:31
-
-
Save NSEcho/7ce8f6cb6f9e11dabe4908e9145e43f6 to your computer and use it in GitHub Desktop.
Simple usage of Memory.patchCode and writer
This file contains 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
var Base = Process.getModuleByName("Base"); | |
var baseAddress = Base.base; | |
var jumpingAddress = ptr("0x50c20").add(baseAddress); | |
Memory.patchCode(jumpingAddress, 4, code => { | |
console.log("patchin first"); | |
const writer = new Arm64Writer(code, { pc: jumpingAddress }); | |
writer.putNop(); | |
}); | |
console.log("disassd", Instruction.parse(jumpingAddress)); | |
jumpingAddress = ptr("0x50c2c").add(baseAddress); | |
Memory.patchCode(jumpingAddress, 4, code => { | |
console.log("patching second"); | |
const writer = new Arm64Writer(code, { pc: jumpingAddress }); | |
writer.putNop(); | |
}); | |
console.log("disassd", Instruction.parse(jumpingAddress)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment