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.03k stars 202 forks source link

Is it possible to replace a constructor implementation? #173

Closed jeremycurda closed 2 years ago

jeremycurda commented 2 years ago
const Ctor = Class.method(".ctor");
Ctor.implementation =
    function (param1: number, param2: number): ??? {
        const instance = Class.alloc();
        instance.method(".ctor").invoke(param1, param2);
        console.log(param1, param2);
        return ???;
    };

I'm not sure if this is possible or if I'm missing something really obvious.

jeremycurda commented 2 years ago

Alright nevermind I figured it out by re-reading issue #25

vfsfitvnm commented 2 years ago

Yup, constructors do not return any value