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

Wrong class without il2cpp perform #465

Closed commonuserlol closed 10 months ago

commonuserlol commented 10 months ago
const core = Il2Cpp.domain.assembly("UnityEngine.CoreModule").image;
const vec3 = core.class("UnityEngine.Vector3");
const pos = vec3.alloc();
console.log(vec3.name) // "Vector3"
console.log(pos.toString()) // "UnityEngine.Coroutine"

with Il2Cpp.perform it correctly creates new vector3, but why without it does this?

vfsfitvnm commented 10 months ago

Interesting! I don't know :smile: Perhaps you are executing the code way too early: Il2Cpp::perform ensures everything is ready just before executing the given callback