Skip to content

Installation

vfsfitvnm edited this page Sep 15, 2021 · 6 revisions

From scratch

This is a Frida TypeScript module, so it follows any other TypeScript (npm) project:

playground
├── index.ts
├── package.json
└── tsconfig.json

This is how it should looke like:

index.ts
This is where you write the code. More info here.

import "frida-il2cpp-bridge";

Il2Cpp.perform(() => {
    // code here
});

packages.json
This is where you can declare scripts (commands to execute) and dependencies.
frida-compile packs and transpile a multi file project with its dependencies into a single plain JavaScript file (its name is _.js here).
Learn more about packages.json here.

{
  "name": "playground",
  "main": "index.ts",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "build": "frida-compile -o _.js -w index.ts",
    "attach": "run() { frida -U \"$1\" -l _.js --runtime=v8; }; run",
    "spawn": "run() { frida -U -f \"$1\" -l _.js --no-pause --runtime=v8; }; run",
    "app0-spawn": "npm run spawn com.example.application0",
    "app1": "npm run \"Application1 Name\"",
    "app1-spawn": "npm run spawn com.example.application1"
  },
  "devDependencies": {
    "@types/frida-gum": "^17.1.0",
    "frida-compile": "^10.2.4",
    "frida-il2cpp-bridge": "^0.5.5"
  }
}

tsconfig.json
You can just copy and paste this.
Learn more about tsconfig.json here.

{
  "compilerOptions": {
    "target": "esnext",
    "lib": [
      "es2020"
    ],
    "experimentalDecorators": true,
    "module": "commonjs",
    "allowJs": true,
    "noEmit": true,
    "esModuleInterop": true,
    "strict": true
  }
}

Integration

If you just want to add this module to an already existing project:

$ npm install --save-dev frida-il2cpp-bridge

You need to add "moduleResolution": "node" or "module": "commonjs", in your tsconfig.json under compilerOptions.

Clone this wiki locally