View Single Post
elymination
New Member
Join Date: Jul 2020
Old 07-26-2020 , 20:03   Re: DHooks (Dynamic Hooks - Dev Preview)
Reply With Quote #778

using dhooks to hook TraceAttack on CS:GO, but it crashes after the callback is executed (PrintToServer effectively prints something before the server crashes).
what could be the problem? no error message before crashing and no log explaining what would be the culprit

edit: managed to fix the crash, the params weren't correct. here is the correct way to hook TraceAttack, for anyone interested:

Code:
DHOOK_TraceAttack = DHookCreate(offset, HookType_Entity, ReturnType_Int, ThisPointer_CBaseEntity, TraceAttack);
DHookAddParam(DHOOK_TraceAttack, HookParamType_ObjectPtr, -1, DHookPass_ByRef);	// CTakeDamageInfo const&
DHookAddParam(DHOOK_TraceAttack, HookParamType_ObjectPtr, -1, DHookPass_ByRef);	// Vector const&
DHookAddParam(DHOOK_TraceAttack, HookParamType_ObjectPtr, -1, DHookPass_ByVal);	// CGameTrace*

Last edited by elymination; 07-27-2020 at 11:21.
elymination is offline