nowsecure / r2frida

Radare2 and Frida better together.
MIT License
1.18k stars 121 forks source link

MemoryAccessMonitor not available #95

Closed redmed666 closed 5 years ago

redmed666 commented 6 years ago

Hi,

I've got this issue when trying to use MemoryAccessMonitor:

"MemoryAccessMonitor is not yet available in the Duktape runtime"

Can you maybe point where one could begin to dig to make this integration? And some guidelines to make it happen?

Thanks!

oleavr commented 6 years ago

There isn't yet any docs on how to add this kind of thing, so the best way to go about it is to look at the existing code while looking things up in Duktape's documentation.

I would start with a failing test to have a short feedback loop. For this particular feature there's already a test written, so all you have to do is enable it for Duktape too by removing this piece of code. Then run gum-tests with -p /GumJS/Script/memory_access_can_be_monitored#DUK so only that one test gets run. Once you have that, look at the MemoryAccessMonitor integration in our V8 implementation. You can compare other implementations in Duktape vs V8 to see how the different things are done, and copy-paste/take inspiration from those.

redmed666 commented 6 years ago

Thanks for your feedback, I will try to take a look at that :)

redmed666 commented 6 years ago

Actually, there is something I'm not getting: MemoryAccessMonitor is supposed to be working on Windows right? In my case, I'm trying to inject it in a windows process so it should work, no? Or am I missing something?

oleavr commented 6 years ago

The monitor itself is only implemented on Windows. The reason it doesn't work is that our Duktape runtime is the default, and only the V8 runtime has MemoryAccessMonitor exposed.

michalfapso commented 5 years ago

I had the same error. Try to run Frida with --enable-jit, it worked for me.

trufae commented 5 years ago

V8 is the default runtime in r2frida. You shouldnt be having this problem now

On 4 Mar 2019, at 09:54, Michal Fapso notifications@github.com wrote:

I had the same error. Try to run Frida with --enable-jit, it worked for me.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

michalfapso commented 5 years ago

Thanks, @trufae. I am sorry, I didn't notice that this issue is in the r2frida project. I thought it is for Frida.