First draft of dynamic detours using Ayuto's DynamicHooks library

https://github.com/Ayuto/DynamicHooks
This commit is contained in:
Peace-Maker
2016-12-11 22:02:10 -07:00
parent fd8866a540
commit 2e52ab24b7
84 changed files with 57658 additions and 114 deletions
+11
View File
@@ -72,6 +72,13 @@ enum HookType
HookType_Raw
};
enum CallingConvention
{
CallConv_CDECL,
CallConv_THISCALL,
CallConv_STDCALL,
};
enum MRESReturn
{
MRES_ChangedHandled = -2, // Use changed values and return MRES_Handled
@@ -176,6 +183,10 @@ native bool DHookRemoveEntityListener(ListenType type, ListenCB callback);
*/
native Handle DHookCreate(int offset, HookType hooktype, ReturnType returntype, ThisPointerType thistype, DHookCallback callback);
native Handle DHookCreateDetour(Address funcaddr, CallingConvention callConv, ReturnType returntype, ThisPointerType thistype);
native bool DHookSetFromConf(Handle setup, Handle gameconf, SDKFuncConfSource source, const char[] name);
native bool:DHookEnableDetour(Handle:setup, bool:post, DHookCallback callback);
/* Adds param to a hook setup
*
* @param setup Setup handle to add the param to.