This is the AMP version of this page.
If you want to load the real page instead, click this text.

Help! About Button Hook - LGLTeam Android Mod Menu

TFive

Platinian
Hello, I have a question about using button to hook method.
this is what i wrote but can't use the button What did I do wrong?

code:







 

That's not a must; it makes no difference wether you call if(...) xxxx; or if(...){xxxx;} as long as xxxx is a "one liner"
Moreover, if(...){} allows for more "lines" for a single if.
 
help hooking OnUpdate





void (*old_ActorDefaultControlPlayer_OnUpdate) (void *instance);

void (*OnClickFishing) (void *instance) = (void *()(void *))getAbsoluteAddress("libil2cpp.so", 0xB6108648);

void ActorDefaultControlPlayer_OnUpdate(void *instance){
if (instance != NULL && feature3){
uint _fishingState = (uint) ((uint)instance + 0x20C);
if (_fishingState == 0){
OnClickFishing(instance);
}
else if (_fishingState == 4){

}
}
old_ActorDefaultControlPlayer_OnUpdate(instance);
}
 
This example might solve your problem:

C++:
int iAmmo = 0;

void *sAmmoBtn;



void (*old_m_Count)(void *instance);
void m_Count(void *instance) {
if (instance != NULL) {
  if (sAmmoBtn != NULL) {
   *(int *) ((uint64_t) instance + 0x10) = iAmmo;
  }
}
return old_m_Count(instance);
}