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
918 stars 191 forks source link

Error: breakpoint triggered on creating a scriptable object #446

Closed Patrick-van-Halm closed 7 months ago

Patrick-van-Halm commented 7 months ago
Il2Cpp.perform(() => {
    const CoreModule = Il2Cpp.domain.assembly("UnityEngine.CoreModule").image;
    const UIElementsModule = Il2Cpp.domain.assembly("UnityEngine.UIElementsModule").image;
    const PanelSettings = UIElementsModule.class("UnityEngine.UIElements.PanelSettings");
    const ScriptableObject = CoreModule.class("UnityEngine.ScriptableObject");
    const panelSettings = ScriptableObject.method("CreateInstance", 1).overload("System.Type").invoke(PanelSettings.type.object);
})

Causes the following stacktrace

Error: breakpoint triggered
    at invokeRaw (:13)
    at invoke (:13)
    at <anonymous> (index.ts:18)
    at t (:13)

Is there a way to fix this and create scriptableobjects on runtime? Unity version: 2022.3.5f1 Game: Phasmophobia

Patrick-van-Halm commented 7 months ago

Alright it seems the issue is solved by using

Il2Cpp.perform(() => {
...
}, "main");