From 5b0292e71220ccf66fe1407b6887999ddc78a371 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:33:06 -0600 Subject: [PATCH 01/48] Update hack.hpp - Added armor and weapon name --- memory-external/hacks/hack.hpp | 47 +++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index a6eeb25..6354902 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -10,6 +10,16 @@ namespace hack { ProcessModule base_client; ProcessModule base_engine; + std::string ReadString(HANDLE proc, uintptr_t memoryAddress, size_t maxLength = 512) + { + char buffer[512] = { 0 }; + SIZE_T bytesRead = 0; + + ReadProcessMemory(proc, (LPCVOID)memoryAddress, buffer, maxLength, &bytesRead); + + return std::string(buffer); + } + void loop() { const uintptr_t localPlayer = process->read(base_client.base + updater::offsets::dwLocalPlayer); if (!localPlayer) @@ -60,6 +70,7 @@ namespace hack { continue; const int playerHealth = process->read(pCSPlayerPawn + updater::offsets::m_iHealth); + const int playerArmor = process->read(pCSPlayerPawn + updater::offsets::m_ArmorValue); if (playerHealth <= 0 || playerHealth > 100) continue; @@ -75,6 +86,18 @@ namespace hack { playerName = std::string(buf); } + const auto clipping_weapon = process->read(pCSPlayerPawn + 0x1290); + const auto weapon_data = process->read(clipping_weapon + 0x360); + const auto weaponName_ptr = process->read(weapon_data + 0xc18); + std::string weaponName = "Invalid Weapon Name"; + + if (!weaponName_ptr) { + weaponName = "Invalid Weapon Name"; + } + else { + weaponName = ReadString(process->handle_, weaponName_ptr, 32); + } + const Vector3 origin = process->read(pCSPlayerPawn + updater::offsets::m_vecOrigin); const Vector3 head = { origin.x, origin.y, origin.z + 75.f }; const Vector3 head2 = { origin.x + 10, origin.y + 10, origin.z + 75.f }; @@ -148,12 +171,34 @@ namespace hack { 10 ); + render::RenderText( + g::hdcBuffer, + screenHead.x + (width / 2 + 5), + screenHead.y + 20, + (std::to_string(playerArmor) + "armor").c_str(), + RGB( + (255 - playerArmor), + (55 + playerArmor * 2), + 75 + ), + 10 + ); + if (config::show_extra_flags) { render::RenderText( g::hdcBuffer, screenHead.x + (width / 2 + 5), - screenHead.y + 20, + screenHead.y + 30, + weaponName.c_str(), + config::esp_distance_color, + 10 + ); + + render::RenderText( + g::hdcBuffer, + screenHead.x + (width / 2 + 5), + screenHead.y + 40, (std::to_string(roundedDistance) + "m away").c_str(), config::esp_distance_color, 10 From 4c4038d613bbc5ac03bda7002820854c8e6e723b Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:33:27 -0600 Subject: [PATCH 02/48] Update auto_updater.hpp - Added armor and weapon name --- memory-external/classes/auto_updater.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 6d92864..51fcbef 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -38,6 +38,7 @@ namespace updater { inline std::ptrdiff_t dwViewMatrix = 0x187DAB0; inline std::ptrdiff_t dwBuildNumber = 0x487514; + inline std::ptrdiff_t m_ArmorValue = 0x14F8; inline std::ptrdiff_t m_iHealth = 0x32C; inline std::ptrdiff_t dwPlayerPawn = 0x7BC; inline std::ptrdiff_t dwSanitizedName = 0x720; From 0669bc0b05af633ff5745a95c1579302d2075448 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:34:01 -0600 Subject: [PATCH 03/48] Update auto_updater.cpp - Added armor and weapon name --- memory-external/classes/auto_updater.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index 30b797e..bf674b7 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -196,6 +196,8 @@ namespace updater { if (data["dwBuildNumber"].is_number()) offsets::dwBuildNumber = data["dwBuildNumber"]; + 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["dwPlayerPawn"].is_number()) @@ -220,6 +222,7 @@ namespace updater { data["dwViewMatrix"] = offsets::dwViewMatrix; data["dwBuildNumber"] = offsets::dwBuildNumber; + data["m_ArmorValue"] = offsets::m_ArmorValue; data["m_iHealth"] = offsets::m_iHealth; data["dwPlayerPawn"] = offsets::dwPlayerPawn; data["dwSanitizedName"] = offsets::dwSanitizedName; From 484218c761b45b18a9c79d3914b8d9b337fb9728 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:47:51 -0600 Subject: [PATCH 04/48] Update auto_updater.cpp --- memory-external/classes/auto_updater.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index bf674b7..5e741ea 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -196,6 +196,10 @@ namespace updater { if (data["dwBuildNumber"].is_number()) offsets::dwBuildNumber = data["dwBuildNumber"]; + 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_iHealth"].is_number()) @@ -222,6 +226,8 @@ namespace updater { data["dwViewMatrix"] = offsets::dwViewMatrix; data["dwBuildNumber"] = offsets::dwBuildNumber; + data["m_szName"] = offsets::m_szName; + data["m_pClippingWeapon"] = offsets::m_pClippingWeapon; data["m_ArmorValue"] = offsets::m_ArmorValue; data["m_iHealth"] = offsets::m_iHealth; data["dwPlayerPawn"] = offsets::dwPlayerPawn; From b842a1fd8dbc4c3638a153a0a041cb61fea03a25 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:48:01 -0600 Subject: [PATCH 05/48] Update auto_updater.hpp --- memory-external/classes/auto_updater.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 51fcbef..9575e44 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -38,6 +38,8 @@ namespace updater { inline std::ptrdiff_t dwViewMatrix = 0x187DAB0; inline std::ptrdiff_t dwBuildNumber = 0x487514; + inline std::ptrdiff_t m_szName = 0xC18; + inline std::ptrdiff_t m_pClippingWeapon = 0x1290; inline std::ptrdiff_t m_ArmorValue = 0x14F8; inline std::ptrdiff_t m_iHealth = 0x32C; inline std::ptrdiff_t dwPlayerPawn = 0x7BC; From 9e323f7c9e54c1c9d6a2186e6f1c18ee4eaf0d8f Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:48:16 -0600 Subject: [PATCH 06/48] Update hack.hpp --- memory-external/hacks/hack.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 6354902..0c52c94 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -86,9 +86,9 @@ namespace hack { playerName = std::string(buf); } - const auto clipping_weapon = process->read(pCSPlayerPawn + 0x1290); + const auto clipping_weapon = process->read(pCSPlayerPawn + updater::offsets::m_pClippingWeapon); const auto weapon_data = process->read(clipping_weapon + 0x360); - const auto weaponName_ptr = process->read(weapon_data + 0xc18); + const auto weaponName_ptr = process->read(weapon_data + updater::offsets::m_szName); std::string weaponName = "Invalid Weapon Name"; if (!weaponName_ptr) { @@ -132,13 +132,22 @@ namespace hack { render::DrawBorderBox( g::hdcBuffer, - screenHead.x - (width / 2 + 5), + screenHead.x - (width / 2 + 10), screenHead.y + (height * (100 - playerHealth) / 100), 2, height - (height * (100 - playerHealth) / 100), + RGB(0, 185, 255) + ); + + render::DrawBorderBox( + g::hdcBuffer, + screenHead.x - (width / 2 + 5), + screenHead.y + (height * (100 - playerArmor) / 100), + 2, + height - (height * (100 - playerArmor) / 100), RGB( - (255 - playerHealth), - (55 + playerHealth * 2), + (255 - playerArmor), + (55 + playerArmor * 2), 75 ) ); From 908e90467390e6f3fbb49d998999ae1812e5cbbc Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:48:34 -0600 Subject: [PATCH 07/48] Update offsets.json --- offsets/offsets.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index ab8b625..e04eae6 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,12 +1,13 @@ { - "build_number": 13962, - "dwBuildNumber": 4748564, "dwEntityList": 24706184, "dwLocalPlayer": 25027848, + "m_szName": 3096, + "m_pClippingWeapon": 4752, + "m_ArmorValue": 5368, + "m_iHealth": 812, "dwPlayerPawn": 1980, "dwSanitizedName": 1824, "dwViewMatrix": 25680560, - "m_iHealth": 812, "m_iTeamNum": 959, "m_vecOrigin": 4628 } From 4eb961212b0109e36bb3e96865429ffd4cdcf1d6 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:50:41 -0600 Subject: [PATCH 08/48] Update hack.hpp --- memory-external/hacks/hack.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 0c52c94..91502cf 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -133,20 +133,20 @@ namespace hack { render::DrawBorderBox( g::hdcBuffer, screenHead.x - (width / 2 + 10), - screenHead.y + (height * (100 - playerHealth) / 100), + screenHead.y + (height * (100 - playerArmor) / 100), 2, - height - (height * (100 - playerHealth) / 100), + height - (height * (100 - playerArmor) / 100), RGB(0, 185, 255) ); render::DrawBorderBox( g::hdcBuffer, screenHead.x - (width / 2 + 5), - screenHead.y + (height * (100 - playerArmor) / 100), + screenHead.y + (height * (100 - playerHealth) / 100), 2, - height - (height * (100 - playerArmor) / 100), + height - (height * (100 - playerHealth) / 100), RGB( - (255 - playerArmor), + (255 - playerHealth), (55 + playerArmor * 2), 75 ) From e293c517434c2f09d0847fae17406a953ff9183f Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 05:57:13 -0600 Subject: [PATCH 09/48] Update hack.hpp --- memory-external/hacks/hack.hpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 91502cf..f2ef9f5 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -10,16 +10,6 @@ namespace hack { ProcessModule base_client; ProcessModule base_engine; - std::string ReadString(HANDLE proc, uintptr_t memoryAddress, size_t maxLength = 512) - { - char buffer[512] = { 0 }; - SIZE_T bytesRead = 0; - - ReadProcessMemory(proc, (LPCVOID)memoryAddress, buffer, maxLength, &bytesRead); - - return std::string(buffer); - } - void loop() { const uintptr_t localPlayer = process->read(base_client.base + updater::offsets::dwLocalPlayer); if (!localPlayer) @@ -86,16 +76,18 @@ namespace hack { playerName = std::string(buf); } - const auto clipping_weapon = process->read(pCSPlayerPawn + updater::offsets::m_pClippingWeapon); - const auto weapon_data = process->read(clipping_weapon + 0x360); - const auto weaponName_ptr = process->read(weapon_data + updater::offsets::m_szName); + const auto clippingWeapon = process->read(pCSPlayerPawn + updater::offsets::m_pClippingWeapon); + const auto weaponData = process->read(clippingWeapon + 0x360); + const auto weaponNameAddress = process->read(weaponData + updater::offsets::m_szName); std::string weaponName = "Invalid Weapon Name"; - if (!weaponName_ptr) { + if (!weaponNameAddress) { weaponName = "Invalid Weapon Name"; } else { - weaponName = ReadString(process->handle_, weaponName_ptr, 32); + char buf[32]; + process->read_raw(weaponNameAddress, buf, sizeof(buf)); + weaponName = std::string(buf); } const Vector3 origin = process->read(pCSPlayerPawn + updater::offsets::m_vecOrigin); From 222a7e35144fed8358e223615edd173e28243b1c Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 06:05:47 -0600 Subject: [PATCH 10/48] Update hack.hpp - Fix typo --- memory-external/hacks/hack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index f2ef9f5..e798d89 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -139,7 +139,7 @@ namespace hack { height - (height * (100 - playerHealth) / 100), RGB( (255 - playerHealth), - (55 + playerArmor * 2), + (55 + playerHealth * 2), 75 ) ); From 7fb0a038a8c61b22c74490746cda5f6acf93cfd4 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 06:30:35 -0600 Subject: [PATCH 11/48] Update hack.hpp - Added "isDefusing" tag --- memory-external/hacks/hack.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index e798d89..f35937d 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -187,6 +187,8 @@ namespace hack { if (config::show_extra_flags) { + const bool isDefusing = process->read(pCSPlayerPawn + updater::offsets::m_bIsDefusing); + render::RenderText( g::hdcBuffer, screenHead.x + (width / 2 + 5), @@ -204,6 +206,20 @@ namespace hack { config::esp_distance_color, 10 ); + + std::string defuText = "Player is defusing"; + + if (isDefusing) + { + render::RenderText( + g::hdcBuffer, + screenHead.x + (width / 2 + 5), + screenHead.y + 50, + defuText.c_str(), + config::esp_distance_color, + 10 + ); + } } /** From 3b1b1531015949519895336daa2fa370195e1bdd Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 06:30:55 -0600 Subject: [PATCH 12/48] Update auto_updater.cpp - Added isDefusing --- memory-external/classes/auto_updater.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index 5e741ea..ac60047 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -196,8 +196,10 @@ namespace updater { if (data["dwBuildNumber"].is_number()) offsets::dwBuildNumber = data["dwBuildNumber"]; - if (data["m_szName "].is_number()) - offsets::m_szName = data["m_szName "]; + if (data["m_bIsDefusing"].is_number()) + 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()) @@ -226,6 +228,7 @@ namespace updater { data["dwViewMatrix"] = offsets::dwViewMatrix; data["dwBuildNumber"] = offsets::dwBuildNumber; + data["m_bIsDefusing"] = offsets::m_bIsDefusing; data["m_szName"] = offsets::m_szName; data["m_pClippingWeapon"] = offsets::m_pClippingWeapon; data["m_ArmorValue"] = offsets::m_ArmorValue; From ffd48af4265bd53a510f16d3bb967d3ade4c3f5e Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 06:31:10 -0600 Subject: [PATCH 13/48] Update auto_updater.hpp - Added isDefusing --- memory-external/classes/auto_updater.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 9575e44..5fad4e6 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -38,6 +38,7 @@ namespace updater { inline std::ptrdiff_t dwViewMatrix = 0x187DAB0; inline std::ptrdiff_t dwBuildNumber = 0x487514; + inline std::ptrdiff_t m_bIsDefusing = 0x1390; inline std::ptrdiff_t m_szName = 0xC18; inline std::ptrdiff_t m_pClippingWeapon = 0x1290; inline std::ptrdiff_t m_ArmorValue = 0x14F8; From 27c1a111ed58a360fb4b3b4ea36ee69b1d8c863d Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 06:31:45 -0600 Subject: [PATCH 14/48] Update offsets.json - Added isDefusing --- offsets/offsets.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index e04eae6..cb23b9a 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,9 +1,10 @@ { "dwEntityList": 24706184, "dwLocalPlayer": 25027848, - "m_szName": 3096, - "m_pClippingWeapon": 4752, - "m_ArmorValue": 5368, + "m_bIsDefusing": 5008, + "m_szName": 3096, + "m_pClippingWeapon": 4752, + "m_ArmorValue": 5368, "m_iHealth": 812, "dwPlayerPawn": 1980, "dwSanitizedName": 1824, From 6a954df508fcf43bbccf4b7a2039562fd563cbb5 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 15 Oct 2023 06:37:59 -0600 Subject: [PATCH 15/48] Update offsets.json --- offsets/offsets.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/offsets/offsets.json b/offsets/offsets.json index cb23b9a..c41ceb5 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,4 +1,6 @@ { + "build_number": 13962, + "dwBuildNumber": 4748564, "dwEntityList": 24706184, "dwLocalPlayer": 25027848, "m_bIsDefusing": 5008, From 5e781c21d3a487faf9d74a5f4613924152a89047 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Mon, 16 Oct 2023 04:33:21 -0600 Subject: [PATCH 16/48] Update hack.hpp - Changed flag_render_distance from > to < as this is what is supposed to be --- memory-external/hacks/hack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index f35937d..3071531 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -156,7 +156,7 @@ namespace hack { /** * I know is not the best way but a simple way to not saturate the screen with a ton of information */ - if (roundedDistance > config::flag_render_distance) + if (roundedDistance < config::flag_render_distance) continue; render::RenderText( From c42c66fa1c781efbdefcac977d2dd1459c057ffe Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Tue, 17 Oct 2023 01:15:50 -0600 Subject: [PATCH 17/48] Update hack.hpp - Fix player distance, as it was just 0, 0, 0 *Fixed by grabbing the pCSPlayerPawn from localPlayer and reading vecOrigin from that* --- memory-external/hacks/hack.hpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 3071531..2567fc2 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -17,9 +17,18 @@ namespace hack { const int localTeam = process->read(localPlayer + updater::offsets::m_iTeamNum); const view_matrix_t view_matrix = process->read(base_client.base + updater::offsets::dwViewMatrix); - const Vector3 localOrigin = process->read(localPlayer + updater::offsets::m_vecOrigin); const uintptr_t entity_list = process->read(base_client.base + updater::offsets::dwEntityList); + const std::uint32_t localPlayerPawn = process->read(localPlayer + updater::offsets::dwPlayerPawn); + if (!localPlayerPawn) + return; + const uintptr_t localList_entry2 = process->read(entity_list + 0x8 * ((localPlayerPawn & 0x7FFF) >> 9) + 16); + const uintptr_t localpCSPlayerPawn = process->read(localList_entry2 + 120 * (localPlayerPawn & 0x1FF)); + if (!localpCSPlayerPawn) + return; + + const Vector3 localOrigin = process->read(localpCSPlayerPawn + updater::offsets::m_vecOrigin); + int playerIndex = 0; uintptr_t list_entry; @@ -156,7 +165,7 @@ namespace hack { /** * I know is not the best way but a simple way to not saturate the screen with a ton of information */ - if (roundedDistance < config::flag_render_distance) + if (roundedDistance > config::flag_render_distance) continue; render::RenderText( From 229869361835b5f5eab23b30f456cba38d00186a Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:41:53 -0600 Subject: [PATCH 18/48] Update auto_updater.hpp - Update offsets --- memory-external/classes/auto_updater.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 5fad4e6..418317e 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -30,18 +30,18 @@ namespace updater { const inline std::string github_repo_api = "https://api.github.com/repos/IMXNOOBX/cs2-external-esp/commits"; const inline std::string raw_updated_offets = "https://github.com/IMXNOOBX/cs2-external-esp/raw/main/offsets/offsets.json"; - inline int build_number = 13962; + inline int build_number = 13963; namespace offsets { - inline std::ptrdiff_t dwLocalPlayer = 0x17DE508; - inline std::ptrdiff_t dwEntityList = 0x178FC88; - inline std::ptrdiff_t dwViewMatrix = 0x187DAB0; + inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8; + inline std::ptrdiff_t dwEntityList = 0x1793DC8; + inline std::ptrdiff_t dwViewMatrix = 0x1881D70; inline std::ptrdiff_t dwBuildNumber = 0x487514; inline std::ptrdiff_t m_bIsDefusing = 0x1390; inline std::ptrdiff_t m_szName = 0xC18; inline std::ptrdiff_t m_pClippingWeapon = 0x1290; - inline std::ptrdiff_t m_ArmorValue = 0x14F8; + inline std::ptrdiff_t m_ArmorValue = 0x14F0; inline std::ptrdiff_t m_iHealth = 0x32C; inline std::ptrdiff_t dwPlayerPawn = 0x7BC; inline std::ptrdiff_t dwSanitizedName = 0x720; From a127bd21e8f159d4ae808e4dc1021d24f44d6595 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:42:31 -0600 Subject: [PATCH 19/48] Update offsets.json - Update offsets to new build 10/17/23 --- offsets/offsets.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index c41ceb5..0d4aa1e 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,16 +1,16 @@ { - "build_number": 13962, + "build_number": 13963, + "dwLocalPlayer": 25044936, + "dwEntityList": 24722888, + "dwViewMatrix": 25697648, "dwBuildNumber": 4748564, - "dwEntityList": 24706184, - "dwLocalPlayer": 25027848, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5368, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "dwViewMatrix": 25680560, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From 99e1ca4cd85d7668974de8b131c92fbc69abaef2 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:43:08 -0600 Subject: [PATCH 20/48] Update offsets.json --- offsets/offsets.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 0d4aa1e..9c21c92 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,16 +1,16 @@ { "build_number": 13963, - "dwLocalPlayer": 25044936, - "dwEntityList": 24722888, - "dwViewMatrix": 25697648, + "dwLocalPlayer": 25044936, + "dwEntityList": 24722888, + "dwViewMatrix": 25697648, "dwBuildNumber": 4748564, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From 49cd05f4fff923cbc327c0f368a01a8979f7bd0d Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:54:22 -0600 Subject: [PATCH 21/48] Update offsets.json --- offsets/offsets.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 938a7bb..9a945df 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,16 +1,16 @@ { "build_number": 13963, - "dwLocalPlayer": 25044936, - "dwEntityList": 24722888, - "dwViewMatrix": 25697648, + "dwLocalPlayer": 25044936, + "dwEntityList": 24722888, + "dwViewMatrix": 25697648, "dwBuildNumber": 4748564, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From 61280a5ad86ff33715b1ede379e36acf5a671951 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:37:34 -0600 Subject: [PATCH 22/48] Update hack.hpp - Add C4 ESP --- memory-external/hacks/hack.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 2567fc2..7a02b9d 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -38,6 +38,33 @@ namespace hack { * (This could have been done by getting a entity list count from the engine, but I'm too lazy to do that) **/ while (true) { + bool c4IsPlanted = process->read(base_client.base + updater::offsets::dwPlantedC4 - 0x8); + if (c4IsPlanted) + { + const uintptr_t planted_c4 = process->read(process->read(base_client.base + updater::offsets::dwPlantedC4)); + + const uintptr_t c4Node = process->read(planted_c4 + updater::offsets::m_pGameSceneNode); + + const Vector3 c4Origin = process->read(c4Node + updater::offsets::m_vecAbsOrigin); + + const Vector3 c4ScreenPos = c4Origin.world_to_screen(view_matrix); + + float distance = localOrigin.calculate_distance(c4Origin); + float roundedDistance = std::round(distance / 500.f); + + float height = 10 - roundedDistance; + float width = height * 1.2f; + + render::DrawBorderBox( + g::hdcBuffer, + c4ScreenPos.x - (width / 2), + c4ScreenPos.y - (height / 2), + width, + height, + RGB(0, 185, 255) + ); + } + playerIndex++; list_entry = process->read(entity_list + (8 * (playerIndex & 0x7FFF) >> 9) + 16); if (!list_entry) From 58d45c2ae5be4766221d12f0032ac3f7fbcd296d Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:38:19 -0600 Subject: [PATCH 23/48] Update auto_updater.cpp - Add C4 Offsets --- memory-external/classes/auto_updater.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index ac60047..ff03274 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -195,7 +195,13 @@ namespace updater { offsets::dwViewMatrix = data["dwViewMatrix"]; if (data["dwBuildNumber"].is_number()) offsets::dwBuildNumber = data["dwBuildNumber"]; + if (data["dwPlantedC4"].is_number()) + offsets::dwPlantedC4 = data["dwPlantedC4"]; + if (data["m_vecAbsOrigin"].is_number()) + offsets::m_vecAbsOrigin = data["m_vecAbsOrigin"]; + if (data["m_pGameSceneNode"].is_number()) + offsets::m_pGameSceneNode = data["m_pGameSceneNode"]; if (data["m_bIsDefusing"].is_number()) offsets::m_bIsDefusing = data["m_bIsDefusing"]; if (data["m_szName"].is_number()) @@ -227,7 +233,10 @@ namespace updater { data["dwEntityList"] = offsets::dwEntityList; data["dwViewMatrix"] = offsets::dwViewMatrix; data["dwBuildNumber"] = offsets::dwBuildNumber; + data["dwPlantedC4"] = offsets::dwPlantedC4; + data["m_vecAbsOrigin"] = offsets::m_vecAbsOrigin; + data["m_pGameSceneNode"] = offsets::m_pGameSceneNode; data["m_bIsDefusing"] = offsets::m_bIsDefusing; data["m_szName"] = offsets::m_szName; data["m_pClippingWeapon"] = offsets::m_pClippingWeapon; From 767a3af64f5c7270877675446e5b99526581ae96 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:39:07 -0600 Subject: [PATCH 24/48] Update update_offsets.py - Add C4 Offset --- offsets/update_offsets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index a426f08..d46c075 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -32,8 +32,9 @@ dest_data["dwBuildNumber"] = source_data["Engine2Dll"]["dwBuildNumber"] dest_data["dwLocalPlayer"] = source_data["ClientDll"]["dwLocalPlayerPawn"] dest_data["dwEntityList"] = source_data["ClientDll"]["dwEntityList"] dest_data["dwViewMatrix"] = source_data["ClientDll"]["dwViewMatrix"] +dest_data["dwPlantedC4"] = source_data["ClientDll"]["dwPlantedC4"] with open(dest_path, 'w') as dest_file: json.dump(dest_data, dest_file, indent=4) -print("Offsets updated in the local file.") # We dont exit so we know that the game has been updated and that we have to commit the new offsets \ No newline at end of file +print("Offsets updated in the local file.") # We dont exit so we know that the game has been updated and that we have to commit the new offsets From fb47b368b4f75646aa7c36acd81c31564fe08ad9 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:40:35 -0600 Subject: [PATCH 25/48] Update offsets.json - Add C4 Offsets --- offsets/offsets.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/offsets/offsets.json b/offsets/offsets.json index 9a945df..2ad0a8e 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -4,6 +4,9 @@ "dwEntityList": 24722888, "dwViewMatrix": 25697648, "dwBuildNumber": 4748564, + "dwPlantedC4": 25722816, + "m_vecAbsOrigin": 200, + "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, From baf7e889d0bd1bbf289ff1f59fc3f8663e5f905d Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 01:40:49 -0600 Subject: [PATCH 26/48] Update offsets.json --- offsets/offsets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 2ad0a8e..edc446e 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -5,8 +5,8 @@ "dwViewMatrix": 25697648, "dwBuildNumber": 4748564, "dwPlantedC4": 25722816, - "m_vecAbsOrigin": 200, - "m_pGameSceneNode": 784, + "m_vecAbsOrigin": 200, + "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, From 74814bbfe15b92438988608a4b5796b0c1ac52fd Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:31:54 -0600 Subject: [PATCH 27/48] Update auto_updater.hpp --- memory-external/classes/auto_updater.hpp | 42 +++--------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 418317e..fc20b37 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -1,43 +1,11 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "json.hpp" - -using json = nlohmann::json; -namespace fs = std::filesystem; - - -namespace updater { - const std::string file_path = "offsets.json"; - -#ifndef _UC - bool check_and_update(bool prompt_update); - bool get_last_commit_date(json& commit); - bool download_file(const char* url, const char* localPath); -#endif - bool file_good(const std::string& name); - - extern bool read(); - extern void save(); - - const inline std::string github_repo_api = "https://api.github.com/repos/IMXNOOBX/cs2-external-esp/commits"; - const inline std::string raw_updated_offets = "https://github.com/IMXNOOBX/cs2-external-esp/raw/main/offsets/offsets.json"; - - inline int build_number = 13963; - - namespace offsets { - inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8; +inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8; inline std::ptrdiff_t dwEntityList = 0x1793DC8; inline std::ptrdiff_t dwViewMatrix = 0x1881D70; inline std::ptrdiff_t dwBuildNumber = 0x487514; + inline std::ptrdiff_t dwPlantedC4 = 0x1887FC0; + inline std::ptrdiff_t m_vecAbsOrigin = 0xC8; + inline std::ptrdiff_t m_pGameSceneNode = 0x310; inline std::ptrdiff_t m_bIsDefusing = 0x1390; inline std::ptrdiff_t m_szName = 0xC18; inline std::ptrdiff_t m_pClippingWeapon = 0x1290; @@ -47,5 +15,3 @@ namespace updater { inline std::ptrdiff_t dwSanitizedName = 0x720; inline std::ptrdiff_t m_iTeamNum = 0x3BF; inline std::ptrdiff_t m_vecOrigin = 0x1214; - } -} From b98df20228a62add84cd8b88b4cfb9b79abfcede Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:32:58 -0600 Subject: [PATCH 28/48] Update auto_updater.hpp --- memory-external/classes/auto_updater.hpp | 39 +++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index fc20b37..6008ef7 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -1,4 +1,39 @@ -inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8; +#pragma once +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "json.hpp" + +using json = nlohmann::json; +namespace fs = std::filesystem; + + +namespace updater { + const std::string file_path = "offsets.json"; + +#ifndef _UC + bool check_and_update(bool prompt_update); + bool get_last_commit_date(json& commit); + bool download_file(const char* url, const char* localPath); +#endif + bool file_good(const std::string& name); + + extern bool read(); + extern void save(); + + const inline std::string github_repo_api = "https://api.github.com/repos/IMXNOOBX/cs2-external-esp/commits"; + const inline std::string raw_updated_offets = "https://github.com/IMXNOOBX/cs2-external-esp/raw/main/offsets/offsets.json"; + + inline int build_number = 13963; + + namespace offsets { + inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8; inline std::ptrdiff_t dwEntityList = 0x1793DC8; inline std::ptrdiff_t dwViewMatrix = 0x1881D70; inline std::ptrdiff_t dwBuildNumber = 0x487514; @@ -15,3 +50,5 @@ inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8; inline std::ptrdiff_t dwSanitizedName = 0x720; inline std::ptrdiff_t m_iTeamNum = 0x3BF; inline std::ptrdiff_t m_vecOrigin = 0x1214; + } +} From df3c37e5b945a2081bf259dceda95e10aab8cf52 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:49:17 -0600 Subject: [PATCH 29/48] 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 edc446e..ee58edf 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,19 +1,19 @@ { "build_number": 13963, - "dwLocalPlayer": 25044936, - "dwEntityList": 24722888, - "dwViewMatrix": 25697648, + "dwLocalPlayer": 25053416, + "dwEntityList": 24731336, + "dwViewMatrix": 25706128, "dwBuildNumber": 4748564, - "dwPlantedC4": 25722816, - "m_vecAbsOrigin": 200, - "m_pGameSceneNode": 784, + "dwPlantedC4": 25731664, + "m_vecAbsOrigin": 200, + "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From ae55f44ce1ec367838cab7824a28dc1bd9e9c43c Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:49:38 -0600 Subject: [PATCH 30/48] 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 ee58edf..e5e434c 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,19 +1,19 @@ { "build_number": 13963, - "dwLocalPlayer": 25053416, - "dwEntityList": 24731336, - "dwViewMatrix": 25706128, + "dwLocalPlayer": 25053416, + "dwEntityList": 24731336, + "dwViewMatrix": 25706128, "dwBuildNumber": 4748564, - "dwPlantedC4": 25731664, - "m_vecAbsOrigin": 200, - "m_pGameSceneNode": 784, + "dwPlantedC4": 25731664, + "m_vecAbsOrigin": 200, + "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From f792e350c8b5651d7ebbf5c523838972180332ac Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:54:03 -0600 Subject: [PATCH 31/48] Update offsets.json --- offsets/offsets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index e5e434c..7ecfb55 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,5 +1,5 @@ { - "build_number": 13963, + "build_number": 13964, "dwLocalPlayer": 25053416, "dwEntityList": 24731336, "dwViewMatrix": 25706128, From 5f6eafe0d1590ccfd1553e7705f7cf948b5ba784 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:32:37 -0600 Subject: [PATCH 32/48] Update hack.hpp - Added c4 timer and changes color of c4 esp based on time left --- memory-external/hacks/hack.hpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 7a02b9d..d399368 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -43,6 +43,16 @@ namespace hack { { const uintptr_t planted_c4 = process->read(process->read(base_client.base + updater::offsets::dwPlantedC4)); + static auto plantTime = std::chrono::high_resolution_clock::now(); + auto currentTime = std::chrono::high_resolution_clock::now(); + auto elapsedTime = std::chrono::duration(currentTime - plantTime).count(); + + const float c4Timer = process->read(planted_c4 + updater::offsets::m_flTimerLength); + const float c4Beep = process->read(planted_c4 + updater::offsets::m_flNextBeep); + const float c4Blow = process->read(planted_c4 + updater::offsets::m_flC4Blow); + float remainingTime = (c4Blow - c4Beep) / c4Timer; // Constrained to 0.0-1.0 (0.0 being explosion imminent) + remainingTime = remainingTime * 100; // Multiply by 100 to constrain to 0.0-100.00 + const uintptr_t c4Node = process->read(planted_c4 + updater::offsets::m_pGameSceneNode); const Vector3 c4Origin = process->read(c4Node + updater::offsets::m_vecAbsOrigin); @@ -61,7 +71,16 @@ namespace hack { c4ScreenPos.y - (height / 2), width, height, - RGB(0, 185, 255) + RGB((255 - remainingTime), (55 + remainingTime * 2), 75) + ); + + render::RenderText( + g::hdcBuffer, + c4ScreenPos.x + (width / 2 + 5), + c4ScreenPos.y, + ("C4 " + std::to_string(remainingTime)).c_str(), + config::esp_name_color, + 10 ); } From ac7cee7ddc061bce6d75dff0f21bfca01a614314 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:33:23 -0600 Subject: [PATCH 33/48] Update auto_updater.cpp - Added c4 timer offsets --- memory-external/classes/auto_updater.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index ff03274..b8144f4 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -198,6 +198,13 @@ namespace updater { if (data["dwPlantedC4"].is_number()) offsets::dwPlantedC4 = data["dwPlantedC4"]; + if (data["m_flC4Blow"].is_number()) + offsets::m_flC4Blow = data["m_flC4Blow"]; + if (data["m_flNextBeep"].is_number()) + offsets::m_flNextBeep = data["m_flNextBeep"]; + if (data["m_flTimerLength"].is_number()) + offsets::m_flTimerLength = data["m_flTimerLength"]; + if (data["m_vecAbsOrigin"].is_number()) offsets::m_vecAbsOrigin = data["m_vecAbsOrigin"]; if (data["m_pGameSceneNode"].is_number()) @@ -235,6 +242,10 @@ namespace updater { data["dwBuildNumber"] = offsets::dwBuildNumber; data["dwPlantedC4"] = offsets::dwPlantedC4; + data["m_flNextBeep"] = offsets::m_flNextBeep; + data["m_flC4Blow"] = offsets::m_flC4Blow; + data["m_flTimerLength"] = offsets::m_flTimerLength; + data["m_vecAbsOrigin"] = offsets::m_vecAbsOrigin; data["m_pGameSceneNode"] = offsets::m_pGameSceneNode; data["m_bIsDefusing"] = offsets::m_bIsDefusing; From 753fb0f32cce40fe72a02512a41465d835ca749f Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:33:47 -0600 Subject: [PATCH 34/48] Update auto_updater.hpp - Added c4 timer offsets --- memory-external/classes/auto_updater.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 6008ef7..2c5153f 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -39,6 +39,10 @@ namespace updater { inline std::ptrdiff_t dwBuildNumber = 0x487514; inline std::ptrdiff_t dwPlantedC4 = 0x1887FC0; + inline std::ptrdiff_t m_flC4Blow = 0xEB0; + inline std::ptrdiff_t m_flNextBeep = 0xEAC; + inline std::ptrdiff_t m_flTimerLength = 0xEB8; + inline std::ptrdiff_t m_vecAbsOrigin = 0xC8; inline std::ptrdiff_t m_pGameSceneNode = 0x310; inline std::ptrdiff_t m_bIsDefusing = 0x1390; From e867cfd271e3747809c0e3d049a94a589e35e394 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:34:17 -0600 Subject: [PATCH 35/48] Update offsets.json - Added c4 timer offsets --- offsets/offsets.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/offsets/offsets.json b/offsets/offsets.json index 7ecfb55..1023acf 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -5,6 +5,9 @@ "dwViewMatrix": 25706128, "dwBuildNumber": 4748564, "dwPlantedC4": 25731664, + "m_flC4Blow": 3760, + "m_flNextBeep": 3756, + "m_flTimerLength": 3768, "m_vecAbsOrigin": 200, "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, From 4d4bd0d6d1399e3c0554b7fcba5638ad3472900c Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:34:30 -0600 Subject: [PATCH 36/48] Update offsets.json --- offsets/offsets.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 1023acf..a1be950 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -6,8 +6,8 @@ "dwBuildNumber": 4748564, "dwPlantedC4": 25731664, "m_flC4Blow": 3760, - "m_flNextBeep": 3756, - "m_flTimerLength": 3768, + "m_flNextBeep": 3756, + "m_flTimerLength": 3768, "m_vecAbsOrigin": 200, "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, From 926636b0957038121e4ee7b09fca5da646c8b08b Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:20:24 -0600 Subject: [PATCH 37/48] Update auto_updater.hpp - Added player money offsets --- memory-external/classes/auto_updater.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memory-external/classes/auto_updater.hpp b/memory-external/classes/auto_updater.hpp index 2c5153f..116e48a 100644 --- a/memory-external/classes/auto_updater.hpp +++ b/memory-external/classes/auto_updater.hpp @@ -43,6 +43,8 @@ namespace updater { inline std::ptrdiff_t m_flNextBeep = 0xEAC; inline std::ptrdiff_t m_flTimerLength = 0xEB8; + inline std::ptrdiff_t m_pInGameMoneyServices = 0x6D0; + inline std::ptrdiff_t m_iAccount = 0x40; inline std::ptrdiff_t m_vecAbsOrigin = 0xC8; inline std::ptrdiff_t m_pGameSceneNode = 0x310; inline std::ptrdiff_t m_bIsDefusing = 0x1390; From 72a75fdfa858764977529d4d8a2f1e337c93b1ed Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:21:03 -0600 Subject: [PATCH 38/48] Update auto_updater.cpp - Added player money offsets --- memory-external/classes/auto_updater.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/memory-external/classes/auto_updater.cpp b/memory-external/classes/auto_updater.cpp index b8144f4..4b7cab6 100644 --- a/memory-external/classes/auto_updater.cpp +++ b/memory-external/classes/auto_updater.cpp @@ -205,6 +205,10 @@ namespace updater { if (data["m_flTimerLength"].is_number()) offsets::m_flTimerLength = data["m_flTimerLength"]; + if (data["m_pInGameMoneyServices"].is_number()) + offsets::m_pInGameMoneyServices = data["m_pInGameMoneyServices"]; + if (data["m_iAccount"].is_number()) + offsets::m_iAccount = data["m_iAccount"]; if (data["m_vecAbsOrigin"].is_number()) offsets::m_vecAbsOrigin = data["m_vecAbsOrigin"]; if (data["m_pGameSceneNode"].is_number()) @@ -246,6 +250,8 @@ namespace updater { data["m_flC4Blow"] = offsets::m_flC4Blow; data["m_flTimerLength"] = offsets::m_flTimerLength; + data["m_pInGameMoneyServices"] = offsets::m_pInGameMoneyServices; + data["m_iAccount"] = offsets::m_iAccount; data["m_vecAbsOrigin"] = offsets::m_vecAbsOrigin; data["m_pGameSceneNode"] = offsets::m_pGameSceneNode; data["m_bIsDefusing"] = offsets::m_bIsDefusing; From be8666c8b53160b81142ffa9fc6538927465c1da Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:21:44 -0600 Subject: [PATCH 39/48] Update offsets.json --- offsets/offsets.json | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index a1be950..dbb3eaa 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,22 +1,24 @@ { "build_number": 13964, - "dwLocalPlayer": 25053416, - "dwEntityList": 24731336, - "dwViewMatrix": 25706128, + "dwLocalPlayer": 25053416, + "dwEntityList": 24731336, + "dwViewMatrix": 25706128, "dwBuildNumber": 4748564, - "dwPlantedC4": 25731664, - "m_flC4Blow": 3760, - "m_flNextBeep": 3756, - "m_flTimerLength": 3768, - "m_vecAbsOrigin": 200, - "m_pGameSceneNode": 784, + "dwPlantedC4": 25731664, + "m_flC4Blow": 3760, + "m_flNextBeep": 3756, + "m_flTimerLength": 3768, + "m_pInGameMoneyServices": 1744, + "m_iAccount": 64, + "m_vecAbsOrigin": 200, + "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From 25bdfddaf13c0c8f037dd3d78e1379377febd158 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:21:57 -0600 Subject: [PATCH 40/48] Update offsets.json From 0352e04d92b80815c0cfb0aa368d9152e8028e6c Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:22:29 -0600 Subject: [PATCH 41/48] Update offsets.json --- offsets/offsets.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index dbb3eaa..6630c5a 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,24 +1,24 @@ { "build_number": 13964, - "dwLocalPlayer": 25053416, - "dwEntityList": 24731336, - "dwViewMatrix": 25706128, + "dwLocalPlayer": 25053416, + "dwEntityList": 24731336, + "dwViewMatrix": 25706128, "dwBuildNumber": 4748564, - "dwPlantedC4": 25731664, - "m_flC4Blow": 3760, - "m_flNextBeep": 3756, - "m_flTimerLength": 3768, - "m_pInGameMoneyServices": 1744, - "m_iAccount": 64, - "m_vecAbsOrigin": 200, - "m_pGameSceneNode": 784, + "dwPlantedC4": 25731664, + "m_flC4Blow": 3760, + "m_flNextBeep": 3756, + "m_flTimerLength": 3768, + "m_pInGameMoneyServices": 1744, + "m_iAccount": 64, + "m_vecAbsOrigin": 200, + "m_pGameSceneNode": 784, "m_bIsDefusing": 5008, "m_szName": 3096, "m_pClippingWeapon": 4752, - "m_ArmorValue": 5360, - "m_iHealth": 812, - "dwPlayerPawn": 1980, - "dwSanitizedName": 1824, - "m_iTeamNum": 959, + "m_ArmorValue": 5360, + "m_iHealth": 812, + "dwPlayerPawn": 1980, + "dwSanitizedName": 1824, + "m_iTeamNum": 959, "m_vecOrigin": 4628 } From df579c1af7a2454b4f2cdb066c356cca94d8e507 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:24:46 -0600 Subject: [PATCH 42/48] Update hack.hpp - Add player money esp --- memory-external/hacks/hack.hpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index d399368..ef73dc8 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -93,6 +93,9 @@ namespace hack { if (!player) continue; + const uintptr_t playerMoneyServices = process->read(player + updater::offsets::m_pInGameMoneyServices); + const int32_t money = process->read(playerMoneyServices + updater::offsets::m_iAccount); + /** * Skip rendering your own character and teammates * @@ -262,6 +265,15 @@ namespace hack { 10 ); + render::RenderText( + g::hdcBuffer, + screenHead.x + (width / 2 + 5), + screenHead.y + 50, + ("$" + std::to_string(money)).c_str(), + RGB(0, 125, 0), + 10 + ); + std::string defuText = "Player is defusing"; if (isDefusing) @@ -269,7 +281,7 @@ namespace hack { render::RenderText( g::hdcBuffer, screenHead.x + (width / 2 + 5), - screenHead.y + 50, + screenHead.y + 60, defuText.c_str(), config::esp_distance_color, 10 From 21aa634514fdf62e599ef21c885795146356c9e5 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Fri, 20 Oct 2023 18:10:31 -0600 Subject: [PATCH 43/48] Update update_offsets.py --- offsets/update_offsets.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/offsets/update_offsets.py b/offsets/update_offsets.py index d46c075..17f4882 100644 --- a/offsets/update_offsets.py +++ b/offsets/update_offsets.py @@ -1,6 +1,7 @@ import sys import requests import json +import re source_url = "https://github.com/a2x/cs2-dumper/raw/main/generated/offsets.json" commits_url = "https://api.github.com/repos/a2x/cs2-dumper/commits" @@ -16,8 +17,12 @@ build_number = 0 if response.status_code == 200: commit_data = response.json() if commit_data: - last_commit_message = commit_data[0]['commit']['message'] - build_number = last_commit_message.split()[-1] + for commit in commit_data: + commit_message = commit['commit']['message'] + build_match = re.search(r'\bGame Update (\d+)(?: \(\d+\))?\b', commit_message) + if build_match: + build_number = int(build_match.group(1)) + break with open(dest_path, 'r') as dest_file: dest_data = json.load(dest_file) @@ -28,13 +33,12 @@ if dest_data["build_number"] == int(build_number): dest_data["build_number"] = int(build_number) -dest_data["dwBuildNumber"] = source_data["Engine2Dll"]["dwBuildNumber"] -dest_data["dwLocalPlayer"] = source_data["ClientDll"]["dwLocalPlayerPawn"] -dest_data["dwEntityList"] = source_data["ClientDll"]["dwEntityList"] -dest_data["dwViewMatrix"] = source_data["ClientDll"]["dwViewMatrix"] -dest_data["dwPlantedC4"] = source_data["ClientDll"]["dwPlantedC4"] +dest_data["dwBuildNumber"] = source_data["Engine2Dll"]["dwBuildNumber"]["value"] +dest_data["dwLocalPlayer"] = source_data["ClientDll"]["dwLocalPlayerPawn"]["value"] +dest_data["dwEntityList"] = source_data["ClientDll"]["dwEntityList"]["value"] +dest_data["dwViewMatrix"] = source_data["ClientDll"]["dwViewMatrix"]["value"] with open(dest_path, 'w') as dest_file: json.dump(dest_data, dest_file, indent=4) -print("Offsets updated in the local file.") # We dont exit so we know that the game has been updated and that we have to commit the new offsets +print("Offsets updated in the local file.") # We dont exit so we know that the game has been updated and that we have to commit the new offsets \ No newline at end of file From 7985547cb205f46a95c1134542ae44f8cc8ebff2 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sat, 21 Oct 2023 00:54:05 -0600 Subject: [PATCH 44/48] Update hack.hpp --- memory-external/hacks/hack.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index ef73dc8..44e87ce 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -43,10 +43,6 @@ namespace hack { { const uintptr_t planted_c4 = process->read(process->read(base_client.base + updater::offsets::dwPlantedC4)); - static auto plantTime = std::chrono::high_resolution_clock::now(); - auto currentTime = std::chrono::high_resolution_clock::now(); - auto elapsedTime = std::chrono::duration(currentTime - plantTime).count(); - const float c4Timer = process->read(planted_c4 + updater::offsets::m_flTimerLength); const float c4Beep = process->read(planted_c4 + updater::offsets::m_flNextBeep); const float c4Blow = process->read(planted_c4 + updater::offsets::m_flC4Blow); From 658f7be22f5cdcc99ec2da72be76b2d25325296f Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sat, 21 Oct 2023 01:17:19 -0600 Subject: [PATCH 45/48] Update offsets.json --- offsets/offsets.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/offsets/offsets.json b/offsets/offsets.json index 6630c5a..478d568 100644 --- a/offsets/offsets.json +++ b/offsets/offsets.json @@ -1,8 +1,8 @@ { "build_number": 13964, - "dwLocalPlayer": 25053416, - "dwEntityList": 24731336, - "dwViewMatrix": 25706128, + "dwLocalPlayer": 25713704, + "dwEntityList": 24741688, + "dwViewMatrix": 25716496, "dwBuildNumber": 4748564, "dwPlantedC4": 25731664, "m_flC4Blow": 3760, From c32bad6113dd851ba892863c6dc2df80e72f2e70 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 22 Oct 2023 02:08:33 -0600 Subject: [PATCH 46/48] Update hack.hpp - Remove c4 timer --- memory-external/hacks/hack.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 44e87ce..50d1e40 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -43,12 +43,6 @@ namespace hack { { const uintptr_t planted_c4 = process->read(process->read(base_client.base + updater::offsets::dwPlantedC4)); - const float c4Timer = process->read(planted_c4 + updater::offsets::m_flTimerLength); - const float c4Beep = process->read(planted_c4 + updater::offsets::m_flNextBeep); - const float c4Blow = process->read(planted_c4 + updater::offsets::m_flC4Blow); - float remainingTime = (c4Blow - c4Beep) / c4Timer; // Constrained to 0.0-1.0 (0.0 being explosion imminent) - remainingTime = remainingTime * 100; // Multiply by 100 to constrain to 0.0-100.00 - const uintptr_t c4Node = process->read(planted_c4 + updater::offsets::m_pGameSceneNode); const Vector3 c4Origin = process->read(c4Node + updater::offsets::m_vecAbsOrigin); @@ -67,14 +61,14 @@ namespace hack { c4ScreenPos.y - (height / 2), width, height, - RGB((255 - remainingTime), (55 + remainingTime * 2), 75) + config::esp_box_color_enemy ); render::RenderText( g::hdcBuffer, c4ScreenPos.x + (width / 2 + 5), c4ScreenPos.y, - ("C4 " + std::to_string(remainingTime)).c_str(), + ("C4", config::esp_name_color, 10 ); From 201e86dbf7836adb230ebd38dfa61d7bebe080b8 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 22 Oct 2023 04:41:52 -0600 Subject: [PATCH 47/48] Update hack.hpp - Fix typo --- memory-external/hacks/hack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 50d1e40..5cbb652 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -68,7 +68,7 @@ namespace hack { g::hdcBuffer, c4ScreenPos.x + (width / 2 + 5), c4ScreenPos.y, - ("C4", + "C4", config::esp_name_color, 10 ); From 50b5e7bc7aaf2213c05ded0f3496fb6347796cc7 Mon Sep 17 00:00:00 2001 From: ifBars <114284668+ifBars@users.noreply.github.com> Date: Sun, 22 Oct 2023 04:48:29 -0600 Subject: [PATCH 48/48] Update hack.hpp to use DrawFilledBox for C4 --- memory-external/hacks/hack.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index 5cbb652..f36ced9 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -55,7 +55,7 @@ namespace hack { float height = 10 - roundedDistance; float width = height * 1.2f; - render::DrawBorderBox( + render::DrawFilledBox( g::hdcBuffer, c4ScreenPos.x - (width / 2), c4ScreenPos.y - (height / 2),