Solved How to hook Static int

Status
Not open for further replies.

Exequel

Platinian
When I test The offset Tester in Patch Offset it Work Very well but when I use this hooking it doesn't work:

Code:
bool isUpgrade = false

int (*old_Gold)(void *instance);
int gold(void *instance) {
if (instance != NULL) {
if (isUpgrade) {
return 0;
}
}           
return old_Gold(instance);
}

MSHookFunction((void *) getAbsoluteAddress("libil2cpp.so", 0x163D878), (void *) &upgrade, (void **) &old_Upgrade);

OBFUSCATE("17_Toggle_Free Upgrade"),

case 17:
isUpgrade = boolean;
break;
 
Static functions don't require instance

C++:
bool isUpgrade = false

int (*old_Gold)();
int Gold() {
if (isUpgrade) {
    return 0;
    }     
return old_Gold();
}

MSHookFunction((void *) getAbsoluteAddress("libil2cpp.so", 0x163D878), (void *) &Gold, (void **) &old_Gold);


OBFUSCATE("17_Toggle_Free Upgrade"),

case 17:
isUpgrade = boolean;
break;
 
Thread will be set to "solved" and closed.
When you're not happy with that just send me a message and i will re-open the thread for you.

Thanks.
 
Status
Not open for further replies.
Back
Top Bottom