From eb34db18a4a1a0b19c5d558682425410d70dcfae Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Fri, 8 Jun 2018 17:04:13 +0200 Subject: [PATCH 01/19] Delete .gitlab-ci.yml --- .gitlab-ci.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 0d499a24..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,9 +0,0 @@ -image: registry.gitlab.com/nullworks/cathook-ci/ubuntu-cat-dependencies:build -variables: - DOCKER_DRIVER: overlay2 -build: - stage: build - before_script: - - "git submodule update --init --recursive" - script: - - "mkdir build; cd build; cmake ..; make; cd .." From 6964d1331d912c60b5ba84cde23583eb093d840b Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Fri, 8 Jun 2018 17:12:06 +0200 Subject: [PATCH 02/19] CircleCI CI --- .circleci/config.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..6ababfea --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +version: 2 +jobs: + build: + docker: + - image: registry.gitlab.com/nullworks/cathook-ci-docker/ubuntu-cat-dependencies:build + steps: + - checkout + - run: + name: compile-cathook + script: "git submodule update --init --recursive; mkdir build; cd build; cmake ..; make; cd .." From 0048c8458e98719d8d577f3eb1f927d6a67dc7f7 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Fri, 8 Jun 2018 17:23:34 +0200 Subject: [PATCH 03/19] Update config.yml --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ababfea..d8ae66c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,10 @@ version: 2 jobs: - build: - docker: - - image: registry.gitlab.com/nullworks/cathook-ci-docker/ubuntu-cat-dependencies:build - steps: - - checkout - - run: - name: compile-cathook - script: "git submodule update --init --recursive; mkdir build; cd build; cmake ..; make; cd .." + compile_cathook: + docker: + - image: registry.gitlab.com/nullworks/cathook-ci-docker/ubuntu-cat-dependencies:build + steps: + - checkout + - run: + name: "Compiling cathook" + command: git submodule update --init --recursive; mkdir build; cd build; cmake ..; make; cd .. From f617f1353e97925688bd5198ffadd958933c309d Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Fri, 8 Jun 2018 17:25:18 +0200 Subject: [PATCH 04/19] Update config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8ae66c6..f44289ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ version: 2 jobs: - compile_cathook: + build: docker: - image: registry.gitlab.com/nullworks/cathook-ci-docker/ubuntu-cat-dependencies:build steps: From d3a1317297c8eb5294aa8ae5f7757191f2400f13 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Fri, 8 Jun 2018 17:50:50 +0200 Subject: [PATCH 05/19] Fix install-all and update --- install-all | 20 ++------------------ update | 6 +----- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/install-all b/install-all index 12f79f6e..33e5f37b 100755 --- a/install-all +++ b/install-all @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + rm ../install-all # @@ -12,24 +14,6 @@ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sud git fetch;git pull origin;git submodule update --remote --recursive -# -# Install libglez -# - -cd libglez;mkdir build;cd build;cmake ..;make;sudo make install;cd ..;cd .. - -# -# Install libxoverlay -# - -cd libxoverlay;mkdir build;cd build;cmake ..;make;sudo make install;cd ..;cd .. - -# -# Install Simple-ipc -# - -cd simple-ipc;mkdir build;cd build;cmake ..;make;sudo make install;cd ..;cd .. - # # Build cathook # diff --git a/update b/update index b366214b..fc778c78 100755 --- a/update +++ b/update @@ -2,10 +2,6 @@ sudo echo Elevated #Get updated source code git fetch;git pull origin;git submodule update --remote --recursive -#Update dependencies -cd ./libglez/build; cmake ..; make;sudo make install;cd ..; cd .. -cd ./libxoverlay/build; cmake ..; make;sudo make install;cd ..; cd .. -cd ./simple-ipc/build; cmake ..; make;sudo make install;cd ..; cd .. #Update cathook cd build; cmake ..; make; cd ..; cd .. -printf "\n\n";printf '\e[1;34m%-6s\e' "Cathook update complete!";printf "\n\n" \ No newline at end of file +printf "\n\n";printf '\e[1;34m%-6s\e' "Cathook update complete!";printf "\n\n" From 64c584fea1c6d14891a7e601ecd6414ff0e67c52 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Fri, 8 Jun 2018 19:53:44 +0200 Subject: [PATCH 06/19] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8422af00..0ab85e47 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cathook Training Software ![banner](http://i.imgur.com/w96wdtE.png) -[![pipeline status](https://gitlab.com/nullworks/cathook-ci/badges/master/pipeline.svg)](https://gitlab.com/nullworks/cathook-ci/commits/master) +[![CircleCI](https://circleci.com/gh/nullworks/cathook.svg?style=svg)](https://circleci.com/gh/nullworks/cathook) [cathook announcements channel in telegram](https://t.me/cathook_cheat) From 8e7596d799283a88c237de11d77fd242d96e906c Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Fri, 8 Jun 2018 21:34:38 +0200 Subject: [PATCH 07/19] Update update --- update | 1 - 1 file changed, 1 deletion(-) diff --git a/update b/update index fc778c78..3ee7adde 100755 --- a/update +++ b/update @@ -1,5 +1,4 @@ #!/usr/bin/env bash -sudo echo Elevated #Get updated source code git fetch;git pull origin;git submodule update --remote --recursive #Update cathook From e239e70a1993c4f2717c47627eaaa9e8e4c978db Mon Sep 17 00:00:00 2001 From: LightCat Date: Fri, 8 Jun 2018 21:49:33 +0200 Subject: [PATCH 08/19] Update install-all --- install-all | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install-all b/install-all index 33e5f37b..ab5e0912 100755 --- a/install-all +++ b/install-all @@ -6,7 +6,9 @@ rm ../install-all # Install base Dependencies # -sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install build-essential git gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-6-multilib gcc-6 g++-6 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y +sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y +sudo apt update +sudo apt install build-essential git gcc-multilib g++-multilib software-properties-common gcc-snapshot g++-6-multilib gcc-6 g++-6 libssl-dev:i386 libboost-all-dev libc6-dev:i386 gdb libsdl2-dev libglew-dev:i386 libglew-dev libfreetype6-dev libfreetype6-dev:i386 cmake libpng-dev libssl-dev cmake gcc-multilib g++-multilib -y # # Update cathook From 8d33475af9694aa4ac1e24bc6161e1b2d86de8f9 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 9 Jun 2018 15:36:22 +0200 Subject: [PATCH 09/19] Comments and readability. --- install-all | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/install-all b/install-all index ab5e0912..bd8fe531 100755 --- a/install-all +++ b/install-all @@ -1,6 +1,6 @@ #!/usr/bin/env bash -rm ../install-all +rm ../install-all # remove install file # # Install base Dependencies @@ -14,10 +14,15 @@ sudo apt install build-essential git gcc-multilib g++-multilib software-properti # Update cathook # -git fetch;git pull origin;git submodule update --remote --recursive +git fetch # fetch github repo for udpates +git pull origin # pull changes from github +git submodule update --remote --recursive # update submodules # # Build cathook # -mkdir build;cd build;cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo); sudo make data; cd ..; cd .. +mkdir build;cd build #create a directory for building cathook +cmake ..;make -j$(grep -c '^processor' /proc/cpuinfo) # create makefile and build using all available threads +sudo make data # create /opt/cathook/data +cd ..; cd .. From f85da89ff3fa26c58d421ed63834694b13e24bea Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 9 Jun 2018 15:40:40 +0200 Subject: [PATCH 10/19] Use all cores provided by circleci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f44289ff..57019c63 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,4 +7,4 @@ jobs: - checkout - run: name: "Compiling cathook" - command: git submodule update --init --recursive; mkdir build; cd build; cmake ..; make; cd .. + command: git submodule update --init --recursive; mkdir build; cd build; cmake ..; make -j$(grep -c '^processor' /proc/cpuinfo); cd .. From ca20f7d8017b359a801c111805d537985fabb5cc Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 9 Jun 2018 15:53:02 +0200 Subject: [PATCH 11/19] Fix: Circleci fails to build if all cores are used --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 57019c63..f44289ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,4 +7,4 @@ jobs: - checkout - run: name: "Compiling cathook" - command: git submodule update --init --recursive; mkdir build; cd build; cmake ..; make -j$(grep -c '^processor' /proc/cpuinfo); cd .. + command: git submodule update --init --recursive; mkdir build; cd build; cmake ..; make; cd .. From b6c2034494d559192c6dc11fa1735620d2f46364 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <38938720+TotallyNotElite@users.noreply.github.com> Date: Sat, 9 Jun 2018 16:06:23 +0200 Subject: [PATCH 12/19] Use 8 threads instead of 32 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f44289ff..2b8eef88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,4 +7,4 @@ jobs: - checkout - run: name: "Compiling cathook" - command: git submodule update --init --recursive; mkdir build; cd build; cmake ..; make; cd .. + command: git submodule update --init --recursive; mkdir build; cd build; cmake -DEnableWarnings=0 ..; make -j8; cd .. From c374acbee9f1ba3c18e1e0fccd35c6a491a06787 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 10 Jun 2018 11:59:09 +0200 Subject: [PATCH 13/19] LightESP --- include/hacks/CMakeLists.txt | 1 + include/hacks/LightESP.hpp | 10 ++++++ include/hacks/hacklist.hpp | 1 + src/hacks/CMakeLists.txt | 1 + src/hacks/LightESP.cpp | 63 ++++++++++++++++++++++++++++++++++++ src/hooks/CreateMove.cpp | 5 ++- src/visual/drawmgr.cpp | 5 +++ 7 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 include/hacks/LightESP.hpp create mode 100644 src/hacks/LightESP.cpp diff --git a/include/hacks/CMakeLists.txt b/include/hacks/CMakeLists.txt index 8de6a98b..0b807d88 100644 --- a/include/hacks/CMakeLists.txt +++ b/include/hacks/CMakeLists.txt @@ -28,6 +28,7 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/KillSay.hpp" "${CMAKE_CURRENT_LIST_DIR}/Killstreak.hpp" "${CMAKE_CURRENT_LIST_DIR}/LagExploit.hpp" + "${CMAKE_CURRENT_LIST_DIR}/LightESP.hpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.hpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.hpp" "${CMAKE_CURRENT_LIST_DIR}/Spam.hpp" diff --git a/include/hacks/LightESP.hpp b/include/hacks/LightESP.hpp new file mode 100644 index 00000000..4a5b6966 --- /dev/null +++ b/include/hacks/LightESP.hpp @@ -0,0 +1,10 @@ + +namespace hacks +{ +namespace shared +{ +namespace lightesp +{ +void run(); +void draw(); +}}} diff --git a/include/hacks/hacklist.hpp b/include/hacks/hacklist.hpp index 6cce8828..6be90786 100755 --- a/include/hacks/hacklist.hpp +++ b/include/hacks/hacklist.hpp @@ -12,6 +12,7 @@ #if ENABLE_VISUALS #include "ESP.hpp" +#include "LightESP.hpp" #include "SkinChanger.hpp" #include "Radar.hpp" #include "SpyAlert.hpp" diff --git a/src/hacks/CMakeLists.txt b/src/hacks/CMakeLists.txt index b3a8732d..f55f0e2f 100644 --- a/src/hacks/CMakeLists.txt +++ b/src/hacks/CMakeLists.txt @@ -26,6 +26,7 @@ if(NOT LagbotMode) "${CMAKE_CURRENT_LIST_DIR}/KillSay.cpp" "${CMAKE_CURRENT_LIST_DIR}/Killstreak.cpp" "${CMAKE_CURRENT_LIST_DIR}/LagExploit.cpp" + "${CMAKE_CURRENT_LIST_DIR}/LightESP.cpp" "${CMAKE_CURRENT_LIST_DIR}/Misc.cpp" "${CMAKE_CURRENT_LIST_DIR}/Noisemaker.cpp" "${CMAKE_CURRENT_LIST_DIR}/Trigger.cpp" diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp new file mode 100644 index 00000000..a174f535 --- /dev/null +++ b/src/hacks/LightESP.cpp @@ -0,0 +1,63 @@ +#include "common.hpp" + +namespace hacks +{ +namespace shared +{ +namespace lightesp +{ + + +CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack", + "For legit play only as of right now."); +Vector hitp[256]; +Vector minp[256]; +Vector maxp[256]; + +void run() { + for (int i = 1; i < g_IEngine->GetMaxClients(); i++) + { + CachedEntity *pEntity = ENTITY(i); + if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) + hitp[i] = {0, 0, 0}; + continue; + if (pEntity->m_iTeam() == LOCAL_E->m_iTeam()) + continue; + if (pEntity->m_Type() != ENTITY_PLAYER) + continue; + if (!pEntity->hitboxes.GetHitbox(0)) + continue; + Vector hitboxpos = pEntity->hitboxes.GetHitbox(0)->center; + Vector min = pEntity->hitboxes.GetHitbox(0)->min; + Vector max = pEntity->hitboxes.GetHitbox(0)->max; + hitp[i] = hitboxpos; + minp[i] = min; + maxp[i] = max; + } +} +void draw() { + #if ENABLE_VISUALS + for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { + auto hitboxpos = hitp[i]; + auto min = minp[i]; + auto max = maxp[i]; + + if (!hitboxpos.x && !hitboxpos.y && !hitboxpos.z) + continue; + Vector out; + if (draw::WorldToScreen(hitboxpos, out)) + { + float size = 0.0f; + if (abs(max.x - min.x) > abs(max.y - min.y)) + size = abs(max.x - min.x); + else + size = abs(max.y - min.y); + + draw_api::draw_rect(out.x, out.y, size / 4, size / 4, + colors::green); + } + } +#endif +} + +}}} diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 72ba67b2..592a477c 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -8,7 +8,6 @@ #include "common.hpp" #include "hack.hpp" #include "MiscTemporary.hpp" - #include #include @@ -337,6 +336,10 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, PROF_SECTION(CM_backtracc); hacks::shared::backtrack::Run(); } + { + PROF_SECTION(CM_lightesp); + hacks::shared::lightesp::run(); + } { PROF_SECTION(CM_aimbot); hacks::shared::aimbot::CreateMove(); diff --git a/src/visual/drawmgr.cpp b/src/visual/drawmgr.cpp index 635a3059..15aaee97 100644 --- a/src/visual/drawmgr.cpp +++ b/src/visual/drawmgr.cpp @@ -144,6 +144,11 @@ void DrawCheatVisuals() hacks::shared::backtrack::Draw(); } IF_GAME(IsTF2()) + { + PROF_SECTION(DRAW_lightesp); + hacks::shared::lightesp::draw(); + } + IF_GAME(IsTF2()) { PROF_SECTION(DRAW_healarrows); hacks::tf2::healarrow::Draw(); From 473511880968911298b893e6d68e264f95dcbe06 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 10 Jun 2018 14:21:27 +0200 Subject: [PATCH 14/19] Fix lightesp performance and add option to disable lightesp --- src/hacks/LightESP.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index a174f535..580cc6b0 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -8,19 +8,20 @@ namespace lightesp { -CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack", - "For legit play only as of right now."); -Vector hitp[256]; -Vector minp[256]; -Vector maxp[256]; +CatVar enable(CV_SWITCH, "lightesp", "0", "Enable LightESP", + "Lightweight ESP. Only shows head."); +Vector hitp[32]; +Vector minp[32]; +Vector maxp[32]; void run() { for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { CachedEntity *pEntity = ENTITY(i); - if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) + if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) { hitp[i] = {0, 0, 0}; continue; + } if (pEntity->m_iTeam() == LOCAL_E->m_iTeam()) continue; if (pEntity->m_Type() != ENTITY_PLAYER) @@ -37,6 +38,8 @@ void run() { } void draw() { #if ENABLE_VISUALS + if (!enable) + return; for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { auto hitboxpos = hitp[i]; auto min = minp[i]; From cd5effdfd6af0f8dee306ee8d86a83db4218f6b5 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Sun, 10 Jun 2018 20:59:57 +0200 Subject: [PATCH 15/19] Rage, Friendly etc colors --- include/hacks/LightESP.hpp | 4 +++- src/hacks/LightESP.cpp | 29 ++++++++++++++++++----------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/include/hacks/LightESP.hpp b/include/hacks/LightESP.hpp index 4a5b6966..20d6eb79 100644 --- a/include/hacks/LightESP.hpp +++ b/include/hacks/LightESP.hpp @@ -1,4 +1,5 @@ - +#include "common.hpp" +#include namespace hacks { namespace shared @@ -7,4 +8,5 @@ namespace lightesp { void run(); void draw(); +rgba_t LightESPColor(CachedEntity *ent); }}} diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index 580cc6b0..5251179c 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -1,4 +1,4 @@ -#include "common.hpp" +#include "LightESP.hpp" namespace hacks { @@ -22,18 +22,15 @@ void run() { hitp[i] = {0, 0, 0}; continue; } - if (pEntity->m_iTeam() == LOCAL_E->m_iTeam()) - continue; - if (pEntity->m_Type() != ENTITY_PLAYER) + if (pEntity->m_iTeam() == LOCAL_E->m_iTeam() && playerlist::IsDefault(pEntity)) { + hitp[i] = {0, 0, 0}; continue; + } if (!pEntity->hitboxes.GetHitbox(0)) continue; - Vector hitboxpos = pEntity->hitboxes.GetHitbox(0)->center; - Vector min = pEntity->hitboxes.GetHitbox(0)->min; - Vector max = pEntity->hitboxes.GetHitbox(0)->max; - hitp[i] = hitboxpos; - minp[i] = min; - maxp[i] = max; + hitp[i] = pEntity->hitboxes.GetHitbox(0)->center; + minp[i] = pEntity->hitboxes.GetHitbox(0)->min; + maxp[i] = pEntity->hitboxes.GetHitbox(0)->max; } } void draw() { @@ -41,6 +38,9 @@ void draw() { if (!enable) return; for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { + CachedEntity *pEntity = ENTITY(i); + if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) + continue; auto hitboxpos = hitp[i]; auto min = minp[i]; auto max = maxp[i]; @@ -57,10 +57,17 @@ void draw() { size = abs(max.y - min.y); draw_api::draw_rect(out.x, out.y, size / 4, size / 4, - colors::green); + hacks::shared::lightesp::LightESPColor(pEntity)); //hacks::shared::lightesp::LightESPColor(pEntity) } } #endif } +rgba_t LightESPColor(CachedEntity *ent) +{ + if (!playerlist::IsDefault(ent)) { + return playerlist::Color(ent); + } + return colors::green; +} }}} From 62ec2a8e56d9c896f76f7c9884b27b1cd39f6ac8 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Mon, 11 Jun 2018 12:32:53 +0200 Subject: [PATCH 16/19] clang-format, add to menu and other changes --- src/hacks/LightESP.cpp | 63 ++++++++++++++++++++---------------- src/visual/menu/ncc/Menu.cpp | 4 +++ 2 files changed, 39 insertions(+), 28 deletions(-) diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index 5251179c..2fc0dbe4 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -7,57 +7,61 @@ namespace shared namespace lightesp { - -CatVar enable(CV_SWITCH, "lightesp", "0", "Enable LightESP", +CatVar enable(CV_SWITCH, "lightesp_enabled", "0", "Enable LightESP", "Lightweight ESP. Only shows head."); Vector hitp[32]; Vector minp[32]; Vector maxp[32]; +bool drawEsp[32]; -void run() { +void run() +{ for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { CachedEntity *pEntity = ENTITY(i); - if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) { - hitp[i] = {0, 0, 0}; + if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) + { + drawEsp[i] = false; continue; } - if (pEntity->m_iTeam() == LOCAL_E->m_iTeam() && playerlist::IsDefault(pEntity)) { - hitp[i] = {0, 0, 0}; + if (pEntity->m_iTeam() == LOCAL_E->m_iTeam() && + playerlist::IsDefault(pEntity)) + { + drawEsp[i] = false; continue; } if (!pEntity->hitboxes.GetHitbox(0)) continue; - hitp[i] = pEntity->hitboxes.GetHitbox(0)->center; - minp[i] = pEntity->hitboxes.GetHitbox(0)->min; - maxp[i] = pEntity->hitboxes.GetHitbox(0)->max; + hitp[i] = pEntity->hitboxes.GetHitbox(0)->center; + minp[i] = pEntity->hitboxes.GetHitbox(0)->min; + maxp[i] = pEntity->hitboxes.GetHitbox(0)->max; + drawEsp[i] = true; } } -void draw() { - #if ENABLE_VISUALS +void draw() +{ +#if ENABLE_VISUALS if (!enable) return; - for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { + for (int i = 1; i < g_IEngine->GetMaxClients(); i++) + { + if (!drawEsp[i]) + continue; CachedEntity *pEntity = ENTITY(i); if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) continue; - auto hitboxpos = hitp[i]; - auto min = minp[i]; - auto max = maxp[i]; - - if (!hitboxpos.x && !hitboxpos.y && !hitboxpos.z) - continue; Vector out; - if (draw::WorldToScreen(hitboxpos, out)) + if (draw::WorldToScreen(hitp[i], out)) { - float size = 0.0f; - if (abs(max.x - min.x) > abs(max.y - min.y)) - size = abs(max.x - min.x); + float size; + if (abs(maxp[i].x - minp[i].x) > abs(maxp[i].y - minp[i].y)) + size = abs(maxp[i].x - minp[i].x); else - size = abs(max.y - min.y); + size = abs(maxp[i].y - minp[i].y); - draw_api::draw_rect(out.x, out.y, size / 4, size / 4, - hacks::shared::lightesp::LightESPColor(pEntity)); //hacks::shared::lightesp::LightESPColor(pEntity) + draw_api::draw_rect( + out.x, out.y, size / 4, size / 4, + hacks::shared::lightesp::LightESPColor(pEntity)); } } #endif @@ -65,9 +69,12 @@ void draw() { rgba_t LightESPColor(CachedEntity *ent) { - if (!playerlist::IsDefault(ent)) { + if (!playerlist::IsDefault(ent)) + { return playerlist::Color(ent); } return colors::green; } -}}} +} +} +} diff --git a/src/visual/menu/ncc/Menu.cpp b/src/visual/menu/ncc/Menu.cpp index b60af187..e7654014 100644 --- a/src/visual/menu/ncc/Menu.cpp +++ b/src/visual/menu/ncc/Menu.cpp @@ -198,6 +198,10 @@ static const std::string list_hl2dm = R"( "glow_medkits" "glow_ammo" ] + "LightESP" [ + "LightESP Menu" + "lightesp_enabled" + ] "GUI" [ "GUI Settings" "logo" From 72e4f1af7e33942d984ea06de361482d3354f4e7 Mon Sep 17 00:00:00 2001 From: LightCat Date: Mon, 11 Jun 2018 23:16:18 +0200 Subject: [PATCH 17/19] Uhm you saw nothing --- src/hacks/AutoDeadringer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hacks/AutoDeadringer.cpp b/src/hacks/AutoDeadringer.cpp index 59d61853..18ff9f60 100644 --- a/src/hacks/AutoDeadringer.cpp +++ b/src/hacks/AutoDeadringer.cpp @@ -48,6 +48,8 @@ int NearbyEntities() } void CreateMove() { + if (!enabled) + return; if (CE_BAD(LOCAL_E)) return; if (!HasWeapon(LOCAL_E, 59)) From 39bd6543f329b9d6488b7379998eb633dc5722b2 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Tue, 12 Jun 2018 09:21:43 +0200 Subject: [PATCH 18/19] Small fix --- src/hacks/LightESP.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index 2fc0dbe4..fb1ad6da 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -16,6 +16,9 @@ bool drawEsp[32]; void run() { +#if ENABLE_VISUALS + if (!enable) + return; for (int i = 1; i < g_IEngine->GetMaxClients(); i++) { CachedEntity *pEntity = ENTITY(i); @@ -37,6 +40,7 @@ void run() maxp[i] = pEntity->hitboxes.GetHitbox(0)->max; drawEsp[i] = true; } +#endif } void draw() { From 943951a02c40fc7f6a228d9f99368a921d300b8f Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Tue, 12 Jun 2018 15:38:12 +0200 Subject: [PATCH 19/19] Uff --- src/visual/menu/ncc/Menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/visual/menu/ncc/Menu.cpp b/src/visual/menu/ncc/Menu.cpp index e7654014..aa26e49b 100644 --- a/src/visual/menu/ncc/Menu.cpp +++ b/src/visual/menu/ncc/Menu.cpp @@ -198,10 +198,6 @@ static const std::string list_hl2dm = R"( "glow_medkits" "glow_ammo" ] - "LightESP" [ - "LightESP Menu" - "lightesp_enabled" - ] "GUI" [ "GUI Settings" "logo" @@ -571,6 +567,10 @@ static const std::string list_tf2 = R"( "glow_self_b" ] ] + "LightESP" [ + "LightESP Menu" + "lightesp_enabled" + ] "Colors" [ "Colors Menu" "gui_rainbow"