I read the relevant information, but I don't know how to hook void
does this work?
I tried it and it crashes the game process,What is the right way to do it?
C++:
void *isatk;
//bool isatk = false;
void (*old_AddDamage)(void *instance);
void AddDamage(void *instance){
if(instance != NULL){
if(isatk){
((uint64_t) instance);
//*(int *) ((uint64_t) instance + 0x10) = 0;
// old_AddDamage(instance, 999);
}
}
old_AddDamage(instance);
}
// old_AddDamage = (void(*)(void *,int))getAbsoluteAddress(targetLibName, 0x9BBBA4);
A64HookFunction((void *) getAbsoluteAddress("libil2cpp.so",0x9BBBA4),(void *)AddDamage,(void**)&old_AddDamage);
case 0:
bool isatk = boolean;
break;
I tried it and it crashes the game process,What is the right way to do it?