add watchpoint current & return debug symbols

This commit is contained in:
iddoeldor 2019-07-09 15:36:20 +03:00 committed by GitHub
parent eaaffe7014
commit 5b7c2d794d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,12 +110,11 @@ For this example I'm intercepting `funcPtr` & I want to know who read/write to `
```js
Process.setExceptionHandler(function(exp) {
console.warn(JSON.stringify(exp, null, 2));
console.warn(JSON.stringify(Object.assign(exp, { _lr: DebugSymbol.fromAddress(exp.context.lr), _pc: DebugSymbol.fromAddress(exp.context.pc) }), null, 2));
// can implement a switch case on exp.memory.operation, if read set only 'r--' if write '-w-' etc..
Memory.protect(exp.memory.address, Process.pointerSize, 'rw-');
// can also use `new NativeFunction(Module.findExportByName(null, 'mprotect'), 'int', ['pointer', 'uint', 'int'])(parseInt(this.context.x2), 2, 0)`
return true;
return true; // goto PC
});
Interceptor.attach(funcPtr, {