nowsecure / r2frida

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

throw new SyntaxError("unexpected character") when trying to load script compiled with frida-compile -c #487

Closed dogtopus closed 1 year ago

dogtopus commented 1 year ago

See title.

trufae commented 1 year ago

Can you explain what did you do?

is this happening just after building r2frida? Are you trying to run a frida compiled script withon r2frida? Which version of frida-compile are you using? Can you share the steps to reproduce? Did you tried using r2frida-compile instead?

dogtopus commented 1 year ago

is this happening just after building r2frida?

I believe yes.

Are you trying to run a frida compiled script withon r2frida?

Yes. Specifically using the frida-compile tool within an npm package that contains the agent. Similar to frida-agent-example.

Which version of frida-compile are you using?

16.1.9

Can you share the steps to reproduce?

Mostly just run frida-compile agent/index.ts -o _agent.js -c via npm and load with :. _agent.js right away in r2frida. This is also via remote connection to frida-server running on Windows if that makes any difference.

I can try to reproduce this with a minimal example but that might take a bit of time.

Did you tried using r2frida-compile instead?

No but I could try.

trufae commented 1 year ago

If i understood the issue properly this happens to me only on windows. Works fine on linux and mac. Its a known issue after updating to frida16 and iirc until 16.1.18 i wasnt able to build the agent in ubuntu20. And that same version also fixed the windows compilation using the pip's frida-compile.

i'll look into that next week, it's not clear to me where the bug is yet.

can you confirm the same behaviour? (Only happens on windows)

trufae commented 1 year ago

dupe of dupe of https://github.com/nowsecure/r2frida/issues/444 (there are 5 issues about r2frida not working on windows) when thats a known issue and probably a bug in frida, i'm slowly investigating the issue but i didnt managed to find the reason why the compiled scripts are not parsed properly by frida inside r2frida.