Closed CaledoniaProject closed 3 years ago
Hi,
Simple by doing :
Interceptor.attach(testMethod, {
onEnter: function (args) {
this.data = args[4];
}, onLeave: function (retval){
console.log(Memory.readInt(this.data))
}
});
You can also use CPU context to save the value of 4th arg (example with arm64):
this.data = this.context.x4;
-------- Message d'origine -------- Le 10 août 2021 à 16:51, CaledoniaProject a écrit :
The testMethod has a pointer argument which will be modified in the method. I need to read its value in onLeave. Right now I had to store the variable in onEnter then read it in onLeave.
I'm wondering if there's a better way to do that? It's not healthy for multithread programs.
let data = null Interceptor.attach(testMethod, { onEnter: function (args) { data = args[4] }, onLeave: function (retval) { console.log(Memory.readInt(data)) } });
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
Thanks!
The testMethod has a pointer argument which will be modified in the method. I need to read its value in onLeave. Right now I had to store the variable in onEnter then read it in onLeave.
I'm wondering if there's a better way to do that? It's not healthy for multithread programs.