Skip to content
Guest Big Announcement

how can return by ms hook

Featured Replies

Can you show your whole Tweak.xm? Or is that it?

 

I also made a tutorial on MSHook hacking, so you might want to check that out. And hackable functions that work with MSHook are almost always something like __ZN6AddMoneyEi not what you put.

Updated by Guest

It's something like that:

 

int (*old__ZN7profile20setArmorUpgradeLevelEiN5armor5ParamEhb)();


int $__ZN7profile20setArmorUpgradeLevelEiN5armor5ParamEhb() { 

 return 999; 

 }


%ctor { 

MSHookFunction(((int*)MSFindSymbol(NULL, "__ZN7profile6addExpEi")),(int*)$__ZN7profile6addExpEi,(int**)&old__ZN7profile6addExpEi);

}

Updated by xXtcikotciXx

void (old*_Slot_SetMaxHP) (void *self)(int i1);




void Slot_SetMaxHP (void *self)(int i1) {
return old_Slot_SetMaxHP(self, 9999);
}


%ctor {

MSHookFunction(((void*)MSFindSymbol(NULL,"__YourOriginalSymbol")),(void*)Slot_SetMaxHP,(void**)&old_SlotSetMaxHP);

}

The only thing you have to do is replace 'YourOriginalSymbol' with the one from IDA. I saw your function has an integer argument so I put it like void(argument)

Updated by castix

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.