nowsecure / r2frida

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

ReferenceError when running scripts from r2Frida environment #152

Closed maqsoodahmadjan closed 5 years ago

maqsoodahmadjan commented 5 years ago

I get a ReferenceError when I run a sample script from r2Frida environment on the latest version.

`Java.perform(function(){ ^

ReferenceError: Java is not defined at Object. (/Users/maqsood/Frida/script.js:2:1) at Module._compile (internal/modules/cjs/loader.js:759:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10) at Module.load (internal/modules/cjs/loader.js:628:32) at Function.Module._load (internal/modules/cjs/loader.js:555:12) at Function.Module.runMain (internal/modules/cjs/loader.js:824:10) at internal/main/run_main_module.js:17:11`

trufae commented 5 years ago

which sample sccript, how are you running this script, which r2frida environment? this script is not suposed to be executed outside r2frida, and r2frida loads it directly, so you dont have to do anything

On Tue, Jun 11, 2019 at 4:05 PM Maqsood Ahmad notifications@github.com wrote:

I get a ReferenceError when I run a sample script from r2Frida environment on the latest version.

`Java.perform(function(){ ^

ReferenceError: Java is not defined at Object. (/Users/maqsood/Frida/script.js:2:1) at Module._compile (internal/modules/cjs/loader.js:759:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10) at Module.load (internal/modules/cjs/loader.js:628:32) at Function.Module._load (internal/modules/cjs/loader.js:555:12) at Function.Module.runMain (internal/modules/cjs/loader.js:824:10) at internal/main/run_main_module.js:17:11`

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nowsecure/r2frida/issues/152?email_source=notifications&email_token=ABRCGG5ZUEJWDMJAMS5A7UTPZ6WI7A5CNFSM4HW6WROKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GY2LBPA, or mute the thread https://github.com/notifications/unsubscribe-auth/ABRCGGZZAHJR54J26DL45XDPZ6WI7ANCNFSM4HW6WROA .

maqsoodahmadjan commented 5 years ago

Sample script:

Java.perform(function(){ console.log("Hello World"); });

r2Frida Environment: By r2Frida environment, I meant when an app is launched using r2Frida.

Running the script: Using the . operator and specifying the path to the .js file.

trufae commented 5 years ago

The . Command runs script inside r2 in host. This is, with nodejs. What you want to use is the . Which loads and runs the script in the agent side

On 11 Jun 2019, at 16:43, Maqsood Ahmad notifications@github.com wrote:

Sample script:

Java.perform(function(){ console.log("Hello World"); });

r2Frida Environment: By r2Frida environment, I meant when an app is launched using r2Frida.

Running the script: Using the . operator and specifying the path to the .js file.

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

maqsoodahmadjan commented 5 years ago

Yes. You are right. I thought it was without a slash and the error might be coming from somewhere else. Sorry for the trouble.