Hi, I'm having a problem with hooking methods in a Unity game using offsets.
When the hooked method gets called, the game crashes. This is how I hook (address taken from il2cpp dumps):
void (*Player_Update)(void* self);
void _Player_Update(void* self) {
Player_Update(self);
}
void setup() {
HOOK(0x1B01BE0, _Player_Update, Player_Update);
}
When setting up a menu I'm also targeting UnityFramework:
void setupMenu() {
menu = [[Menu alloc]
....
[menu setFrameworkName: "UnityFramework"];
setup();
}
Does anybody have an idea what could be wrong with the code? Could it be game's anti-cheat? What steps do I take to find the problem. With a debugger and trace back what exactly offsets in the crash log mean? The game is Standoff 2, if that makes a difference. I'm quite confused, sorry for a long question Thanks in advance!