From 3558bbb4e5ecd8d72a6dc8c3791f6d470431a718 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Tue, 2 May 2017 23:31:18 +0300 Subject: [PATCH 1/2] fix? hoovy crash + trying to improve fake name --- src/EffectGlow.cpp | 2 +- src/hooks/others.cpp | 12 +++++++++--- src/hoovy.cpp | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/EffectGlow.cpp b/src/EffectGlow.cpp index 2899cf05..d0850b25 100644 --- a/src/EffectGlow.cpp +++ b/src/EffectGlow.cpp @@ -34,7 +34,7 @@ static CatVar ammobox(CV_SWITCH, "glow_ammo", "0", "Ammoboxes", "Render glow on static CatVar buildings(CV_SWITCH, "glow_buildings", "0", "Buildings", "Render glow on buildings"); static CatVar stickies(CV_SWITCH, "glow_stickies", "0", "Stickies", "Render glow on stickybombs"); static CatVar teammate_buildings(CV_SWITCH, "glow_teammate_buildings", "0", "Teammate Buildings", "Render glow on teammates buildings"); - +//static CatVar weapons_white(CV_SWITCH, "glow_weapons_white", "1", "White Weapon Glow", "Weapons will glow white"); struct ShaderStencilState_t { diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 64ce6c4d..e15df73b 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -184,6 +184,10 @@ void FrameStageNotify_hook(void* thisptr, int stage) { } } if (stage == FRAME_NET_UPDATE_START) { + static int next_name_change = 0; + if (next_name_change == 0) { + need_name_change = true; + } else next_name_change--; if (force_name.convar->m_StringLength > 2 && need_name_change) { INetChannel* ch = (INetChannel*)g_IEngine->GetNetChannelInfo(); if (ch) { @@ -194,10 +198,12 @@ void FrameStageNotify_hook(void* thisptr, int stage) { ch->SendNetMsg(setname, false); need_name_change = false; } + next_name_change = 60 * 100; } static ConVar* name_cv = g_ICvar->FindVar("name"); - name_cv->SetValue(force_name.GetString()); + //name_cv->SetValue(force_name.GetString()); name_cv->m_pszString = (char*)strfmt("%s", force_name.GetString()); + name_cv->m_StringLength = strlen(force_name.GetString()) + 1; } if (TF && cathook && !g_Settings.bInvalid && stage == FRAME_RENDER_START) { if (glow_enabled) { @@ -334,8 +340,8 @@ void LevelInit_hook(void* thisptr, const char* newmap) { //name_cv->m_pszString = strfmt("%s", force_name.GetString()); } static ConVar* name_cv = g_ICvar->FindVar("name"); - name_cv->SetValue(force_name.GetString()); name_cv->m_pszString = (char*)strfmt("%s", force_name.GetString()); + name_cv->m_StringLength = strlen(force_name.GetString()) + 1; } } @@ -361,8 +367,8 @@ void LevelShutdown_hook(void* thisptr) { //name_cv->m_pszString = strfmt("%s", force_name.GetString()); } static ConVar* name_cv = g_ICvar->FindVar("name"); - name_cv->SetValue(force_name.GetString()); name_cv->m_pszString = (char*)strfmt("%s", force_name.GetString()); + name_cv->m_StringLength = strlen(force_name.GetString()) + 1; } } diff --git a/src/hoovy.cpp b/src/hoovy.cpp index 7987bcc3..4af55ce5 100644 --- a/src/hoovy.cpp +++ b/src/hoovy.cpp @@ -10,7 +10,9 @@ static bool hoovy_list[32] = { 0 }; bool HasSandvichOut(CachedEntity* entity) { - CachedEntity* weapon = ENTITY(CE_INT(entity, netvar.hActiveWeapon) & 0xFFF); + int weapon_idx = CE_INT(entity, netvar.hActiveWeapon) & 0xFFF; + if (!(weapon_idx > 0 && weapon_idx < HIGHEST_ENTITY)) return false; + CachedEntity* weapon = ENTITY(weapon_idx); if (CE_GOOD(weapon)) { if (weapon->m_iClassID == g_pClassID->CTFLunchBox && CE_INT(entity, netvar.iClass) == tf_heavy) { return true; From de06e11ffb70aa834ae7d55654b33aa07375775b Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Tue, 2 May 2017 23:37:37 +0300 Subject: [PATCH 2/2] add NCC, Lithium, LMAOBOX spam --- src/hacks/Spam.cpp | 45 ++++++++++++++++++++++++++++++++++++++------- src/hacks/Spam.h | 3 +++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/hacks/Spam.cpp b/src/hacks/Spam.cpp index 8e02d027..8ec644e6 100644 --- a/src/hacks/Spam.cpp +++ b/src/hacks/Spam.cpp @@ -11,7 +11,7 @@ #include namespace hacks { namespace shared { namespace spam { -static CatEnum spam_enum({"DISABLED", "DEFAULT", "LENNYFACES", "BLANKS", "FROM FILE"}); +static CatEnum spam_enum({"DISABLED", "CUSTOM", "DEFAULT", "LENNYFACES", "BLANKS", "NULLCORE", "LMAOBOX", "LITHIUM"}); CatVar spam_source(spam_enum, "spam", "0", "Chat Spam", "Defines source of spam lines. CUSTOM spam file must be set in cat_spam_file and loaded with cat_spam_reload (Use console!)"); CatVar random_order(CV_SWITCH, "spam_random", "0", "Random Order"); CatVar filename(CV_STRING, "spam_file", "spam.txt", "Spam file (~/.cathook/...)", "Spam file name. Each line should be no longer than 100 characters, file must be located in ~/.cathook folder"); @@ -27,13 +27,19 @@ void CreateMove() { const std::vector* source = nullptr; switch ((int)spam_source) { case 1: - source = &builtin_default; break; - case 2: - source = &builtin_lennyfaces; break; - case 3: - source = &builtin_blanks; break; - case 4: source = &file.lines; break; + case 2: + source = &builtin_default; break; + case 3: + source = &builtin_lennyfaces; break; + case 4: + source = &builtin_blanks; break; + case 5: + source = &builtin_nonecore; break; + case 6: + source = &builtin_lmaobox; break; + case 7: + source = &builtin_lithium; break; default: return; } @@ -72,4 +78,29 @@ const std::vector builtin_blanks = { ". \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n " }; +const std::vector builtin_nonecore = { + "NULL CORE - REDUCE YOUR RISK OF BEING OWNED!", + "NULL CORE - WAY TO THE TOP!", + "NULL CORE - BEST TF2 CHEAT!", + "NULL CORE - NOW WITH BLACKJACK AND HOOKERS!", + "NULL CORE - BUTTHURT IN 10 SECONDS FLAT!", + "NULL CORE - WHOLE SERVER OBSERVING!", + "NULL CORE - GET BACK TO PWNING!", + "NULL CORE - WHEN PVP IS TOO HARDCORE!", + "NULL CORE - CAN CAUSE KIDS TO RAGE!", + "NULL CORE - F2P NOOBS WILL BE 100% NERFED!" +}; +const std::vector builtin_lmaobox = { + "GET GOOD, GET LMAOBOX!", + "LMAOBOX - WAY TO THE TOP", + "WWW.LMAOBOX.NET - BEST FREE TF2 HACK!" +}; +const std::vector builtin_lithium = { + "CHECK OUT www.YouTube.com/c/DurRud FOR MORE INFORMATION!", + "PWNING AIMBOTS WITH OP ANTI-AIMS SINCE 2015 - LITHIUMCHEAT", + "STOP GETTING MAD AND STABILIZE YOUR MOOD WITH LITHIUMCHEAT!", + "SAVE YOUR MONEY AND GET LITHIUMCHEAT! IT IS FREE!", + "GOT ROLLED BY LITHIUM? HEY, THAT MEANS IT'S TIME TO GET LITHIUMCHEAT!!" +}; + }}} diff --git a/src/hacks/Spam.h b/src/hacks/Spam.h index 6db2b7da..9c9a4ed0 100644 --- a/src/hacks/Spam.h +++ b/src/hacks/Spam.h @@ -19,6 +19,9 @@ namespace hacks { namespace shared { namespace spam { extern const std::vector builtin_default; extern const std::vector builtin_lennyfaces; extern const std::vector builtin_blanks; +extern const std::vector builtin_nonecore; +extern const std::vector builtin_lmaobox; +extern const std::vector builtin_lithium; extern CatVar enabled; extern CatVar filename;