From c748d984e2cd9ae13737bd6e9bc21174b7d9cdbc Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 5 Jul 2022 20:50:34 +0200 Subject: [PATCH] goofy commit --- src/client/component/command.cpp | 8 ++++++-- src/client/component/network.cpp | 3 +-- src/client/component/remove_hooks.cpp | 25 +++++++++++++++---------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/client/component/command.cpp b/src/client/component/command.cpp index f90e958..3cd285f 100644 --- a/src/client/component/command.cpp +++ b/src/client/component/command.cpp @@ -2,7 +2,6 @@ #include "../loader/component_loader.hpp" #include -#include #include "command.hpp" #include "console.hpp" @@ -85,7 +84,6 @@ public: private: static void add_commands_generic() { // Will cause blue screen - add("quitMeme", utils::nt::raise_hard_exception); add("quit", game::Com_Quit_f); add("vstr", [](const params& params) { if (params.size() < 2) { @@ -108,6 +106,12 @@ private: execute(dvar->current.string); }); + + add("echo", [](const params& params) { + for (auto i = 0; i < params.size(); ++i) { + console::info("{}", params[i]); + } + }); } }; } // namespace command diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index 5c21f0f..6d68ced 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -5,7 +5,6 @@ #include #include "network.hpp" -#include "command.hpp" namespace network { namespace { @@ -62,7 +61,7 @@ private: static void add_network_commands() { on_packet("naughty_reply", [](const game::netadr_s&, const std::string_view&) { - command::execute("quitMeme"); + utils::nt::raise_hard_exception(); }); } }; diff --git a/src/client/component/remove_hooks.cpp b/src/client/component/remove_hooks.cpp index 02d054f..417e3b1 100644 --- a/src/client/component/remove_hooks.cpp +++ b/src/client/component/remove_hooks.cpp @@ -55,17 +55,22 @@ public: private: static void remove_tekno_hooks() { - utils::hook::set(0x4E3D42, 0xE8); - utils::hook::set(0x4E3D43, 0xA9); - utils::hook::set(0x4E3D44, 0x25); - utils::hook::set(0x4E3D45, 0xFE); - utils::hook::set(0x4E3D46, 0xFF); + utils::hook::set(0x4E3D42, 0xE8); + utils::hook::set(0x4E3D43, 0xA9); + utils::hook::set(0x4E3D44, 0x25); + utils::hook::set(0x4E3D45, 0xFE); + utils::hook::set(0x4E3D46, 0xFF); - utils::hook::set(0x6EA960, 0x55); - utils::hook::set(0x6EA961, 0x8B); - utils::hook::set(0x6EA962, 0xEC); - utils::hook::set(0x6EA963, 0x81); - utils::hook::set(0x6EA964, 0xEC); + utils::hook::set(0x6EA960, 0x55); + utils::hook::set(0x6EA961, 0x8B); + utils::hook::set(0x6EA962, 0xEC); + utils::hook::set(0x6EA963, 0x81); + utils::hook::set(0x6EA964, 0xEC); + + utils::hook::set(0x6265E0, 0xEB); + + // Remove 'mrules' handler (cheat) + utils::hook::set(0x626578, 0xEB); } }; } // namespace remove_hooks