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

Help! How to hook that void fun.?

C++:
void (*FinishAllQuests)(void *instance);





FinishAllQuests = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0x7E6EE0);


You need to hook it to an update method, preferably one from the same/similar class.
Then you can use it in a hook like so...

C++:
void (*old_Update)(void *instance);
void Update(void *instance) {
    if(instance!=nullptr) {
        if(Test) {
            FinishAllQuests(instance);
            Test=false;
        }
    }
    old_Update(instance);
}





HOOK("0xOFFSET", Update, old_Update);
 
Code:
int Void hooking (with update offset) =
bool VoidHookingint;

void (*Anyname)(void *instance,int value);
void (*_Voidinthooking)(void *instance);
void Voidinthooking(void *instance) {
    if (instance != NULL) {
        if (VoidHookingFloat) {
            Anyname(instance, 999); //you can replace it with any number you want
            }
            }
            return _Voidinthooking(instance);
            }

HOOK_LIB("libname","0xUpdateOffset",Voidinthooking,_Voidinthooking);
    
 Anyname = (void (*)(void *, int))getAbsoluteAddress(targetLibName,0xYourVoidOffset);
 
 
OBFUSCATE("0_Toggle_hackname"), 

 case 0:
        VoidHookingint = boolean;
                            break;
 
i make it like this it is possible?


void *instanceBtn;
void (*OpenredeemPanel)(void *instance);

void (*old_Update)(void *instance);
void Update(void *instance) {
if(instance!=nullptr) {
if(Test) {
FinishAllQuests(instance);
Test=false;
}
}
old_Update(instance);
}


in lib64hook
OpenredeemPanel = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0x4E5714);

in featnum
case 3:
OpenredeemPanel(instanceBtn);
break;
 
Thank you so much bro! I had an INT getmagsize for ammo but when I hex patched it for infinite ammo it didn't do anything in game. So then I hooked it but it still didn't do anything. And that's all I had for ammo believe it or not. I was totally discounting a VOID "set mag size" for ammo that I had, because I thought that the only thing I can do with a VOID method is NOP it. So just for the hell of it I NOP'd it to see what would happen, and nothing happened. So then I hooked it for 9999 using your code above and it worked! By the way, I don't know why but I couldn't use those 2 lines. I kept getting errors. So I just deleted those 2 lines and it still worked lol
Code:
int Void hooking (with update offset) =
bool VoidHookingint;
 
Thank you so much bro!
 

It might be called LateUpdate or FixedUpdate. Those should also work. Otherwise try a Start() or Awake() method. And when all else fails look for an Update/LateUpdate/FixedUpdate/Start/Awake from a different but similar class. Good luck