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

Call from Il2Cpp.Class with instance argument #482

Closed commonuserlol closed 9 months ago

commonuserlol commented 9 months ago

I have a method which was found in Il2Cpp.Class (e.g. object.class.methods.find(_ => _.name == "name" && _.isGeneric)!.inflate(klass)). How i can invoke it with 1st argument as instance like .invoke(object) but it throws error, so my temp solution is:

//@ts-ignore
.invokeRaw(object) as Il2Cpp.Object;
thinhbuzz commented 9 months ago

.withHolder(object).invoke()

vfsfitvnm commented 9 months ago

Either is fine :smile:

commonuserlol commented 9 months ago

.withHolder(object).invoke()

withHolder is internal so i have to disable linter like with .invokeRaw (ts-ignore)

commonuserlol commented 9 months ago

Okay i just replaced finding generic method to object.method<Il2Cpp.Object>("GetComponent").overload("System.Type").invoke(klass.type.object);