From d88f07fd31daa805b1bcd3a28ba7a169d32cc395 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Thu, 23 Aug 2012 07:47:44 -0400 Subject: [PATCH] Updated SDKTools IServer finding on Windows for Ep2v and CSS (bug 5450, r=me). --- extensions/sdktools/vglobals.cpp | 8 ++++++++ gamedata/sdktools.games/engine.css.txt | 6 +++--- gamedata/sdktools.games/engine.ep2valve.txt | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/extensions/sdktools/vglobals.cpp b/extensions/sdktools/vglobals.cpp index 5bdae558..c1a8ae54 100644 --- a/extensions/sdktools/vglobals.cpp +++ b/extensions/sdktools/vglobals.cpp @@ -127,14 +127,22 @@ void GetIServer() #if defined METAMOD_PLAPI_VERSION || PLAPI_VERSION >= 11 /* Get the CreateFakeClient function pointer */ +#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS + if (!(vfunc=SH_GET_ORIG_VFNPTR_ENTRY(engine, &IVEngineServer::CreateFakeClientEx))) +#else if (!(vfunc=SH_GET_ORIG_VFNPTR_ENTRY(engine, &IVEngineServer::CreateFakeClient))) +#endif { return; } #else /* Get the interface manually */ SourceHook::MemFuncInfo info = {true, -1, 0, 0}; +#if SOURCE_ENGINE == SE_ORANGEBOXVALVE || SOURCE_ENGINE == SE_CSS + SourceHook::GetFuncInfo(&IVEngineServer::CreateFakeClientEx, info); +#else SourceHook::GetFuncInfo(&IVEngineServer::CreateFakeClient, info); +#endif vfunc = enginePatch->GetOrigFunc(info.vtbloffs, info.vtblindex); if (!vfunc) diff --git a/gamedata/sdktools.games/engine.css.txt b/gamedata/sdktools.games/engine.css.txt index 0573bd66..20d5c611 100644 --- a/gamedata/sdktools.games/engine.css.txt +++ b/gamedata/sdktools.games/engine.css.txt @@ -114,7 +114,7 @@ { "Keys" { - /* Signature for the beginning of IVEngineServer::CreateFakeClient. + /* Signature for the beginning of IVEngineServer::CreateFakeClientEx. * * The engine binary is not actually scanned in order to look for * this. SourceHook is used to used to determine the address of the @@ -122,7 +122,7 @@ * the expected code. A pointer to sv (IServer interface) is used * here. */ - "CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x45\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0" + "CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x2A\x2A\x8A\x2A\x2A\x51\xB9\x2A\x2A\x2A\x2A\xA2" } "Offsets" @@ -130,7 +130,7 @@ /* Offset into IVEngineServer::CreateFakeClient */ "sv" { - "windows" "8" + "windows" "11" } } diff --git a/gamedata/sdktools.games/engine.ep2valve.txt b/gamedata/sdktools.games/engine.ep2valve.txt index 46154b90..f7ba4227 100644 --- a/gamedata/sdktools.games/engine.ep2valve.txt +++ b/gamedata/sdktools.games/engine.ep2valve.txt @@ -138,7 +138,7 @@ { "Keys" { - /* Signature for the beginning of IVEngineServer::CreateFakeClient. + /* Signature for the beginning of IVEngineServer::CreateFakeClientEx. * * The engine binary is not actually scanned in order to look for * this. SourceHook is used to used to determine the address of the @@ -146,7 +146,7 @@ * the expected code. A pointer to sv (IServer interface) is used * here. */ - "CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x45\x2A\x50\xB9\x2A\x2A\x2A\x2A\xE8\x2A\x2A\x2A\x2A\x85\xC0" + "CreateFakeClient_Windows" "\x55\x8B\xEC\x8B\x2A\x2A\x8A\x2A\x2A\x51\xB9\x2A\x2A\x2A\x2A\xA2" } "Offsets" @@ -154,7 +154,7 @@ /* Offset into IVEngineServer::CreateFakeClient */ "sv" { - "windows" "8" + "windows" "11" } }