void (*EndRound)(void *instance);
bool EndCurrentRound;
void (*old_ClassName_Update)(void *instance);
void ClassName_Update(void *instance) {
if(instance!=nullptr) {
if(EndCurrentRound) {
EndRound(instance);
EndCurrentRound=false; // because we only want to call the method once
}
}
old_ClassName_Update(instance);
}
HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); // Add offset of update method
EndRound = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET); // Add offset of EndRound method
OBFUSCATE("XX_Button_END ROUND"), // XX = add number at start to link to case
case XX:
EndCurrentRound = !EndCurrentRound;
break;
Hooking a void method example: private void EndRound() {}
1) Hook it like so...
C++:void (*EndRound)(void *instance);
2) Create a boolean switch for EndRound, make sure it has a different name than the hooked method name, like so...
C++:bool EndCurrentRound;
Since this is a void function which can't return anything, we must call it through an update method, preferably one from the same class. This can be LateUpdate, Update, FixedUpdate etc.
3) Create the update hook like so...
C++:void (*old_ClassName_Update)(void *instance); void ClassName_Update(void *instance) { if(instance!=nullptr) { if(EndCurrentRound) { EndRound(instance); EndCurrentRound=false; // because we only want to call the method once } } old_ClassName_Update(instance); }
Now under hackthread we put this code...
C++:HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); // Add offset of update method EndRound = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET); // Add offset of EndRound method
Next we add a button to our menu and the case, like so...
C++:OBFUSCATE("XX_Button_END ROUND"), // XX = add number at start to link to case case XX: EndCurrentRound = !EndCurrentRound; break;
Hooking a void method example: private void EndRound() {}
1) Hook it like so...
C++:void (*EndRound)(void *instance);
2) Create a boolean switch for EndRound, make sure it has a different name than the hooked method name, like so...
C++:bool EndCurrentRound;
Since this is a void function which can't return anything, we must call it through an update method, preferably one from the same class. This can be LateUpdate, Update, FixedUpdate etc.
3) Create the update hook like so...
C++:void (*old_ClassName_Update)(void *instance); void ClassName_Update(void *instance) { if(instance!=nullptr) { if(EndCurrentRound) { EndRound(instance); EndCurrentRound=false; // because we only want to call the method once } } old_ClassName_Update(instance); }
Now under hackthread we put this code...
C++:HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); // Add offset of update method EndRound = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET); // Add offset of EndRound method
Next we add a button to our menu and the case, like so...
C++:OBFUSCATE("XX_Button_END ROUND"), // XX = add number at start to link to case case XX: EndCurrentRound = !EndCurrentRound; break;
Hmm, that sounds interesting, I'll try it, I'll look again at the code and how you explained it to understand it better, thank you very muchHooking a void method example: private void EndRound() {}
1) Hook it like so...
C++:void (*EndRound)(void *instance);
2) Create a boolean switch for EndRound, make sure it has a different name than the hooked method name, like so...
C++:bool EndCurrentRound;
Since this is a void function which can't return anything, we must call it through an update method, preferably one from the same class. This can be LateUpdate, Update, FixedUpdate etc.
3) Create the update hook like so...
C++:void (*old_ClassName_Update)(void *instance); void ClassName_Update(void *instance) { if(instance!=nullptr) { if(EndCurrentRound) { EndRound(instance); EndCurrentRound=false; // because we only want to call the method once } } old_ClassName_Update(instance); }
Now under hackthread we put this code...
C++:HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); // Add offset of update method EndRound = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET); // Add offset of EndRound method
Next we add a button to our menu and the case, like so...
C++:OBFUSCATE("XX_Button_END ROUND"), // XX = add number at start to link to case case XX: EndCurrentRound = !EndCurrentRound; break;
Thanks bro, I'll test it, I'll look carefully at how you explained it to learnHooking a void method example: private void EndRound() {}
1) Hook it like so...
C++:void (*EndRound)(void *instance);
2) Create a boolean switch for EndRound, make sure it has a different name than the hooked method name, like so...
C++:bool EndCurrentRound;
Since this is a void function which can't return anything, we must call it through an update method, preferably one from the same class. This can be LateUpdate, Update, FixedUpdate etc.
3) Create the update hook like so...
C++:void (*old_ClassName_Update)(void *instance); void ClassName_Update(void *instance) { if(instance!=nullptr) { if(EndCurrentRound) { EndRound(instance); EndCurrentRound=false; // because we only want to call the method once } } old_ClassName_Update(instance); }
Now under hackthread we put this code...
C++:HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); // Add offset of update method EndRound = (void(*)(void*)) getAbsoluteAddress(targetLibName, 0xOFFSET); // Add offset of EndRound method
Next we add a button to our menu and the case, like so...
C++:OBFUSCATE("XX_Button_END ROUND"), // XX = add number at start to link to case case XX: EndCurrentRound = !EndCurrentRound; break;
void (*set_ammo)(void *instance, int ammo);
bool UnlimitedAmmo;
void (*old_ClassName_Update)(void *instance);
void ClassName_Update(void *instance) {
if(instance!=nullptr) {
if(UnlimitedAmmo) {
set_ammo(instance, 9999);
}
}
old_ClassName_Update(instance);
}
HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update);
set_ammo = (void(*)(void*, int)) getAbsoluteAddress(targetLibName, 0xOFFSET);
OBFUSCATE("XX_ButtonOnOff_Unlimited Ammo"),
case XX:
UnlimitedAmmo = boolean;
break;
I don't know if there is a way to send images here, but I want to call a function but it doesn't have Update, LateUpdate or FixedUpdate, this function that I want to call takes to a "public enum XPManager.eXPcat" which inside has several names like that, I'll give an example of "public const XPManager.eXPcat avakinlife_xp_reward_talking = 0;"Here is another example, this time a void method with an int parameter.
Example: private void set_ammo(int ammo) {}
Again we hook it through an update method like so...
C++:void (*set_ammo)(void *instance, int ammo); bool UnlimitedAmmo; void (*old_ClassName_Update)(void *instance); void ClassName_Update(void *instance) { if(instance!=nullptr) { if(UnlimitedAmmo) { set_ammo(instance, 9999); } } old_ClassName_Update(instance); }
Then under hackthread...
C++:HOOK("0xOFFSET", ClassName_Update, old_ClassName_Update); set_ammo = (void(*)(void*, int)) getAbsoluteAddress(targetLibName, 0xOFFSET);
Lastly make our switch & case...
C++:OBFUSCATE("XX_ButtonOnOff_Unlimited Ammo"), case XX: UnlimitedAmmo = boolean; break;
Hope this helps, if you need any more examples just ask.
void (*AddXP)(void *instance, int inCat);
void (*old_Update)(void *instance);
void Update(void *instance) {
if(instance!=nullptr) {
AddXP(instance, XX); // Replace XX with XPManager.eXPcat reward number of choice (0-16)
}
old_Update(instance);
}
HOOK("0xOFFSET", Update, old_Update);
AddXP = (void(*)(void*, int)) getAbsoluteAddress(targetLibName, 0x24FD2A8);
C++:void (*AddXP)(void *instance, int inCat); void (*old_Update)(void *instance); void Update(void *instance) { if(instance!=nullptr) { AddXP(instance, XX); // Replace XX with XPManager.eXPcat reward number of choice (0-16) } old_Update(instance); }
Under hackthread...
C++:HOOK("0xOFFSET", Update, old_Update); AddXP = (void(*)(void*, int)) getAbsoluteAddress(targetLibName, 0x24FD2A8);
This screenshot only shows the enum values you can use, not a method that uses WeaponSlot as a parameter, for example...View attachment 661548
Help me please To Hook This enum
This screenshot only shows the enum values you can use, not a method that uses WeaponSlot as a parameter, for example...
private void EquipWeapon(WeaponSlot item) {}
None of those methods have a parameter of WeaponSlot, keep lookingView attachment 661586
I Found This
I Hooked foid like This but my game crashesNone of those methods have a parameter of WeaponSlot, keep looking
I can't find l think it's hard gameNone of those methods have a parameter of WeaponSlot, keep looking
None of those methods have a parameter of WeaponSlot, keep looking
Can you help me hook this enum?C++:void (*AddXP)(void *instance, int inCat); void (*old_Update)(void *instance); void Update(void *instance) { if(instance!=nullptr) { AddXP(instance, XX); // Replace XX with XPManager.eXPcat reward number of choice (0-16) } old_Update(instance); }
Under hackthread...
C++:HOOK("0xOFFSET", Update, old_Update); AddXP = (void(*)(void*, int)) getAbsoluteAddress(targetLibName, 0x24FD2A8);
Can you help me hook this enum? View attachment 664205View attachment 664204
void (*AddItem)(void *instance, int type, int value, monoString *source);
void (*old_Update)(void *instance);
void Update(void *instance) {
if(instance!=nullptr) {
AddItem(instance, XX, XX, (CreateString(""))); // Replace XX with number of choice
}
old_Update(instance);
}
thanks❤Can you help me hook this enum? View attachment 664205View attachment 664204
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies