Kasuromi / GTFO-API

GNU General Public License v3.0
9 stars 7 forks source link

Add support for uninjecting types from IL2CPP #20

Closed Panthr75 closed 2 years ago

Panthr75 commented 3 years ago

That way we can remove all of our types we've injected in BasePlugin.Unload().

Example:

[BepInPlugin(INFO.GUID, INFO.NAME, INFO.VERSION)]
class Plugin : BasePlugin
{
    public override void Load()
    {
        PatchManager.PatchAll();
        ClassInjector.RegisterTypeInIL2CPP<MyType>();

        // other init stuff
    }

    public override bool Unload()
    {
        PatchManager.UnpatchAll();
        ClassInjector.DeregisterTypeInIL2CPP<MyType>();

        // other uninit stuff

        return base.Unload();
    }
}
Kasuromi commented 2 years ago

BepInEx's mono runtime does not support unloading plugins from memory so this serves close to no purpose.

Move this issue to either unhollower or my unhollower rewrite when I make it public