vfsfitvnm / frida-il2cpp-bridge

A Frida module to dump, trace or hijack any Il2Cpp application at runtime, without needing the global-metadata.dat file.
https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki
MIT License
1.03k stars 202 forks source link

ReferenceError: 'exports' is not defined at <anonymous> (/node_modules/frida-il2cpp-bridge/dist/index.js:2) #199

Closed notwhy closed 2 years ago

notwhy commented 2 years ago

hello i follow the step to install the frida-il2cpp-bridge

image but i met errors

Spawned `com.games`. Resuming main thread!
ReferenceError: 'exports' is not defined
    at <anonymous> (/node_modules/frida-il2cpp-bridge/dist/index.js:2)

after wath https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki/Installation

i also copy and paste tsconfig.json but it still not work. please help me.

extra info:

C:\Users\Administrator>node -v
v16.16.0

C:\Users\Administrator>npm -v
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
8.14.0
vfsfitvnm commented 2 years ago

I can't help you unfortunately - https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki/Installation clearly shows which files do you need and what their content is, so you are probably missing something.

notwhy commented 2 years ago

@vfsfitvnm Hi,Can you help me have a look ?Several methods have been tried 。 https://stackoverflow.com/questions/73047712/problem-with-installing-frida-module-frida-il2cpp-bridge

asomethings commented 2 years ago

This issue can be resolved by using lower version of frida-compile.

It seems there's a lot a of change in frida-compile how it compiles. So follow wiki guides and anyone who encounter this issue must check their package.json and check frida-compile's version is ^10.2.4 .

notwhy commented 2 years ago

after downgrade my frida-compile version to 10.2.4,it solved my problem. thanks :)

vfsfitvnm commented 2 years ago

@notwhy Alternatively, I recommend using esbuild instead of frida-compile, as it is way faster than the latter - that's what I personally use in my playground.

vfsfitvnm commented 2 years ago

Also, I apologize for being rude with you - unfortunately many people open issues about basic typescript stuff, and I always reply with contempt in such cases - I'm not a help desk.

This was not the case, however, you didn't include your project files and you didn't provide the commands sequence - so I couldn't help you further.

notwhy commented 2 years ago

Don't feel guilty. You're too kind

Giving and helping without compensation should not be blamed.

I also forgot to post my command sequence (the URL of the installation https://stackoverflow.com/questions/69980349/problem-with-installing-frida-module-frida-il2cpp-bridge-and-make-it-running). I have tried other methods of installation, but this error occurs most often. I also tried to change the Frida compile version in the past. But there will be a timeout after the change, so I went to the Internet to find the installation tutorial, and found that it was the same. I suspected that there was a problem in some local environment, but I was a novice, and I didn't know how to solve it.

Now the problem is solved. :)

Thank you for your contribution to open source

Have a good day @vfsfitvnm

FFeliziani commented 2 years ago

Hi @vfsfitvnm you mention in a comment that you're using esbuild in your playground. May I ask what settings you're using? Thanks!

vfsfitvnm commented 2 years ago

@FFeliziani Here it is:

{
  "name": "playground",
  "version": "1.0.0",
  "source": "index.ts",
  "main": "_.js",
  "private": true,
  "scripts": {
    "build": "npm exec esbuild -- --bundle --outfile=_.js --watch index.ts",
    "attach": "run() { frida -H 127.0.0.1:9888 \"$1\" -l _.js --runtime=v8; }; run",
    "spawn": "run() { frida -H 127.0.0.1:9888 -f \"$1\" -l _.js --no-pause --runtime=v8; }; run",
  },
  "devDependencies": {
    "@types/frida-gum": "^18.1.0",
    "esbuild": "^0.14.51",
    "frida-il2cpp-bridge": "^0.7.13"
  }
}
FFeliziani commented 2 years ago

Awesome, thank you very much!