From deec9b49458458c5578a45d830ca3b678ad81d49 Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:45:49 +0300 Subject: [PATCH 1/8] `GetProcessID` moved to kernel --- DragonBurn/Core/Init.h | 2 +- DragonBurn/Core/MemoryMgr.cpp | 102 +++++++++++----------------------- DragonBurn/Core/MemoryMgr.h | 17 ++++-- DragonBurn/main.cpp | 4 +- 4 files changed, 45 insertions(+), 80 deletions(-) diff --git a/DragonBurn/Core/Init.h b/DragonBurn/Core/Init.h index 82eb743..3e8263e 100644 --- a/DragonBurn/Core/Init.h +++ b/DragonBurn/Core/Init.h @@ -91,7 +91,7 @@ namespace Init static int CheckCS2Version() { - DWORD pid = MemoryMgr::GetProcessID(L"cs2.exe"); + DWORD pid = memoryManager.GetProcessID(L"cs2.exe"); long curVer; const std::string cloudVersionUrl = "https://raw.githubusercontent.com/ByteCorum/DragonBurn/data/cs2-version"; long cloudVersion; diff --git a/DragonBurn/Core/MemoryMgr.cpp b/DragonBurn/Core/MemoryMgr.cpp index 142d607..2a92a13 100644 --- a/DragonBurn/Core/MemoryMgr.cpp +++ b/DragonBurn/Core/MemoryMgr.cpp @@ -42,24 +42,27 @@ bool MemoryMgr::Attach(const DWORD pid) return true; } -DWORD64 MemoryMgr::TraceAddress(DWORD64 baseAddress, std::vector offsets) +DWORD MemoryMgr::GetProcessID(const wchar_t* processName) { - if (kernelDriver != nullptr && ProcessID != 0) + if (kernelDriver != nullptr) { - DWORD64 address = 0; + PID_PACK PidPack; + RtlZeroMemory(PidPack.name, 1024); + wcsncpy(PidPack.name, processName, 1024); - if (offsets.size() == 0) - return baseAddress; + BOOL result = DeviceIoControl(kernelDriver, + IOCTL_GET_PID, + &PidPack, + sizeof(PidPack), + &PidPack, + sizeof(PidPack), + nullptr, + nullptr); - if (!ReadMemory(baseAddress, address)) + if (result == TRUE) + return PidPack.pid; + else return 0; - - for (int i = 0; i < offsets.size() - 1; i++) - { - if (!ReadMemory(address + offsets[i], address)) - return 0; - } - return address == 0 ? 0 : address + offsets[offsets.size() - 1]; } else return 0; @@ -94,68 +97,25 @@ DWORD64 MemoryMgr::GetModuleBase(const wchar_t* moduleName) return 0; } -DWORD MemoryMgr::GetProcessID(const wchar_t* processName) +DWORD64 MemoryMgr::TraceAddress(DWORD64 baseAddress, std::vector offsets) { - DWORD processId = 0; - HANDLE snapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); - - if (snapShot == INVALID_HANDLE_VALUE) - return processId; + if (kernelDriver != nullptr && ProcessID != 0) + { + DWORD64 address = 0; - PROCESSENTRY32W entry = {}; - entry.dwSize = sizeof(decltype(entry)); + if (offsets.size() == 0) + return baseAddress; - if (Process32FirstW(snapShot, &entry) == TRUE) // Check if the first handle is the one we want - { - if (_wcsicmp(processName, entry.szExeFile) == 0) - processId = entry.th32ProcessID; + if (!ReadMemory(baseAddress, address)) + return 0; - else + for (int i = 0; i < offsets.size() - 1; i++) { - while (Process32NextW(snapShot, &entry) == TRUE) - { - if (_wcsicmp(processName, entry.szExeFile) == 0) - { - processId = entry.th32ProcessID; - break; - } - } + if (!ReadMemory(address + offsets[i], address)) + return 0; } + return address == 0 ? 0 : address + offsets[offsets.size() - 1]; } - - CloseHandle(snapShot); - return processId; -} - -//DWORD64 MemoryMgr::GetModuleBase(const DWORD pid, const wchar_t* moduleName) { -// DWORD64 moduleBase = 0; -// -// // Snap-shot of process' modules (dlls). -// HANDLE snapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, pid); -// if (snapShot == INVALID_HANDLE_VALUE) -// return moduleBase; -// -// MODULEENTRY32W entry = {}; -// entry.dwSize = sizeof(decltype(entry)); -// -// if (Module32FirstW(snapShot, &entry) == TRUE) -// { -// if (wcsstr(moduleName, entry.szModule) != nullptr) -// moduleBase = reinterpret_cast(entry.modBaseAddr); -// -// else -// { -// while (Module32NextW(snapShot, &entry) == TRUE) -// { -// if (wcsstr(moduleName, entry.szModule) != nullptr) -// { -// moduleBase = reinterpret_cast(entry.modBaseAddr); -// break; -// } -// } -// } -// } -// -// CloseHandle(snapShot); -// return moduleBase; -//} + else + return 0; +} \ No newline at end of file diff --git a/DragonBurn/Core/MemoryMgr.h b/DragonBurn/Core/MemoryMgr.h index 7e89021..46c3b58 100644 --- a/DragonBurn/Core/MemoryMgr.h +++ b/DragonBurn/Core/MemoryMgr.h @@ -6,6 +6,7 @@ #include #define DRAGON_DEVICE 0x8000 +#define IOCTL_GET_PID CTL_CODE(DRAGON_DEVICE, 0x4452, METHOD_NEITHER, FILE_ANY_ACCESS) #define IOCTL_GET_MODULE_BASE CTL_CODE(DRAGON_DEVICE, 0x4462, METHOD_NEITHER, FILE_ANY_ACCESS) #define IOCTL_READ_PROCESS_MEMORY CTL_CODE(DRAGON_DEVICE, 0x4472, METHOD_NEITHER, FILE_ANY_ACCESS) #define IOCTL_WRITE_PROCESS_MEMORY CTL_CODE(DRAGON_DEVICE, 0x4482, METHOD_NEITHER, FILE_ANY_ACCESS) @@ -20,9 +21,11 @@ class MemoryMgr bool ConnectDriver(const LPCWSTR); bool DisconnectDriver(); - bool Attach(const DWORD); + DWORD64 GetModuleBase(const wchar_t*); + DWORD GetProcessID(const wchar_t*); + template bool ReadMemory(DWORD64 address, ReadType& value, SIZE_T size = sizeof(ReadType)) { @@ -43,7 +46,6 @@ class MemoryMgr nullptr, nullptr); - //std::cout << result << " " << bytesReturned << " " << size << " " << readPack.Buffer << '\n'; return result == TRUE ; // && bytesReturned == size } return false; @@ -100,15 +102,18 @@ class MemoryMgr //} DWORD64 TraceAddress(DWORD64, std::vector); - DWORD64 GetModuleBase(const wchar_t*); - - static DWORD GetProcessID(const wchar_t*); - //static DWORD64 GetModuleBase(const DWORD, const wchar_t*); private: DWORD ProcessID; HANDLE kernelDriver; + // Structure for getting pid by name + typedef struct _PID_PACK + { + UINT32 pid; + WCHAR name[1024]; + } PID_PACK, * P_PID_PACK; + // Structure for getting module address base typedef struct _MODULE_PACK { UINT32 pid; diff --git a/DragonBurn/main.cpp b/DragonBurn/main.cpp index 47ec68c..a67b347 100644 --- a/DragonBurn/main.cpp +++ b/DragonBurn/main.cpp @@ -118,7 +118,7 @@ void Cheat() std::cout << '\n'; bool preStart = false; - while (MemoryMgr::GetProcessID(L"cs2.exe") == 0) + while (memoryManager.GetProcessID(L"cs2.exe") == 0) { Log::PreviousLine(); Log::Info("Waiting for CS2"); @@ -164,7 +164,7 @@ void Cheat() } #endif - if (!memoryManager.Attach(MemoryMgr::GetProcessID(L"cs2.exe"))) + if (!memoryManager.Attach(memoryManager.GetProcessID(L"cs2.exe"))) { Log::PreviousLine(); Log::Error("Failed to attach to the process"); From de6044e6d4d05d503efdda9754cd70011a242963 Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:50:11 +0300 Subject: [PATCH 2/8] removed unused GetProcessID --- DragonBurn/Core/Init.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DragonBurn/Core/Init.h b/DragonBurn/Core/Init.h index 3e8263e..14d099d 100644 --- a/DragonBurn/Core/Init.h +++ b/DragonBurn/Core/Init.h @@ -91,12 +91,10 @@ namespace Init static int CheckCS2Version() { - DWORD pid = memoryManager.GetProcessID(L"cs2.exe"); long curVer; const std::string cloudVersionUrl = "https://raw.githubusercontent.com/ByteCorum/DragonBurn/data/cs2-version"; - long cloudVersion; - std::string processPath; std::string buff; + long cloudVersion; if (!Web::Get(cloudVersionUrl, buff)) return 2; @@ -104,6 +102,9 @@ namespace Init if (cloudVersion == -1) return 3; + DWORD pid = memoryManager.GetProcessID(L"cs2.exe"); + std::string processPath; + HANDLE hProcess = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid); if (hProcess) { From a2678df43971278af082628f07949da7cfcd14ca Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:22:47 +0300 Subject: [PATCH 3/8] fixed win title --- DragonBurn/Core/Init.h | 2 +- DragonBurn/Core/MemoryMgr.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/DragonBurn/Core/Init.h b/DragonBurn/Core/Init.h index 14d099d..a9160ba 100644 --- a/DragonBurn/Core/Init.h +++ b/DragonBurn/Core/Init.h @@ -52,7 +52,7 @@ namespace Init const auto characters = TEXT("0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"); TCHAR title[length + 1]{}; - for (int j = 0; j != length; j++) + for (int j = 0; j < length; j++) { title[j] += characters[rand() % 63]; } diff --git a/DragonBurn/Core/MemoryMgr.h b/DragonBurn/Core/MemoryMgr.h index 46c3b58..e229a51 100644 --- a/DragonBurn/Core/MemoryMgr.h +++ b/DragonBurn/Core/MemoryMgr.h @@ -1,7 +1,6 @@ #pragma once #include #include -#include #include #include From 9bcf40096aad9db4e92c13c1f71dd0a222a14c95 Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:26:20 +0300 Subject: [PATCH 4/8] no point feature --- DragonBurn/Core/Init.h | 28 ++++++++++++++-------------- DragonBurn/main.cpp | 3 ++- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/DragonBurn/Core/Init.h b/DragonBurn/Core/Init.h index a9160ba..01f2b5d 100644 --- a/DragonBurn/Core/Init.h +++ b/DragonBurn/Core/Init.h @@ -45,20 +45,20 @@ namespace Init return false; } - static void RandTitle() - { - srand(time(0)); - constexpr int length = 25; - const auto characters = TEXT("0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"); - TCHAR title[length + 1]{}; - - for (int j = 0; j < length; j++) - { - title[j] += characters[rand() % 63]; - } - - SetConsoleTitle(title); - } + //static void RandTitle() + //{ + // srand(time(0)); + // constexpr int length = 25; + // const auto characters = TEXT("0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"); + // TCHAR title[length + 1]{}; + + // for (int j = 0; j < length; j++) + // { + // title[j] += characters[rand() % 63]; + // } + + // SetConsoleTitle(title); + //} static int CheckCheatVersion() { diff --git a/DragonBurn/main.cpp b/DragonBurn/main.cpp index a67b347..599a84e 100644 --- a/DragonBurn/main.cpp +++ b/DragonBurn/main.cpp @@ -23,7 +23,8 @@ int main() void Cheat() { ShowWindow(GetConsoleWindow(), SW_SHOWNORMAL); - Init::Verify::RandTitle(); + SetConsoleTitle(L"DragonBurn"); + //Init::Verify::RandTitle(); Log::Custom(R"LOGO(______ ______ | _ \ | ___ \ From 3f6b9d7baab510fc46c0d31427479b92902a63e9 Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:06:56 +0300 Subject: [PATCH 5/8] max update rate --- DragonBurn/Core/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DragonBurn/Core/Config.h b/DragonBurn/Core/Config.h index e16991e..2dbeb4d 100644 --- a/DragonBurn/Core/Config.h +++ b/DragonBurn/Core/Config.h @@ -10,7 +10,7 @@ namespace MenuConfig inline std::string path = ""; inline std::string docPath = ""; - inline int RenderFPS = 100000.0f; + inline int RenderFPS = 1000000.0f; inline int RenderDistance = 1000; From a72c6cd38a53815be3d5ba48f8ad11d21bc6a5cf Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:07:20 +0300 Subject: [PATCH 6/8] small changes --- DragonBurn/Core/GUI.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DragonBurn/Core/GUI.h b/DragonBurn/Core/GUI.h index 13e36c6..2da4227 100644 --- a/DragonBurn/Core/GUI.h +++ b/DragonBurn/Core/GUI.h @@ -349,7 +349,7 @@ namespace GUI ImGui::SeparatorText("External Radar"); float RadarPointSizeProportionMin = 0.2f, RadarPointSizeProportionMax = 2.f; - float ProportionMin = 500.f, ProportionMax = 10000.f; + float ProportionMin = 500.f, ProportionMax = 15000.f; float RadarRangeMin = 100.f, RadarRangeMax = 300.f; float AlphaMin = 0.f, AlphaMax = 1.f; PutSwitch(Text::Radar::Toggle.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &RadarCFG::ShowRadar); @@ -360,7 +360,7 @@ namespace GUI if (RadarCFG::customRadar) { PutSwitch(Text::Radar::CrossLine.c_str(), 5.f, ImGui::GetFrameHeight() * 1.7, &RadarCFG::ShowRadarCrossLine); - PutSliderFloat(Text::Radar::SizeSlider.c_str(), 5.f, &RadarCFG::RadarPointSizeProportion, &RadarPointSizeProportionMin, &RadarPointSizeProportionMax, "%1.f"); + PutSliderFloat(Text::Radar::SizeSlider.c_str(), 5.f, &RadarCFG::RadarPointSizeProportion, &RadarPointSizeProportionMin, &RadarPointSizeProportionMax, "%.1f"); PutSliderFloat(Text::Radar::ProportionSlider.c_str(), 5.f, &RadarCFG::Proportion, &ProportionMin, &ProportionMax, "%.1f"); PutSliderFloat(Text::Radar::RangeSlider.c_str(), 5.f, &RadarCFG::RadarRange, &RadarRangeMin, &RadarRangeMax, "%.1f"); PutSliderFloat(Text::Radar::AlphaSlider.c_str(), 5.f, &RadarCFG::RadarBgAlpha, &AlphaMin, &AlphaMax, "%.1f"); @@ -406,9 +406,9 @@ namespace GUI ImGui::SetCursorPos(ImVec2(15.f, 24.f)); ImGui::SeparatorText("Aimbot"); - float FovMin = 0.f, FovMax = 25.f, MinFovMax = 1.f; + float FovMin = 0.f, FovMax = 30.f, MinFovMax = 1.f; int BulletMin = 0, BulletMax = 5; - float SmoothMin = 1.f, SmoothMax = 10.f; + float SmoothMin = 1.f, SmoothMax = 15.f; PutSwitch(Text::Aimbot::Enable.c_str(), 10.f, ImGui::GetFrameHeight() * 1.7, &LegitBotConfig::AimBot); if (LegitBotConfig::AimBot) { From c052b5b5aafad1016f16ef87d7a69c12ee338744 Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:07:39 +0300 Subject: [PATCH 7/8] fixed `CheckScopeWeapon` --- DragonBurn/DragonBurn.vcxproj.filters | 18 +++++++++--------- DragonBurn/Features/TriggerBot.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/DragonBurn/DragonBurn.vcxproj.filters b/DragonBurn/DragonBurn.vcxproj.filters index 4e3fc7f..d0f2bcb 100644 --- a/DragonBurn/DragonBurn.vcxproj.filters +++ b/DragonBurn/DragonBurn.vcxproj.filters @@ -25,9 +25,6 @@ {b0c7adeb-2fdd-4355-93c2-b03f5946ffec} - - {bec5d160-9097-41fe-b2e1-d771a6544092} - {d6ce1762-ee50-44d7-938a-7de7d8911330} @@ -40,6 +37,9 @@ {d41606d6-9efb-4793-9976-ae2deca558e7} + + {bec5d160-9097-41fe-b2e1-d771a6544092} + @@ -127,10 +127,10 @@ Features\Visual - Features\Aim + Features\Legit - Features\Aim + Features\Legit Helpers @@ -169,7 +169,7 @@ Offsets - Features\Aim + Features\Legit Helpers @@ -240,7 +240,7 @@ Features\Visual - Features\Aim + Features\Legit Helpers @@ -258,13 +258,13 @@ Config - Features\Aim + Features\Legit Offsets - Features\Aim + Features\Legit Core diff --git a/DragonBurn/Features/TriggerBot.cpp b/DragonBurn/Features/TriggerBot.cpp index caf9db4..88b5dfd 100644 --- a/DragonBurn/Features/TriggerBot.cpp +++ b/DragonBurn/Features/TriggerBot.cpp @@ -99,7 +99,7 @@ bool TriggerBot::CheckScopeWeapon(const CEntity& LocalEntity) return false; std::string WeaponName = CEntity::GetWeaponName(weaponIndex); - if (WeaponName == "aug" || WeaponName == "awp" || WeaponName == "g3Sg1" || WeaponName == "sg556" || WeaponName == "ssg08" || WeaponName == "scar20") + if (WeaponName == "awp" || WeaponName == "g3Sg1" || WeaponName == "ssg08" || WeaponName == "scar20") return true; else return false; From ac65ed0be79b617da98e4759895dadf6fdebc70f Mon Sep 17 00:00:00 2001 From: ByteCorum <164874887+ByteCorum@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:17:58 +0300 Subject: [PATCH 8/8] new ver --- DragonBurn/Core/Config.h | 2 +- DragonBurn/Resources/Resource.rc | Bin 6584 -> 6584 bytes README.md | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DragonBurn/Core/Config.h b/DragonBurn/Core/Config.h index 2dbeb4d..c40e435 100644 --- a/DragonBurn/Core/Config.h +++ b/DragonBurn/Core/Config.h @@ -5,7 +5,7 @@ namespace MenuConfig { inline std::string name = "DragonBurn"; - inline std::string version = "2.0.1.5"; + inline std::string version = "2.0.2.5"; inline std::string author = "ByteCorum"; inline std::string path = ""; diff --git a/DragonBurn/Resources/Resource.rc b/DragonBurn/Resources/Resource.rc index 615dbf3cd1e39c16459348a1bbb0caff386f02d8..d9bdb9d1c249bedf088f53c45894fdac069dfb00 100644 GIT binary patch delta 54 zcmdmCyu)~d123b|WJlgqMx)Kkc{eh%8ZqcGm`?WR7oYrqUu<)i;44Oi(B=uk8f*Z) CY7aC3 delta 54 zcmdmCyu)~d123cDWJlgqM#Ig^c{eh%8ZziHm`?WR7oYrqUu<)i;44Oi(B=uk8f*Z( C - +