diff --git a/DragonBurn/Core/Config.h b/DragonBurn/Core/Config.h index e16991e..c40e435 100644 --- a/DragonBurn/Core/Config.h +++ b/DragonBurn/Core/Config.h @@ -5,12 +5,12 @@ 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 = ""; inline std::string docPath = ""; - inline int RenderFPS = 100000.0f; + inline int RenderFPS = 1000000.0f; inline int RenderDistance = 1000; 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) { diff --git a/DragonBurn/Core/Init.h b/DragonBurn/Core/Init.h index 82eb743..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() { @@ -91,12 +91,10 @@ namespace Init static int CheckCS2Version() { - DWORD pid = MemoryMgr::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) { 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..e229a51 100644 --- a/DragonBurn/Core/MemoryMgr.h +++ b/DragonBurn/Core/MemoryMgr.h @@ -1,11 +1,11 @@ #pragma once #include #include -#include #include #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 +20,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 +45,6 @@ class MemoryMgr nullptr, nullptr); - //std::cout << result << " " << bytesReturned << " " << size << " " << readPack.Buffer << '\n'; return result == TRUE ; // && bytesReturned == size } return false; @@ -100,15 +101,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/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; diff --git a/DragonBurn/Resources/Resource.rc b/DragonBurn/Resources/Resource.rc index 615dbf3..d9bdb9d 100644 Binary files a/DragonBurn/Resources/Resource.rc and b/DragonBurn/Resources/Resource.rc differ diff --git a/DragonBurn/main.cpp b/DragonBurn/main.cpp index 47ec68c..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(______ ______ | _ \ | ___ \ @@ -118,7 +119,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 +165,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"); diff --git a/README.md b/README.md index 0f2ff76..4ffbf15 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ - +