How can you call a game function inside a function hook?
For example, I hooked the recv function of winsock. Then, I examined a packet. This packet has the value of my current hp. I check the hp. If it's lower than the constant hp threshold I will call a game function that uses an item to heal my hp. Is it possible to call that game function without crashing the application?
I tried and watch the execution in the debugger it's calling the game function of use item. However, it crashes the application. I think it's probably because of registers? The stack is fine btw.
I'm wondering why I when calling the send function of winsock inside the recv function does not crash. But when I call a game function other than send it crashes. Is it because i'm in a different module? or You can't call a function in a different module? But I followed the execution in the debugger and when the call to use item is executed it really goes to that function. Help me please.