peace-maker / DHooks2

Dynamic detouring support for the DHooks 2 SourceMod extension
https://forums.alliedmods.net/showthread.php?p=2588686#post2588686
67 stars 11 forks source link

Save all arguments before calling the original function #8

Closed peace-maker closed 4 years ago

peace-maker commented 4 years ago

Save the value of arguments in a seperate buffer for the post callback. Compiler optimizations might cause the registers or stack space to be reused and overwritten during function execution if the value isn't needed anymore at some point. This lead to different values in the post hook.

Now the post callback is guaranteed to have access to the same arguments the function was called with.

2