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

C# typeof operator invocation

commonuserlol opened this issue · comments

There's method which consumes System.Type as argument, when in 'normal' C# it looks like

method(typeof(Klass));

Can i somehow invoke typeof operator? (Yes there's another overload with T method(); and i still remember how to work with it, but i'm interested in typeof)

For that case you need to somehow get the Il2Cpp.Class of the the type then inflate it, and invoke the method.
If you have an Il2Cpp.Object then you can get the class that way or you could simply find the class in the assembly.

wdym? I need get type of class, to pass to method (for example: UnityEngine.Component GetComponent(System.Type type);)

const klass: Il2Cpp.Class = ...
const managedType: Il2Cpp.Object = klass.type.object; // a System.Type