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.04k stars 203 forks source link

teaching how to transfer to emulator #548

Open Laranjo1 opened 1 month ago

Laranjo1 commented 1 month ago

First, install frida-tools:

pip install frida-tools

After installing frida-tools, go to this GitHub page:
frida-server-x86
Locate and download:
frida-server-16.5.1-android-x86.xz

Then, download this emulator (I’ve only tested with this one):
LDPLAYER 5 x86

After this, you're almost set up!
Run the following commands:

npm init -y
npm i -D @types/node @types/frida-gum typescript frida-compile frida-il2cpp-bridge

Add this to the package.json file generated by npm init:

"scripts": {
    "spawn": "frida -U -f com.CrystalDev.DragonCrystalArena --realm emulated -l dist/agent.js",
    "watch": "frida-compile src/index.ts -o dist/agent.js -w",
    "build": "frida-compile src/index.ts -o dist/agent.js -c"
},

Note: My build script doesn't work, I’m not sure why. Any suggestions would be appreciated!

Next, create the following folder and file structure:

src
     └── index.ts
dist
     └── agent.js

Setting up the LDPlayer Emulator:

  1. Open the directory where LDPlayer4 is installed.
  2. Execute the following commands:
adb devices
adb push <local path to frida-server-16.5.1-android-x86> "data/local/tmp"
adb shell "chmod 777 data/local/tmp/frida-server-16.5.1-android-x86"
adb shell "data/local/tmp/frida-server-16.5.1-android-x86" &

To run the program:

  1. Open a terminal in the project directory and run:

    npm run watch
  2. Open a second terminal and run:

    npm run spawn
  3. Make any change to the code (I usually leave a comment for this).

Ignore the two errors that may appear, and your Frida setup should be operational!

namtacs commented 1 month ago

This is the same as following the official guide https://frida.re/docs/android/ and using files from the wiki. The emulator makes no difference in setup from a normal device apart from the need of --realm emulated to attach to the emulated ARM realm (libhoudini).

Laranjo1 commented 1 month ago

"And what about Android 9.0 (64-bit)? Can it be used? I tried, but I still couldn't find libil2cpp."

For emulators I think only can x86