vfsfitvnm / frida-il2cpp-bridge

A Frida module to dump, trace or hijack any Il2Cpp application at runtime, without needing the global-metadata.dat file.

Home Page:https://github.com/vfsfitvnm/frida-il2cpp-bridge/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReferenceError: IL2CPP_EXPORTS is not defined

thienha1 opened this issue · comments

My script:

import "frida-il2cpp-bridge"

declare global {
  let IL2CPP_EXPORTS: Record<string, () => NativePointer>;
}

IL2CPP_EXPORTS = {
  il2cpp_get_methods: () => Il2Cpp.module.base.add(0x8002698),
  il2cpp_get_corlib: () => {
    return Memory.scanSync(Il2Cpp.module.base, Il2Cpp.module.size, "fd 7b bd a9 f5 0b 00 f9 fd 03 00 91 f4 4f 02 a9 93 38 01 b0 68 36 52")[0].address;
  },
  il2cpp_init: () => Il2Cpp.module.getExportByName("_ZdlPvm"),
};
Il2Cpp.perform(() => {
  Il2Cpp.dump("starrail.cs");
});

Error:

ReferenceError: IL2CPP_EXPORTS is not defined
    at index.ts:7:1
[M2007J20CG::com.hoyoverse.hsroversea]-> ReferenceError: IL2CPP_EXPORTS is not defined
    at index.ts:7:1
ReferenceError: IL2CPP_EXPORTS is not defined
    at index.ts:7:1

How to fix?

(globalThis as any).IL2CPP_EXPORTS = {
  il2cpp_get_methods: () => Il2Cpp.module.base.add(0x8002698),
};