Is there a way to restore this field offset original value when the toggle is off?
Code:
bool isUnlimitedFlashbang;
void (*old_playerToolsSection)(void *instance);
void playerToolsSection(void *instance) {
if (instance != NULL) {
if (isUnlimitedFlashbang) {
*(int *) ((uint32_t) instance + 0x10C) = 5;
}
}
return old_playerToolsSection(instance);
}
HOOK_LIB("libil2cpp.so", "0x4631A0", playerToolsSection, old_playerToolsSection);
case 3:
isUnlimitedFlashbang = boolean;
break;