Trying to hook a double return IL2CPP method in a 32-bit (ARMv7) lib using LGL Mod Menu 3.2. Hooking get_CashBonus() at offset 0x160DB18 in libil2cpp.so crashes the game. Offsets confirmed working using an offset tester. Need help with proper hook logic and installation for double return types on ARMv7.
bool cashbonusEnabled = false;
double (*orig_cashbonus)(void *instance);
double cashbonus_hook(void *instance) {
if (cashbonusEnabled && instance != nullptr) {
return 9999.0;
}
return orig_cashbonus(instan
ce);
}
HOOK_LIB("libil2cpp.so", "0x160DB18", cashbonus_hook, orig_cashbonus);
case 0:
cashbonusEnabled = featureON;
break;
bool cashbonusEnabled = false;
double (*orig_cashbonus)(void *instance);
double cashbonus_hook(void *instance) {
if (cashbonusEnabled && instance != nullptr) {
return 9999.0;
}
return orig_cashbonus(instan
ce);
}
HOOK_LIB("libil2cpp.so", "0x160DB18", cashbonus_hook, orig_cashbonus);
case 0:
cashbonusEnabled = featureON;
break;