From d94f6b9741939fdcc7b05c4dae8c748c14382e4d Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Thu, 20 Jul 2017 12:12:47 +0300 Subject: [PATCH 01/19] Transparent FOV circle --- src/hacks/Aimbot.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 702fe6fc..89f7ee98 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -100,6 +100,7 @@ static CatVar auto_spin_up(CV_SWITCH, "aimbot_spin_up", "0", "Auto Spin Up", "Sp static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automatically zoom in if you can see target, useful for followbots"); */ +static CatVar fovcircle_opacity(CV_FLOAT, "aimbot_fov_draw_opacity", "0.7", "FOV Circle Opacity", "Defines opacity of FOV circle", 0.0f, 1.0f); static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets"); // Current Entity @@ -937,6 +938,9 @@ void DrawText() { if (fov && float(fov) < 180) { // Dont show ring while player is dead if (LOCAL_E->m_bAlivePlayer) { + rgba_t color = GUIColor(); + color.a = float(fovcircle_opacity); + // Grab the screen resolution and save to some vars int width, height; g_IEngine->GetScreenSize(width, height); @@ -960,7 +964,7 @@ void DrawText() { px = width / 2 + radius * cos(ang); py = height / 2 + radius * sin(ang); } - drawgl::Line(px, py, x - px, y - py, GUIColor()); + drawgl::Line(px, py, x - px, y - py, color); px = x; py = y; } From 7315875a3a2052a7753cccf8bf838fbb89232865 Mon Sep 17 00:00:00 2001 From: The Codacy Badger Date: Fri, 21 Jul 2017 05:33:17 +0000 Subject: [PATCH 02/19] Add Codacy badge --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 5ebd583f..420bae5c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Cathook Multihack + +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=badger) + ![banner](https://raw.githubusercontent.com/nullifiedcat/cathook/master/banner.png) cathook is a multihack for Team Fortress 2 for Linux. cathook includes some joke features like From 6bccfa6a5816e08fcb0f4295e903d14a122e99f1 Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:34:21 -0500 Subject: [PATCH 03/19] Added Codacy Seal of Approval Should change this to cathook's when pushed. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5ebd583f..6b6c4d88 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=Badge_Grade) # Cathook Multihack ![banner](https://raw.githubusercontent.com/nullifiedcat/cathook/master/banner.png) From 4a4df68028b95163a22a76fbeb598c298dbc4239 Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:35:24 -0500 Subject: [PATCH 04/19] uh. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index df4fb0be..dbcfb188 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=Badge_Grade) # Cathook Multihack -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=badger) - ![banner](https://raw.githubusercontent.com/nullifiedcat/cathook/master/banner.png) cathook is a multihack for Team Fortress 2 for Linux. cathook includes some joke features like From bbbe32cc894a93a34c42bc31643df5a7bc8a39e3 Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:36:19 -0500 Subject: [PATCH 05/19] Added Codacy Badge to the bottom. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dbcfb188..bf8c3018 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,3 @@ -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=Badge_Grade) # Cathook Multihack ![banner](https://raw.githubusercontent.com/nullifiedcat/cathook/master/banner.png) @@ -76,3 +75,5 @@ The installation script is as followed: git clone --recursive https://github.com/nullifiedcat/cathook-ipc-server && cd cathook-ipc-server && make -j4 ``` To run the Followbot server, run `./bin/cathook-ipc-server`. You can also use `./bin/cathook-ipc-server &>/dev/null &` to run it in background. + +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=Badge_Grade) From ac7c98b60337d56d699bca5040ab137932af211b Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:42:59 -0500 Subject: [PATCH 06/19] Strings must use doublequote. --- generate-class-headers.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/generate-class-headers.js b/generate-class-headers.js index 55b3509b..49bc310f 100644 --- a/generate-class-headers.js +++ b/generate-class-headers.js @@ -1,14 +1,14 @@ -const fs = require('fs'); +const fs = require("fs"); var full_class_table = {}; try { - full_class_table = JSON.parse(fs.readFileSync('full-class-table.json').toString()); + full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} -const file = fs.readFileSync(process.argv[2]).toString().split('\n'); +const file = fs.readFileSync(process.argv[2]).toString().split("\n"); const modname = process.argv[3]; -console.log('Generating info for', modname, 'from', process.argv[2]); +console.log("Generating info for", modname, "from", process.argv[2]); var classes = {}; for (var i in file) { @@ -19,7 +19,7 @@ for (var i in file) { } } -fs.writeFileSync('full-class-table.json', JSON.stringify(full_class_table)); +fs.writeFileSync("full-class-table.json", JSON.stringify(full_class_table)); var header_constexpr = `/* AUTO-GENERATED HEADER - DO NOT MODIFY @@ -50,10 +50,10 @@ namespace client_classes { `; for (var clz in full_class_table) { - var value = '0'; + var value = "0"; if (classes[clz]) value = classes[clz]; header_constexpr += '\t\tstatic constexpr int ' + clz + ' = ' + value + ';\n'; - header += '\t\tint ' + clz + ' { ' + value + ' };\n'; + header += "\t\tint " + clz + " { " + value + " };\n"; } header += ` @@ -70,8 +70,8 @@ header_constexpr += ` #endif /* $mod_CONSTEXPR_AUTOGEN_HPP */`; -fs.writeFileSync('src/classinfo/' + modname + '.gen.hpp', header.replace(/\$mod/g, modname)); -fs.writeFileSync('src/classinfo/' + modname + '_constexpr.gen.hpp', header_constexpr.replace(/\$mod/g, modname)); +fs.writeFileSync("src/classinfo/" + modname + ".gen.hpp", header.replace(/\$mod/g, modname)); +fs.writeFileSync("src/classinfo/" + modname + "_constexpr.gen.hpp", header_constexpr.replace(/\$mod/g, modname)); -console.log(classes); \ No newline at end of file +console.log(classes); From 2486c8171f2780cf4004b993628a2ee1f694327e Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:44:04 -0500 Subject: [PATCH 07/19] Strings must use doublequote. --- generate-dummy-header.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generate-dummy-header.js b/generate-dummy-header.js index d3e7e323..4cb8facb 100644 --- a/generate-dummy-header.js +++ b/generate-dummy-header.js @@ -1,8 +1,8 @@ -const fs = require('fs'); +const fs = require("fs"); var full_class_table = {}; try { - full_class_table = JSON.parse(fs.readFileSync('full-class-table.json').toString()); + full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} console.log('Generating dummy class header'); @@ -22,7 +22,7 @@ namespace client_classes { `; for (var clz in full_class_table) { - header += '\t\tint ' + clz + ' { 0 };\n'; + header += "\t\tint " + clz + " { 0 };\n"; } header += ` @@ -33,4 +33,4 @@ header += ` #endif /* DUMMY_AUTOGEN_HPP */`; -fs.writeFileSync('src/classinfo/dummy.gen.hpp', header); \ No newline at end of file +fs.writeFileSync("src/classinfo/dummy.gen.hpp", header); From ea1eac0eb8b1c8a38295e619ab7d02a66ae959a8 Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:45:23 -0500 Subject: [PATCH 08/19] Strings must use doublequote. --- generate-dynamic-header.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/generate-dynamic-header.js b/generate-dynamic-header.js index 774f41bf..ba4e377d 100644 --- a/generate-dynamic-header.js +++ b/generate-dynamic-header.js @@ -1,11 +1,11 @@ -const fs = require('fs'); +const fs = require("fs"); var full_class_table = {}; try { - full_class_table = JSON.parse(fs.readFileSync('full-class-table.json').toString()); + full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} -console.log('Generating dummy class header'); +console.log("Generating dummy class header"); var header = `/* AUTO-GENERATED HEADER - DO NOT MODIFY @@ -24,7 +24,7 @@ namespace client_classes { `; for (var clz in full_class_table) { - header += '\t\tint ' + clz + ' { 0 };\n'; + header += "\t\tint " + clz + " { 0 };\n"; } header += ` @@ -35,7 +35,7 @@ header += ` #endif /* DYNAMIC_AUTOGEN_HPP */`; -var POPULATED_MAP = ''; +var POPULATED_MAP = ""; for (var clz in full_class_table) { POPULATED_MAP += `\t\tclassid_mapping["${clz}"] = &${clz};\n`; @@ -69,5 +69,5 @@ dynamic dynamic_list; }`; -fs.writeFileSync('src/classinfo/dynamic.gen.hpp', header); -fs.writeFileSync('src/classinfo/dynamic.gen.cpp', source); \ No newline at end of file +fs.writeFileSync("src/classinfo/dynamic.gen.hpp", header); +fs.writeFileSync("src/classinfo/dynamic.gen.cpp", source); From 912034465041537a091d068c07fe352f4ca57045 Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:46:20 -0500 Subject: [PATCH 09/19] Strings must use doublequote. --- generate-class-headers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-class-headers.js b/generate-class-headers.js index 49bc310f..71191ab0 100644 --- a/generate-class-headers.js +++ b/generate-class-headers.js @@ -52,7 +52,7 @@ namespace client_classes { for (var clz in full_class_table) { var value = "0"; if (classes[clz]) value = classes[clz]; - header_constexpr += '\t\tstatic constexpr int ' + clz + ' = ' + value + ';\n'; + header_constexpr += "\t\tstatic constexpr int " + clz + " = " + value + ";\n"; header += "\t\tint " + clz + " { " + value + " };\n"; } From 4a9bcb81888c221e48e1bf5461124ac8c5963b5e Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:46:51 -0500 Subject: [PATCH 10/19] Strings must use doublequote. --- generate-dummy-header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate-dummy-header.js b/generate-dummy-header.js index 4cb8facb..7fe18669 100644 --- a/generate-dummy-header.js +++ b/generate-dummy-header.js @@ -5,7 +5,7 @@ try { full_class_table = JSON.parse(fs.readFileSync("full-class-table.json").toString()); } catch (e) {} -console.log('Generating dummy class header'); +console.log("Generating dummy class header"); var header = `/* AUTO-GENERATED HEADER - DO NOT MODIFY From 66c2f1d9a69ab886fe9f7a6e0e198a4773662424 Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 00:50:16 -0500 Subject: [PATCH 11/19] Apparently I don't know what the fuck I'm doing why do we even need this --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index bf8c3018..343a4328 100644 --- a/README.md +++ b/README.md @@ -75,5 +75,3 @@ The installation script is as followed: git clone --recursive https://github.com/nullifiedcat/cathook-ipc-server && cd cathook-ipc-server && make -j4 ``` To run the Followbot server, run `./bin/cathook-ipc-server`. You can also use `./bin/cathook-ipc-server &>/dev/null &` to run it in background. - -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d208d05091854caaa51d2757d2097b2c)](https://www.codacy.com/app/SylveonBottle/cathook?utm_source=github.com&utm_medium=referral&utm_content=SylveonBottle/cathook&utm_campaign=Badge_Grade) From de80c172bdccc4d38538dbf78f16a56a6d3ce71e Mon Sep 17 00:00:00 2001 From: SylveonBottle Date: Fri, 21 Jul 2017 01:03:01 -0500 Subject: [PATCH 12/19] Where'd you come from..? --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 343a4328..5ebd583f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # Cathook Multihack - ![banner](https://raw.githubusercontent.com/nullifiedcat/cathook/master/banner.png) cathook is a multihack for Team Fortress 2 for Linux. cathook includes some joke features like From 5baf022f780ad81d848a545585c7f44d867799e4 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 12:13:14 +0300 Subject: [PATCH 13/19] Add trigger delay, close #206 --- src/hacks/SpyAlert.cpp | 2 +- src/hacks/Trigger.cpp | 34 +++++++++++++++++++++++++++++++--- tf-settings/menu.json | 3 ++- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp index 79eb6d63..86b1a7c1 100644 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -35,7 +35,7 @@ void Draw() { closest_spy_distance = 0.0f; spy_count = 0; if (last_say > g_GlobalVars->curtime) last_say = 0; - for (int i = 0; i < HIGHEST_ENTITY && i < 64; i++) { + for (int i = 0; i < HIGHEST_ENTITY && i < 32; i++) { ent = ENTITY(i); if (CE_BAD(ent)) continue; if (CE_BYTE(ent, netvar.iLifeState)) continue; diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index f115b30e..18b5795a 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -27,7 +27,7 @@ static CatVar trigger_key_mode(trigger_key_modes_enum, "trigger_key_mode", "1", static CatEnum hitbox_mode_enum({ "AUTO-HEAD", "AUTO-CLOSEST", "Head only" }); static CatVar hitbox_mode(hitbox_mode_enum, "trigger_hitboxmode", "0", "Hitbox Mode", "Defines hitbox selection mode"); -static CatVar accuracy(CV_INT, "trigger_accuracy", "0", "Improve accuracy", "Improves triggerbot accuracy when aiming for specific hitbox. Recommended to use with sniper rifle/ambassador"); +static CatVar accuracy(CV_INT, "trigger_accuracy", "1", "Improve accuracy", "Improves triggerbot accuracy when aiming for specific hitbox. Recommended to use with sniper rifle/ambassador"); static CatVar ignore_vaccinator(CV_SWITCH, "trigger_ignore_vaccinator", "1", "Ignore Vaccinator", "Hitscan weapons won't fire if enemy is vaccinated against bullets"); static CatVar ignore_hoovy(CV_SWITCH, "trigger_ignore_hoovy", "1", "Ignore Hoovies", "Triggerbot won't attack hoovies"); @@ -42,13 +42,20 @@ static CatVar zoomed_only(CV_SWITCH, "trigger_zoomed", "1", "Zoomed only", "Don' static CatVar max_range(CV_INT, "trigger_maxrange", "0", "Max distance", "Max range for triggerbot\n" "900-1100 range is efficient for scout/widowmaker engineer", 4096.0f); - + +static CatVar delay(CV_FLOAT, "trigger_delay", "0", "Delay", "Triggerbot delay in seconds", 0.0f, 1.0f); + +float target_time = 0.0f; + int last_hb_traced = 0; Vector forward; // The main "loop" of the triggerbot void CreateMove() { + float backup_time = target_time; + target_time = 0; + // Check if aimbot is enabled if (!enabled) return; @@ -65,7 +72,23 @@ void CreateMove() { if (CE_BAD(ent)) return; // Determine whether the triggerbot should shoot, then act accordingly - if (IsTargetStateGood(ent)) g_pUserCmd->buttons |= IN_ATTACK; + if (IsTargetStateGood(ent)) { + target_time = backup_time; + if (delay) { + if (target_time > g_GlobalVars->curtime) { + target_time = 0.0f; + } + if (!target_time) { + target_time = g_GlobalVars->curtime; + } else { + if (g_GlobalVars->curtime - float(delay) >= target_time) { + g_pUserCmd->buttons |= IN_ATTACK; + } + } + } else { + g_pUserCmd->buttons |= IN_ATTACK; + } + } return; } @@ -95,6 +118,11 @@ bool ShouldShoot() { if (HasCondition(g_pLocalPlayer->entity)) return false; // Check if player is cloaked if (IsPlayerInvisible(g_pLocalPlayer->entity)) return false; + + if (IsAmbassador(g_pLocalPlayer->weapon())) { + // Check if ambasador can headshot + if (!AmbassadorCanHeadshot()) return false; + } } IF_GAME (IsTF2()) { diff --git a/tf-settings/menu.json b/tf-settings/menu.json index 94ac78a4..23bf9928 100644 --- a/tf-settings/menu.json +++ b/tf-settings/menu.json @@ -135,11 +135,12 @@ "type": "list", "name": "Triggerbot Preferences", "list": [ + "trigger_delay", + "trigger_accuracy", "trigger_zoomed", "trigger_maxrange", "trigger_charge", "trigger_hitboxmode", - "trigger_accuracy", "trigger_key_mode", "trigger_key" ] From 368603552e702fe89ae51845af37f7f436b8e16c Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 16:19:17 +0300 Subject: [PATCH 14/19] Improved chams --- src/EffectChams.cpp | 67 +++++++++++++++++++++++++++++++------------ src/EffectChams.hpp | 1 + tf-settings/menu.json | 5 +++- 3 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/EffectChams.cpp b/src/EffectChams.cpp index 69e73183..c34e7ae8 100644 --- a/src/EffectChams.cpp +++ b/src/EffectChams.cpp @@ -22,7 +22,10 @@ static CatVar ammobox(CV_SWITCH, "chams_ammo", "0", "Ammoboxes", "Render chams o static CatVar buildings(CV_SWITCH, "chams_buildings", "0", "Buildings", "Render chams on buildings"); static CatVar stickies(CV_SWITCH, "chams_stickies", "0", "Stickies", "Render chams on stickybombs"); static CatVar teammate_buildings(CV_SWITCH, "chams_teammate_buildings", "0", "Teammate Buildings", "Render chams on teammates buildings"); -static CatVar weapons(CV_SWITCH, "chams_weapons", "1", "Weapons", "Render chams on players weapons"); +static CatVar recursive(CV_SWITCH, "chams_recursive", "1", "Recursive", "Render chams on weapons and cosmetics"); +static CatVar weapons_white(CV_SWITCH, "chams_weapons_white", "1", "White Weapons", "Should chams on weapons be white"); +static CatVar legit(CV_SWITCH, "chams_legit", "0", "Legit chams", "Don't show chams through walls"); +static CatVar singlepass(CV_SWITCH, "chams_singlepass", "0", "Single-pass", "Render chams only once (this disables 'darker' chams on invisible parts of player"); void EffectChams::Init() { logging::Info("Init EffectChams..."); @@ -102,12 +105,6 @@ bool EffectChams::ShouldRenderChams(IClientEntity* entity) { if (entity->entindex() < 0) return false; CachedEntity* ent = ENTITY(entity->entindex()); if (CE_BAD(ent)) return false; - if (weapons && vfunc(entity, 0xBE, 0)(entity)) { - IClientEntity* owner = vfunc(entity, 0x1C3, 0)(entity); - if (owner) { - return ShouldRenderChams(owner); - } - } switch (ent->m_Type) { case ENTITY_BUILDING: if (!buildings) return false; @@ -141,6 +138,35 @@ bool EffectChams::ShouldRenderChams(IClientEntity* entity) { return false; } +void EffectChams::RenderChamsRecursive(IClientEntity* entity) { + entity->DrawModel(1); + + if (!recursive) return; + + IClientEntity *attach; + int passes = 0; + + attach = g_IEntityList->GetClientEntity(*(int*)((uintptr_t)entity + netvar.m_Collision - 24) & 0xFFF); + while (attach && passes++ < 32) { + if (attach->ShouldDraw()) { + if (entity->GetClientClass()->m_ClassID == RCC_PLAYER && vfunc(attach, 190, 0)(attach)) { + if (weapons_white) { + rgba_t mod_original; + g_IVRenderView->GetColorModulation(mod_original.rgba); + g_IVRenderView->SetColorModulation(colors::white); + attach->DrawModel(1); + g_IVRenderView->SetColorModulation(mod_original.rgba); + } else { + attach->DrawModel(1); + } + } + else + attach->DrawModel(1); + } + attach = g_IEntityList->GetClientEntity(*(int*)((uintptr_t)attach + netvar.m_Collision - 20) & 0xFFF); + } +} + void EffectChams::RenderChams(int idx) { CMatRenderContextPtr ptr(GET_RENDER_CONTEXT); IClientEntity* entity = g_IEntityList->GetClientEntity(idx); @@ -148,17 +174,22 @@ void EffectChams::RenderChams(int idx) { if (ShouldRenderChams(entity)) { rgba_t color = ChamsColor(entity); rgba_t color_2 = color * 0.6f; - mat_unlit_z->AlphaModulate(1.0f); - ptr->DepthRange(0.0f, 0.01f); - g_IVRenderView->SetColorModulation(color); - g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit_z : mat_lit_z); - entity->DrawModel(1); - //((DrawModelExecute_t)(hooks::hkIVModelRender->GetMethod(hooks::offDrawModelExecute)))(_this, state, info, matrix); - mat_unlit->AlphaModulate(1.0f); - g_IVRenderView->SetColorModulation(color_2); - ptr->DepthRange(0.0f, 1.0f); - g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit : mat_lit); - entity->DrawModel(1); + if (!legit) { + mat_unlit_z->AlphaModulate(1.0f); + ptr->DepthRange(0.0f, 0.01f); + g_IVRenderView->SetColorModulation(color_2); + g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit_z : mat_lit_z); + + RenderChamsRecursive(entity); + } + + if (legit || !singlepass) { + mat_unlit->AlphaModulate(1.0f); + g_IVRenderView->SetColorModulation(color); + ptr->DepthRange(0.0f, 1.0f); + g_IVModelRender->ForcedMaterialOverride(flat ? mat_unlit : mat_lit); + RenderChamsRecursive(entity); + } } } } diff --git a/src/EffectChams.hpp b/src/EffectChams.hpp index b457c310..a55fa069 100644 --- a/src/EffectChams.hpp +++ b/src/EffectChams.hpp @@ -29,6 +29,7 @@ public: void RenderChams(int idx); void BeginRenderChams(); void EndRenderChams(); + void RenderChamsRecursive(IClientEntity* entity); public: bool init { false }; bool drawing { false }; diff --git a/tf-settings/menu.json b/tf-settings/menu.json index 23bf9928..1791aef7 100644 --- a/tf-settings/menu.json +++ b/tf-settings/menu.json @@ -245,13 +245,16 @@ "name": "Chams", "list": [ "chams_enable", + "chams_legit", + "chams_singlepass", "chams_health", "chams_players", "chams_teammates", "chams_buildings", "chams_teammate_buildings", "chams_flat", - "chams_weapons", + "chams_recursive", + "chams_weapons_white", "chams_medkits", "chams_ammo", "chams_stickies" From 0139a6e86f2785588a08602faddff2d3061f9e12 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 16:28:18 +0300 Subject: [PATCH 15/19] Draw menu ABOVE visuals. Don't draw anything with no_visuals 1 --- src/hooks/PaintTraverse.h | 1 + src/hooks/sdl.cpp | 17 ++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/hooks/PaintTraverse.h b/src/hooks/PaintTraverse.h index 2c463d4a..ad70f2b0 100644 --- a/src/hooks/PaintTraverse.h +++ b/src/hooks/PaintTraverse.h @@ -12,6 +12,7 @@ class CatVar; extern CatVar no_zoom; extern CatVar clean_screenshots; +extern CatVar disable_visuals; void PaintTraverse_hook(void*, unsigned int, bool, bool); #endif /* PAINTTRAVERSE_H_ */ diff --git a/src/hooks/sdl.cpp b/src/hooks/sdl.cpp index 7c0595ee..5e3e7504 100644 --- a/src/hooks/sdl.cpp +++ b/src/hooks/sdl.cpp @@ -38,7 +38,7 @@ void SDL_GL_SwapWindow_hook(SDL_Window* window) { static SDL_GLContext ctx_tf2 = SDL_GL_GetCurrentContext(); static SDL_GLContext ctx_imgui = nullptr; static SDL_GLContext ctx_text = nullptr; - { + if (!disable_visuals) { PROF_SECTION(DRAW_cheat); if (!ctx_imgui) { ctx_imgui = SDL_GL_CreateContext(window); @@ -55,15 +55,7 @@ void SDL_GL_SwapWindow_hook(SDL_Window* window) { return; } - SDL_GL_MakeCurrent(window, ctx_imgui); - { - PROF_SECTION(DRAW_imgui); - ImGui_ImplSdl_NewFrame(window); - menu::im::Render(); - ImGui::Render(); - } SDL_GL_MakeCurrent(window, ctx_text); - { std::lock_guard draw_lock(drawing_mutex); drawgl::PreRender(); @@ -79,6 +71,13 @@ void SDL_GL_SwapWindow_hook(SDL_Window* window) { drawgl::PostRender(); } + SDL_GL_MakeCurrent(window, ctx_imgui); + { + PROF_SECTION(DRAW_imgui); + ImGui_ImplSdl_NewFrame(window); + menu::im::Render(); + ImGui::Render(); + } } { PROF_SECTION(DRAW_valve); From f56822984852337d9003e9c2cbd6504afc05c99f Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 17:02:20 +0300 Subject: [PATCH 16/19] cat_nolerp 1 does something now --- src/globals.cpp | 10 ++++++++++ src/globals.h | 5 +++++ src/hooks/CreateMove.cpp | 16 ++++++++++------ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/globals.cpp b/src/globals.cpp index 4900541c..f4ad12e3 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -19,6 +19,11 @@ void ThirdpersonCallback(IConVar* var, const char* pOldValue, float flOldValue) } } +ConVar* sv_client_min_interp_ratio; +ConVar* cl_interp_ratio; +ConVar* cl_interp; +ConVar* cl_interpolate; + unsigned long tickcount = 0; char* force_name_newlined = new char[32] { 0 }; bool need_name_change = true; @@ -38,6 +43,11 @@ CatVar disconnect_reason(CV_STRING, "disconnect_reason", "", "Disconnect reason" CatVar event_log(CV_SWITCH, "events", "1", "Advanced Events"); void GlobalSettings::Init() { + sv_client_min_interp_ratio = g_ICvar->FindVar("sv_client_min_interp_ratio"); + cl_interp_ratio = g_ICvar->FindVar("cl_interp_ratio"); + cl_interp = g_ICvar->FindVar("cl_interp"); + cl_interpolate = g_ICvar->FindVar("cl_interpolate"); + bSendPackets = new bool; *bSendPackets = true; force_thirdperson.OnRegister([](CatVar* var) { diff --git a/src/globals.h b/src/globals.h index f56591e1..1615a516 100644 --- a/src/globals.h +++ b/src/globals.h @@ -15,6 +15,11 @@ class CatVar; extern int g_AppID; extern unsigned long tickcount; +extern ConVar* sv_client_min_interp_ratio; +extern ConVar* cl_interp_ratio; +extern ConVar* cl_interp; +extern ConVar* cl_interpolate; + extern CatVar event_log; extern CatVar cathook; // Master switch extern CatVar ignore_taunting; diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 94d94b1e..2d922652 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -163,15 +163,19 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { time_replaced = false; curtime_old = g_GlobalVars->curtime; - static ConVar* sv_client_min_interp_ratio = g_ICvar->FindVar("sv_client_min_interp_ratio"); - static ConVar* cl_interp = g_ICvar->FindVar("cl_interp"); - static ConVar* cl_interp_ratio = g_ICvar->FindVar("cl_interp_ratio"); - if (nolerp) { g_pUserCmd->tick_count += 1; - if (sv_client_min_interp_ratio->GetInt() != -1) sv_client_min_interp_ratio->SetValue(-1); - if (cl_interp->GetInt() != 0) cl_interp->SetValue(0); + if (sv_client_min_interp_ratio->GetInt() != -1) { + //sv_client_min_interp_ratio->m_nFlags = 0; + sv_client_min_interp_ratio->SetValue(-1); + } + if (cl_interp->m_fValue != 0) { + cl_interp->SetValue(0); + cl_interp->m_fValue = 0.0f; + cl_interp->m_nValue = 0; + } if (cl_interp_ratio->GetInt() != 0) cl_interp_ratio->SetValue(0); + if (cl_interpolate->GetInt() != 0) cl_interpolate->SetValue(0); } if (!g_Settings.bInvalid && CE_GOOD(g_pLocalPlayer->entity)) { From a935c9a1b47a488e0fce252f0249baafd151a32f Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 18:26:24 +0300 Subject: [PATCH 17/19] FOV circle for FOV < 1 --- src/hacks/Aimbot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index a62ae3dc..c664ddd8 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -970,7 +970,7 @@ void DrawText() { // Broken from kathook merge, TODO needs to be adapted for imgui if (fov_draw) { // It cant use fovs greater than 180, so we check for that - if (fov && float(fov) < 180) { + if (float(fov) > 0.0f && float(fov) < 180) { // Dont show ring while player is dead if (LOCAL_E->m_bAlivePlayer) { rgba_t color = GUIColor(); From 4c3662aad5addcd3d0459ac0d53c3fe6e9ed4491 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 19:18:22 +0300 Subject: [PATCH 18/19] aimbot miss chance --- src/hacks/Aimbot.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index c664ddd8..d4886f36 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -101,6 +101,8 @@ static CatVar auto_zoom(CV_SWITCH, "aimbot_auto_zoom", "0", "Auto Zoom", "Automa static CatVar fovcircle_opacity(CV_FLOAT, "aimbot_fov_draw_opacity", "0.7", "FOV Circle Opacity", "Defines opacity of FOV circle", 0.0f, 1.0f); static CatVar rageonly(CV_SWITCH, "aimbot_rage_only", "0", "Ignore non-rage targets", "Use playerlist to set up rage targets"); +static CatVar miss_chance(CV_FLOAT, "aimbot_miss_chance", "0", "Miss chance", "From 0 to 1. Aimbot will NOT aim in these % cases", 0.0f, 1.0f); + // Current Entity int target_eid { 0 }; CachedEntity* target = 0; @@ -222,6 +224,7 @@ bool ShouldAim() { if (g_pUserCmd->buttons & IN_USE) return false; // Check if using action slot item if (g_pLocalPlayer->using_action_slot_item) return false; + IF_GAME (IsTF2()) { // Check if Carrying A building if (CE_BYTE(g_pLocalPlayer->entity, netvar.m_bCarryingObject)) return false; @@ -509,6 +512,12 @@ bool IsTargetStateGood(CachedEntity* entity) { // A function to aim at a specific entitiy void Aim(CachedEntity* entity) { + if (float(miss_chance) > 0.0f) { + if ((rand() % 100) < float(miss_chance) * 100.0f) { + return; + } + } + // Dont aim at a bad entity if (CE_BAD(entity)) return; From 4c8adff107c994b7afba1c00ff0827a401942469 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 21 Jul 2017 20:20:54 +0300 Subject: [PATCH 19/19] Working Infinite Healthpacks, close #209 --- src/hacks/LagExploit.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 09d4409e..e5609064 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -148,26 +148,25 @@ void CreateMove() { } // Infinite healthpacks (I'll probably have to move this somewhere else) - if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth != LOCAL_E->m_iMaxHealth) { + if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth < LOCAL_E->m_iMaxHealth) { ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable(); - const Vector& max1 = p->OBBMaxs(); - const Vector& min1 = p->OBBMins(); + const Vector& max1 = p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); + const Vector& min1 = p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin(); for (int i = 1; i < entity_cache::max; i++) { CachedEntity* e = ENTITY(i); + if (CE_BAD(e)) continue; if (e->m_iClassID != CL_CLASS(CBaseAnimating)) continue; if (e->m_ItemType != ITEM_HEALTH_SMALL && e->m_ItemType != ITEM_HEALTH_MEDIUM && e->m_ItemType != ITEM_HEALTH_LARGE) continue; - if (e->m_flDistance < 54.0f) amount = 900; - // Not working for some reason? - /*ICollideable* c = RAW_ENT(e)->GetCollideable(); - const Vector& max2 = c->OBBMaxs(); - const Vector& min2 = c->OBBMins(); + ICollideable* c = RAW_ENT(e)->GetCollideable(); + const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin;// + Vector(10, 10, 10); + const Vector& min2 = c->OBBMins() + e->m_vecOrigin;// - Vector(10, 10, 10); if ( (min1.x <= max2.x && max1.x >= min2.x) && (min1.y <= max2.y && max1.y >= min2.y) && (min1.z <= max2.z && max1.z >= min2.z) ) { - logging::Info("Collision with %d", i); + //logging::Info("Collision with %d", i); amount = 900; break; - }*/ + } } }