Open Zaclin-GIT opened 4 months ago
did you check if get_method
actually returns a valid result? And instead of doing new IKFIMIBKGEP_o()
, try to create the object by calling its constructor (method name should be .ctor).
IKFIMIBKGEP_o is an instance of the IKFIMIBKGEP class (_o = object), while IKFIMIBKGEP_c is the class itself (_c = class)
Thank you for explain the difference between _c & _o. I assumed that's what they meant but wasn't sure. As for calling the SendMessage method, I tried to call the constructor method of the IKFIMIBKGEP class, but it doesn't have a namespace (https://imgur.com/a/EWNRLqk) and I don't have a local version of the class because it doesn't appear to have been initialized yet. I did try to initialize it myself prior to using the call function but that didn't work either.
il2cpp::call_function<IKFIMIBKGEP_c>(il2cpp::get_method("", "IKFIMIBKGEP", ".ctor"), packet);
This just results in a crash. Let me know if this is what you meant by calling the constructor.
I've tried so many different methods at this point that I cant even remember what I have tried.
I appreciate your help.
you probably crash when using il2cpp::call_function<IKFIMIBKGEP_c>(il2cpp::get_method("", "IKFIMIBKGEP", ".ctor"), packet);
because get_method
returns a nullptr. Make sure that it returns a valid result first (you might need to remove the _namespace.empty()
check inside of get_method to be able to find methods without namespace)
I am attempting to call a method called "SendMessage" from the class "SocketManager".
DCBCCBKEIHN is the base packet class and each of the packet classes derive from this.
Example of one of the packet classes:
When attempting to call this method and pass one of the packet classes as an argument, I crash. I've tried multiple different ways of casting the packet to the base class in hopes it would accept it as an arg, but I'm having no luck. I was able to get another much simpler hook working.
Example of what I believe the call should look like:
il2cpp::call_function<void>(il2cpp::get_method("DecaGames.RotMG.Managers.Net", "SocketManager", "SendMessage"), LocalSocketManager, new IKFIMIBKGEP_o(), 0);
Can anyone please explain why this doesnt work.
Also, if anyone could explain the difference between IKFIMIBKGEP_o & IKFIMIBKGEP_c, that would be much appreciated.
Thanks.