diff --git a/src/core/init.cpp b/src/core/init.cpp index 9cb497b8..5c14b349 100644 --- a/src/core/init.cpp +++ b/src/core/init.cpp @@ -147,6 +147,7 @@ #include "game/client/input.h" #include "game/client/movehelper_client.h" #include "game/client/vscript_client.h" +#include "game/client/cliententitylist.h" #endif // !DEDICATED #include "public/edict.h" #ifndef DEDICATED @@ -678,6 +679,7 @@ void DetourRegister() // Register detour classes to be searched and hooked. REGISTER(V_ViewRender); REGISTER(VInput); REGISTER(VMoveHelperClient); + REGISTER(VClientEntityList); #endif // !DEDICATED // Public diff --git a/src/game/client/cliententitylist.cpp b/src/game/client/cliententitylist.cpp index cd9160ad..0a1ac7f1 100644 --- a/src/game/client/cliententitylist.cpp +++ b/src/game/client/cliententitylist.cpp @@ -4,4 +4,4 @@ // Purpose: a global list of all the entities in the game. All iteration through // entities is done through this object. //----------------------------------------------------------------------------- -CClientEntityList* g_clientEntityList = nullptr; // todo(amos): obtain game object. +CClientEntityList* g_clientEntityList = nullptr; diff --git a/src/game/client/cliententitylist.h b/src/game/client/cliententitylist.h index 92662b01..72e43333 100644 --- a/src/game/client/cliententitylist.h +++ b/src/game/client/cliententitylist.h @@ -62,4 +62,27 @@ COMPILE_TIME_ASSERT(sizeof(CClientEntityList) == 0x3800C0); inline IClientEntityList* g_pClientEntityList = nullptr; +extern CClientEntityList* g_clientEntityList; + +/////////////////////////////////////////////////////////////////////////////// +int HSys_Error_Internal(char* fmt, va_list args); + +/////////////////////////////////////////////////////////////////////////////// +class VClientEntityList : public IDetour +{ + virtual void GetAdr(void) const + { + LogVarAdr("g_clientEntityList", g_clientEntityList); + } + virtual void GetFun(void) const { } + virtual void GetVar(void) const + { + g_GameDll.FindPatternSIMD("48 8D 0D ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 44 89 0D"). + ResolveRelativeAddressSelf(3, 7).ResolveRelativeAddressSelf(3, 7).GetPtr(g_clientEntityList); + } + virtual void GetCon(void) const { } + virtual void Detour(const bool bAttach) const { }; +}; +/////////////////////////////////////////////////////////////////////////////// + #endif // CLIENTENTITYLIST_H