diff --git a/generate.bat b/generate.bat index 65a3b20..d2a8438 100644 --- a/generate.bat +++ b/generate.bat @@ -1,4 +1,4 @@ @echo off echo Updating submodules... call git submodule update --init --recursive -call tools\premake5 %* vs2019 +call tools\premake5 %* vs2019 --copy-to="G:\SteamLibrary\steamapps\common\Call of Duty 2" diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index 7facd08..7787d89 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -12,10 +12,29 @@ namespace Components return sprintf(buffer, ConnectString, botName, protocol); } + void Bots::SV_BotUserMove_Func(Game::client_t*) + { + + } + + __declspec(naked) void Bots::SV_BotUserMove_Stub() + { + __asm + { + push esi; + call SV_BotUserMove_Func; + add esp, 4; + retn; + } + } + Bots::Bots() { // intercept the sprintf when creating the bot connect string Utils::Hook(0x45655B, BuildConnectString, HOOK_CALL).install()->quick(); + + // hook bot movement + Utils::Hook(0x45C210, SV_BotUserMove_Stub, HOOK_JUMP).install()->quick(); } Bots::~Bots() diff --git a/src/Components/Modules/Bots.hpp b/src/Components/Modules/Bots.hpp index ccc7da2..6b80a1f 100644 --- a/src/Components/Modules/Bots.hpp +++ b/src/Components/Modules/Bots.hpp @@ -11,5 +11,7 @@ namespace Components static const char* ConnectString; static int BuildConnectString(char*, const char*, int, int); + static void SV_BotUserMove_Func(Game::client_t*); + static void SV_BotUserMove_Stub(); }; }