From deca58db5807ed1fbd4bd5663b1900277ba1b046 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 15 Dec 2016 19:18:08 +0100 Subject: [PATCH 1/4] [Dvar] Don't use Steam name for now, it's not ready yet --- src/Components/Modules/Dvar.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Components/Modules/Dvar.cpp b/src/Components/Modules/Dvar.cpp index 9df6864f..83f04fd2 100644 --- a/src/Components/Modules/Dvar.cpp +++ b/src/Components/Modules/Dvar.cpp @@ -162,19 +162,7 @@ namespace Components } }); - std::string username = "Unknown Soldier"; - - if (Steam::Proxy::SteamFriends) - { - const char* steamName = Steam::Proxy::SteamFriends->GetPersonaName(); - - if (steamName && !std::string(steamName).empty()) - { - username = steamName; - } - } - - return Dvar::Register(name, username.data(), Dvar::Flag(flag | Game::dvar_flag::DVAR_FLAG_SAVED).val, description).get(); + return Dvar::Register(name, "Unknown Soldier", Dvar::Flag(flag | Game::dvar_flag::DVAR_FLAG_SAVED).val, description).get(); } Dvar::Dvar() From f77d773aa5fc3b12abe93a45c90d2f36eb998a72 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 15 Dec 2016 19:18:43 +0100 Subject: [PATCH 2/4] [Submodules] Update mongoose --- deps/mongoose | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/mongoose b/deps/mongoose index 8c2e641e..02499d67 160000 --- a/deps/mongoose +++ b/deps/mongoose @@ -1 +1 @@ -Subproject commit 8c2e641ed748756b07f67cb0749760ab642fe703 +Subproject commit 02499d672b0eef48c784bd6533f1a24aa1c715b2 From 6aa94712e20919a18aec61cf114b502decfce89f Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 15 Dec 2016 20:05:50 +0100 Subject: [PATCH 3/4] [Bots] Fix spawning a second bot --- src/Components/Modules/Bots.cpp | 26 +++++++------------------- src/Components/Modules/Bots.hpp | 3 +-- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/Components/Modules/Bots.cpp b/src/Components/Modules/Bots.cpp index a9eb6ac0..310a0ed8 100644 --- a/src/Components/Modules/Bots.cpp +++ b/src/Components/Modules/Bots.cpp @@ -4,9 +4,10 @@ namespace Components { std::vector Bots::BotNames; - void Bots::InsertBotName(const char* arg) + void Bots::BuildConnectString(char* buffer, const char* connectString, int num, int, int protocol, int checksum, int statVer, int statStuff, int port) { - const char** args = &arg; + static int botId = 0; + if (Bots::BotNames.empty()) { FileSystem::File bots("bots.txt"); @@ -27,27 +28,14 @@ namespace Components } } - if(Bots::BotNames.empty()) + if (Bots::BotNames.empty()) { Bots::BotNames.push_back("bot"); } } - int botId = reinterpret_cast(args[12]); - args[12] = Utils::String::VA("%s", Bots::BotNames[botId % Bots::BotNames.size()].data()); - } - - __declspec(naked) void Bots::BuildConnectStringStub() - { - __asm - { - pushad - call Bots::InsertBotName - popad - - push 6B5D80h // sprintf - retn - } + botId %= Bots::BotNames.size(); + strncpy_s(buffer, 0x400, Utils::String::VA(connectString, num, Bots::BotNames[botId++].data(), protocol, checksum, statVer, statStuff, port), 0x400); } Bots::Bots() @@ -56,7 +44,7 @@ namespace Components Utils::Hook::Set(0x48ADA6, "connect bot%d \"\\cg_predictItems\\1\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\rate\\5000\\name\\%s\\protocol\\%d\\checksum\\%d\\statver\\%d %u\\qport\\%d\""); // Intercept sprintf for the connect string - Utils::Hook(0x48ADAB, Bots::BuildConnectStringStub, HOOK_CALL).install()->quick(); + Utils::Hook(0x48ADAB, Bots::BuildConnectString, HOOK_CALL).install()->quick(); } Bots::~Bots() diff --git a/src/Components/Modules/Bots.hpp b/src/Components/Modules/Bots.hpp index 9d9d20e4..a17cc4e1 100644 --- a/src/Components/Modules/Bots.hpp +++ b/src/Components/Modules/Bots.hpp @@ -13,7 +13,6 @@ namespace Components private: static std::vector BotNames; - static void InsertBotName(const char* arg); - static void BuildConnectStringStub(); + static void BuildConnectString(char* buffer, const char* connectString, int num, int, int protocol, int checksum, int statVer, int statStuff, int port); }; } From 9ad607425e6b3fed87932e38235c1ea00636465a Mon Sep 17 00:00:00 2001 From: momo5502 Date: Thu, 15 Dec 2016 20:06:02 +0100 Subject: [PATCH 4/4] [Submodules] Update protobuf --- deps/protobuf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/protobuf b/deps/protobuf index 2ff42dcf..83d681ee 160000 --- a/deps/protobuf +++ b/deps/protobuf @@ -1 +1 @@ -Subproject commit 2ff42dcf2c99105e7b550bfaccb0a42b9721138c +Subproject commit 83d681ee2caef1feb009656417830f846382d8ba