Game is FWD assault [for testing]
if we have a method like this
we can simply call it using the update offset which is this
with a code like this
Result for this , when the button is on the method will be called and ammo will always be refilled [tested working]
My Question is : how to call this method without the use of the update method . [in case the class itself does not have any update method.]
if we have a method like this
we can simply call it using the update offset which is this
with a code like this
C++:
bool RefillAmmoInAllWeaponsHook = false;
void (*RefillAmmoInAllWeapons)(void* instance);
void(*old_RefillAmmoInAllWeaponsUpdate) (void *instance);
void RefillAmmoInAllWeaponsUpdate(void *instance) {
if(instance != NULL) {
if (RefillAmmoInAllWeaponsHook){
RefillAmmoInAllWeapons(instance);
}
}
old_RefillAmmoInAllWeaponsUpdate(instance);
}
void *hack_thread(void *) {
do {
sleep(1);
} while (!isLibraryLoaded(targetLibName));
#if defined(__aarch64__)
#else
RefillAmmoInAllWeapons = (void(*)(void *))getAbsoluteAddress(targetLibName, string2Offset(OBFUSCATE_KEY("0x687D6C", 'A')));
MSHookFunction((void *) getAbsoluteAddress(targetLibName, 0x6A7A38),
(void *) RefillAmmoInAllWeaponsUpdate, (void **) &old_RefillAmmoInAllWeaponsUpdate);
#endif
return NULL;
}
My Question is : how to call this method without the use of the update method . [in case the class itself does not have any update method.]