Jump to content

Game crashing after a hook


Wayhaysoe

1 post in this topic

Recommended Posts

Posted

So there is a function in a class called

protected float get_Damage(); // RVA 0x101510283 Offset: 0x1510283

I’m using a textfield to modify the function  

This is my code

float(*old_get_damage)(void *ok, float damage);

float get_damage(void *ok, float damage) {

 

float customDamage = [[switches getValueFromSwitch:@"Set Damage"] floatValue];

 

if([switches isSwitchOn:@"Set Damage"]) {

damage = customDamage;

return damage;

}

return old_get_damage(ok,damage);

}

 

void setup() {

 

HOOK(0x101510283,get_damage,old_get_damage);

im not sure if it’s because of my return old_get_damage(ok,damage); statement but the game always crashes after my character attacks. Sometimes it works and my character one hits but then it crashes after 10 seconds. When the switch is off it crashes as well.

Archived

This topic is now archived and is closed to further replies.

×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines