Help! Can't Hook double Return Function on ARMv7 (LGL 3.2)

jeanpee07

Rookie
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;
 
sometimes hooks just do that, they crash for 0 reason even if your code is right, try hooking and just returning the orig, if THAT crashes then its the fault of whatever hooking library you use, if thats the case id suggest switching between and64inlinehook, dobby and shadowhook and seeing whatever works
 
Back
Top Bottom