From 3a04238eec9a4dc66665fa57ad2173b34d743840 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Mon, 30 Oct 2023 04:57:14 -0600 Subject: [PATCH 1/6] Fix for rendering non players & Update offsets --- memory-external/hacks/hack.hpp | 3 +++ offsets/offsets.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 195ffe3..31252bd 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -128,6 +128,9 @@ namespace hack { if (config::render_distance != -1 && (localOrigin - origin).length2d() > config::render_distance) continue; + if (origin.x == 0 && origin.y == 0 && origin.z == 0) + continue; + const Vector3 screenPos = origin.world_to_screen(view_matrix); const Vector3 screenHead = head.world_to_screen(view_matrix); diff --git a/offsets/offsets.json b/offsets/offsets.json index b4c5268..45bcaf5 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -3,7 +3,7 @@ "dwLocalPlayer": 25067864, "dwEntityList": 24745408, "dwViewMatrix": 25720624, - "dwBuildNumber": 4748564, + "dwBuildNumber": 4752660, "dwPlantedC4": 25739232, "m_flC4Blow": 3760, "m_flNextBeep": 3756, @@ -22,4 +22,4 @@ "m_sSanitizedPlayerName": 1824, "m_iTeamNum": 959, "m_vecOrigin": 4628 -} \ No newline at end of file +} From a889a66554181323ff54757421d56476e8d6475f Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Tue, 31 Oct 2023 02:17:10 -0600 Subject: [PATCH 2/6] Head Tracker - Adds in a more advanced head tracker that uses bone array to get the exact position of head - Currently the circle changes size based on distance from player as the radius is set to a constant 5, this needs to be based off distance --- memory-external/classes/render.hpp | 11 +++++++++++ memory-external/hacks/hack.hpp | 24 ++++++++++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/memory-external/classes/render.hpp b/memory-external/classes/render.hpp index bab648d..ec5ce9e 100644 --- a/memory-external/classes/render.hpp +++ b/memory-external/classes/render.hpp @@ -3,6 +3,17 @@ namespace render { + void DrawCircle(HDC hdc, int x, int y, int radius, COLORREF color) + { + HBRUSH hBrush = CreateSolidBrush(color); + HBRUSH hOldBrush = (HBRUSH)SelectObject(hdc, hBrush); + + Ellipse(hdc, x - radius, y - radius, x + radius, y + radius); + + SelectObject(hdc, hOldBrush); + DeleteObject(hBrush); + } + void DrawBorderBox(HDC hdc, int x, int y, int w, int h, COLORREF borderColor) { HBRUSH hBorderBrush = CreateSolidBrush(borderColor); diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 31252bd..988a924 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -125,24 +125,40 @@ namespace hack { const Vector3 origin = process->read(pCSPlayerPawn + updater::offsets::m_vecOrigin); const Vector3 head = { origin.x, origin.y, origin.z + 75.f }; + if (origin.x == localOrigin.x && origin.y == localOrigin.y && origin.z == localOrigin.z) + continue; + + const uintptr_t gamescene = process->read(pCSPlayerPawn + 0x310); + const uintptr_t bonearray = process->read(gamescene + 0x160 + 0x80); + const Vector3 headPos = process->read(bonearray + 6 * 32); + if (config::render_distance != -1 && (localOrigin - origin).length2d() > config::render_distance) continue; - if (origin.x == 0 && origin.y == 0 && origin.z == 0) + if (origin.x == 0 && origin.y == 0) continue; const Vector3 screenPos = origin.world_to_screen(view_matrix); const Vector3 screenHead = head.world_to_screen(view_matrix); + const Vector3 screenHeadPos = headPos.world_to_screen(view_matrix); if (screenPos.z >= 0.01f) { const float height = screenPos.y - screenHead.y; const float width = height / 2.4f; - const float head_height = (screenPos.y - screenHead.y) / 8; - const float head_width = (height / 2.4f) / 4; + const float head_height = (screenHeadPos.y - screenHeadPos.y) / 8; + const float head_width = (head_height / 2.4f) / 4; float distance = localOrigin.calculate_distance(origin); int roundedDistance = std::round(distance / 10.f); + render::DrawCircle( + g::hdcBuffer, + screenHeadPos.x, + screenHeadPos.y, + 5, + config::esp_box_color_enemy + ); + render::DrawBorderBox( g::hdcBuffer, screenHead.x - width / 2, @@ -296,7 +312,7 @@ namespace hack { } } } - std::this_thread::sleep_for(std::chrono::milliseconds(1)); + // std::this_thread::sleep_for(std::chrono::milliseconds(1)); } } From 0dce18a1bbf2675878d7847350628d2ffee686a5 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sat, 4 Nov 2023 14:38:22 -0600 Subject: [PATCH 3/6] Update offsets for build 13967 --- offsets/offsets.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 45bcaf5..06969f6 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,10 +1,10 @@ { - "build_number": 13965, - "dwLocalPlayer": 25067864, - "dwEntityList": 24745408, - "dwViewMatrix": 25720624, + "build_number": 13967, + "dwLocalPlayer": 25144424, + "dwEntityList": 24820056, + "dwViewMatrix": 25206992, "dwBuildNumber": 4752660, - "dwPlantedC4": 25739232, + "dwPlantedC4": 25226056, "m_flC4Blow": 3760, "m_flNextBeep": 3756, "m_flTimerLength": 3768, @@ -12,14 +12,14 @@ "m_iAccount": 64, "m_vecAbsOrigin": 200, "m_pGameSceneNode": 784, - "m_flFlashOverlayAlpha": 5188, - "m_bIsDefusing": 5008, + "m_flFlashOverlayAlpha": 5212, + "m_bIsDefusing": 5032, "m_szName": 3096, - "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, + "m_pClippingWeapon": 4776, + "m_ArmorValue": 5384, "m_iHealth": 812, "m_hPlayerPawn": 1980, "m_sSanitizedPlayerName": 1824, "m_iTeamNum": 959, - "m_vecOrigin": 4628 -} + "m_vecOrigin": 4644 +} \ No newline at end of file From ffe605d61ef617f34876aa4fb325aeb0687bc964 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sat, 4 Nov 2023 14:53:47 -0600 Subject: [PATCH 4/6] Revert "Update offsets for build 13967" This reverts commit 0dce18a1bbf2675878d7847350628d2ffee686a5. --- offsets/offsets.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 06969f6..45bcaf5 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,10 +1,10 @@ { - "build_number": 13967, - "dwLocalPlayer": 25144424, - "dwEntityList": 24820056, - "dwViewMatrix": 25206992, + "build_number": 13965, + "dwLocalPlayer": 25067864, + "dwEntityList": 24745408, + "dwViewMatrix": 25720624, "dwBuildNumber": 4752660, - "dwPlantedC4": 25226056, + "dwPlantedC4": 25739232, "m_flC4Blow": 3760, "m_flNextBeep": 3756, "m_flTimerLength": 3768, @@ -12,14 +12,14 @@ "m_iAccount": 64, "m_vecAbsOrigin": 200, "m_pGameSceneNode": 784, - "m_flFlashOverlayAlpha": 5212, - "m_bIsDefusing": 5032, + "m_flFlashOverlayAlpha": 5188, + "m_bIsDefusing": 5008, "m_szName": 3096, - "m_pClippingWeapon": 4776, - "m_ArmorValue": 5384, + "m_pClippingWeapon": 4752, + "m_ArmorValue": 5360, "m_iHealth": 812, "m_hPlayerPawn": 1980, "m_sSanitizedPlayerName": 1824, "m_iTeamNum": 959, - "m_vecOrigin": 4644 -} \ No newline at end of file + "m_vecOrigin": 4628 +} From 2e088b2fa272616c3596f1bf9c84883baf7b73f0 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sat, 4 Nov 2023 14:54:55 -0600 Subject: [PATCH 5/6] Fix armor not updating correctly --- memory-external/classes/auto_updater.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index 2578589..36542ca 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -219,10 +219,10 @@ namespace updater { offsets::m_bIsDefusing = data["m_bIsDefusing"]; if (data["m_szName"].is_number()) offsets::m_szName = data["m_szName"]; - if (data["m_pClippingWeapon "].is_number()) - offsets::m_pClippingWeapon = data["m_pClippingWeapon "]; - if (data["m_ArmorValue "].is_number()) - offsets::m_ArmorValue = data["m_ArmorValue "]; + if (data["m_pClippingWeapon"].is_number()) + offsets::m_pClippingWeapon = data["m_pClippingWeapon"]; + if (data["m_ArmorValue"].is_number()) + offsets::m_ArmorValue = data["m_ArmorValue"]; if (data["m_iHealth"].is_number()) offsets::m_iHealth = data["m_iHealth"]; if (data["m_hPlayerPawn"].is_number()) From 14341bb4142e8d8b649a8e258faab49b3033a1e5 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sat, 4 Nov 2023 15:00:09 -0600 Subject: [PATCH 6/6] Update offsets.json --- offsets/offsets.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 45bcaf5..06969f6 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,10 +1,10 @@ { - "build_number": 13965, - "dwLocalPlayer": 25067864, - "dwEntityList": 24745408, - "dwViewMatrix": 25720624, + "build_number": 13967, + "dwLocalPlayer": 25144424, + "dwEntityList": 24820056, + "dwViewMatrix": 25206992, "dwBuildNumber": 4752660, - "dwPlantedC4": 25739232, + "dwPlantedC4": 25226056, "m_flC4Blow": 3760, "m_flNextBeep": 3756, "m_flTimerLength": 3768, @@ -12,14 +12,14 @@ "m_iAccount": 64, "m_vecAbsOrigin": 200, "m_pGameSceneNode": 784, - "m_flFlashOverlayAlpha": 5188, - "m_bIsDefusing": 5008, + "m_flFlashOverlayAlpha": 5212, + "m_bIsDefusing": 5032, "m_szName": 3096, - "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, + "m_pClippingWeapon": 4776, + "m_ArmorValue": 5384, "m_iHealth": 812, "m_hPlayerPawn": 1980, "m_sSanitizedPlayerName": 1824, "m_iTeamNum": 959, - "m_vecOrigin": 4628 -} + "m_vecOrigin": 4644 +} \ No newline at end of file