From aa404ba108ec72e70dae45ec3f7af67cf1cf9e8a Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:20:07 +0100 Subject: [PATCH 01/11] Update others.cpp --- src/hooks/others.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index a1c371ab..c541ff22 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -692,13 +692,18 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) message.push_back(c); } } + static const char *lastfilter; + static bool retrun = false; + if (retrun) + PrintChat("%s: %s", name.c_str(), lastfilter); + retrun = false; if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX) { if (!strcmp(chat_filter.GetString(), "")) { - std::string tmp = {}; + std::string tmp = {}; std::string tmp2 = {}; - int iii = 0; + int iii = 0; player_info_s info; g_IEngine->GetPlayerInfo(LOCAL_E->m_IDX, &info); std::string name1 = info.name; @@ -798,6 +803,8 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) boost::replace_all(message2, "7", "t"); for (auto filter : res) { + if (retrun) + break; if (boost::contains(message2, filter)) { @@ -807,6 +814,10 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) clear += "\n"; } chat_stack::Say(". " + clear, true); + PrintChat("%s: %s", 0xe05938, name.c_str(), + filter.c_str()); + retrun = true; + lastfilter = filter.c_str(); } } } @@ -825,6 +836,8 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) boost::replace_all(message2, "7", "t"); for (auto filter : result) { + if (retrun) + break; if (boost::contains(message2, filter)) { if (clear == "") @@ -834,6 +847,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) clear += "\n"; } chat_stack::Say(". " + clear, true); + retrun = true; } } } @@ -844,7 +858,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) { if (ucccccp::validate(message)) { - PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(), + PrintChat("\x07%06X%s\x01: %s", name.c_str(), ucccccp::decrypt(message).c_str()); } } From c0ffcaed31edcd5bad1ce35e15b7bade6e557166 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:24:47 +0100 Subject: [PATCH 02/11] Update others.cpp --- src/hooks/others.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index c541ff22..fa522a09 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -693,9 +693,11 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) } } static const char *lastfilter; + static const char *lastname; static bool retrun = false; if (retrun) - PrintChat("%s: %s", name.c_str(), lastfilter); + PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938, 0xefec1f, lastname, + lastfilter); retrun = false; if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX) { @@ -814,10 +816,9 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) clear += "\n"; } chat_stack::Say(". " + clear, true); - PrintChat("%s: %s", 0xe05938, name.c_str(), - filter.c_str()); retrun = true; lastfilter = filter.c_str(); + lastname = name.c_str(); } } } @@ -848,6 +849,8 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) } chat_stack::Say(". " + clear, true); retrun = true; + lastfilter = filter.c_str(); + lastname = name.c_str(); } } } @@ -858,7 +861,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) { if (ucccccp::validate(message)) { - PrintChat("\x07%06X%s\x01: %s", name.c_str(), + PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(), ucccccp::decrypt(message).c_str()); } } From fd6c2e967443460cd14dd089ffaf3644392e5222 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:25:40 +0100 Subject: [PATCH 03/11] Update others.cpp --- src/hooks/others.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index fa522a09..ff60d702 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -696,8 +696,8 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) static const char *lastname; static bool retrun = false; if (retrun) - PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938, 0xefec1f, lastname, - lastfilter); + PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938, lastname, + 0xefec1f, lastfilter); retrun = false; if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX) { From f064d5f84386180acebc05fe79de6b777b76dc71 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:26:54 +0100 Subject: [PATCH 04/11] Update others.cpp --- src/hooks/others.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index ff60d702..b360f30d 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -697,7 +697,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) static bool retrun = false; if (retrun) PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938, lastname, - 0xefec1f, lastfilter); + 0xefec1f, lastfilter); retrun = false; if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX) { @@ -848,7 +848,7 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) clear += "\n"; } chat_stack::Say(". " + clear, true); - retrun = true; + retrun = true; lastfilter = filter.c_str(); lastname = name.c_str(); } From 7ad0cdb811253797b88b8e0990b9adf56de5295a Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:27:52 +0100 Subject: [PATCH 05/11] Events.cpp --- src/hacks/Events.cpp | 78 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 src/hacks/Events.cpp diff --git a/src/hacks/Events.cpp b/src/hacks/Events.cpp new file mode 100644 index 00000000..c875e112 --- /dev/null +++ b/src/hacks/Events.cpp @@ -0,0 +1,78 @@ +/* + * Events.cpp + * + * Created on: Feb 24, 2018 + * Author: bencat07 + */ +#include "common.hpp" + +namespace hacks +{ +namespace shared +{ +namespace event +{ +std::array data; +void CreateMove() +{ + if (!event_log) + return; + for (int i; i < g_IEngine->GetMaxClients(); ++i) + { + CachedEntity *ent = ENTITY(i); + if (!CE_GOOD(ent)) + continue; + player_info_s info; + g_IEngine->GetPlayerInfo(ent->m_IDX, &info); + if (!data[i]) + data[i] = CE_INT(ent, netvar.iClass); + + if (data[i] != CE_INT(ent, netvar.iClass)) + { + PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to " + "\"\x07%06X%s\x01\"", + 0xa06ba0, info.name, 0x6b9ca0, inttochar(data[i]), + 0x6ba072, inttochar(CE_INT(ent, netvar.iClass))); + data[i] = CE_INT(ent, netvar.iClass); + } + } +} +char *inttochar(int i) +{ + switch (i) + { + case tf_scout: + return "Scout"; + break; + case tf_sniper: + return "Sniper"; + break; + case tf_soldier: + return "Soldier"; + break; + case tf_demoman: + return "Demoman"; + break; + case tf_medic: + return "Medic"; + break; + case tf_heavy: + return "Heavy"; + break; + case tf_pyro: + return "Pyro"; + break; + case tf_spy: + return "Spy"; + break; + case tf_engineer: + return "Engineer"; + break; + default: + return "Invalid"; + break; + } +} +} +} +} From 143566bef747cb6e6153d1efaef89a4da7ba45eb Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:28:42 +0100 Subject: [PATCH 06/11] Events.hpp --- include/hacks/Events.hpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 include/hacks/Events.hpp diff --git a/include/hacks/Events.hpp b/include/hacks/Events.hpp new file mode 100644 index 00000000..dd585e70 --- /dev/null +++ b/include/hacks/Events.hpp @@ -0,0 +1,22 @@ +/* + * Events.hpp + * + * Created on: Feb 24, 2018 + * Author: bencat07 + */ +#pragma once + +#include "common.hpp" + +namespace hacks +{ +namespace shared +{ +namespace event +{ + +void CreateMove(); +char *inttochar(int i); +} +} +} From 017cd03d18977d9c396c2086d3c1bbd6d7eff7fe Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:29:59 +0100 Subject: [PATCH 07/11] Events --- include/hacks/hacklist.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hacks/hacklist.hpp b/include/hacks/hacklist.hpp index 46c2b48f..09f02f15 100644 --- a/include/hacks/hacklist.hpp +++ b/include/hacks/hacklist.hpp @@ -24,6 +24,7 @@ #include "AutoReflect.hpp" #include "AutoSticky.hpp" #include "AntiCheat.hpp" +#include "Events.hpp" #include "Bunnyhop.hpp" #include "LagExploit.hpp" #include "Walkbot.hpp" From e477d7f789cb3d4280a0a0b0db0aacb7db31aef1 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:30:50 +0100 Subject: [PATCH 08/11] Update CreateMove.cpp --- src/hooks/CreateMove.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 4f3b069b..7c07c204 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -424,10 +424,14 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd) hacks::shared::spam::CreateMove(); } { - PROF_SECTION(CM_AC); + PROF_SECTION(CM_AC); angles::Update(); hacks::shared::anticheat::CreateMove(); } + { + PROF_SECTION(CM_EVENTS); + hacks::shared::event::CreateMove(); + } } if (time_replaced) g_GlobalVars->curtime = curtime_old; From f663511add54ace922d6ba5549c23eece14bbb22 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:52:52 +0100 Subject: [PATCH 09/11] Update Events.cpp --- src/hacks/Events.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hacks/Events.cpp b/src/hacks/Events.cpp index c875e112..14c539b6 100644 --- a/src/hacks/Events.cpp +++ b/src/hacks/Events.cpp @@ -29,11 +29,20 @@ void CreateMove() if (data[i] != CE_INT(ent, netvar.iClass)) { + if (colors::EntityF(ent) == colors::red) { PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to " "\"\x07%06X%s\x01\"", - 0xa06ba0, info.name, 0x6b9ca0, inttochar(data[i]), + 0xb8383b, info.name, 0x6b9ca0, inttochar(data[i]), 0x6ba072, inttochar(CE_INT(ent, netvar.iClass))); + } + else if (colors::EntityF(ent) == colors::blu) { + PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to " + "\"\x07%06X%s\x01\"", + 0x5885a2, info.name, 0x6b9ca0, inttochar(data[i]), + 0x6ba072, inttochar(CE_INT(ent, netvar.iClass))); + } data[i] = CE_INT(ent, netvar.iClass); + } } } From 7352f83c2884440b640a89589f04772aeea44c8a Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 13:53:16 +0100 Subject: [PATCH 10/11] Update others.cpp --- src/hooks/others.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index b360f30d..450fe478 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -692,12 +692,14 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) message.push_back(c); } } - static const char *lastfilter; - static const char *lastname; - static bool retrun = false; - if (retrun) - PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938, lastname, - 0xefec1f, lastfilter); + static const char *lastfilter; + static const char *lastname; + static bool retrun = false; + if (data[0] != LOCAL_E->m_IDX) { + if (retrun) + PrintChat("\x07%06X%s\x01: \x07%06X%s\x01", 0xe05938, lastname, + 0xefec1f, lastfilter); + } retrun = false; if (chat_filter_enabled && data[0] != LOCAL_E->m_IDX) { From bfcae0d6cf76f60d969d7a547a9e6279232204fa Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sun, 25 Feb 2018 14:03:09 +0100 Subject: [PATCH 11/11] Update Events.cpp --- src/hacks/Events.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hacks/Events.cpp b/src/hacks/Events.cpp index 14c539b6..374103ce 100644 --- a/src/hacks/Events.cpp +++ b/src/hacks/Events.cpp @@ -29,18 +29,19 @@ void CreateMove() if (data[i] != CE_INT(ent, netvar.iClass)) { - if (colors::EntityF(ent) == colors::red) { + int skin = RAW_ENT(ent)->GetSkin(); + if (skin == 1) { PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to " "\"\x07%06X%s\x01\"", 0xb8383b, info.name, 0x6b9ca0, inttochar(data[i]), 0x6ba072, inttochar(CE_INT(ent, netvar.iClass))); } - else if (colors::EntityF(ent) == colors::blu) { + else if (skin == 2) { PrintChat("\x07%06X%s\x01 changed from \"\x07%06X%s\x01\" to " "\"\x07%06X%s\x01\"", 0x5885a2, info.name, 0x6b9ca0, inttochar(data[i]), 0x6ba072, inttochar(CE_INT(ent, netvar.iClass))); - } + } data[i] = CE_INT(ent, netvar.iClass); }