add: valve-bsp-parser, vis check

This commit is contained in:
2024-01-04 16:38:29 +01:00
parent ca685fe0ca
commit 04615c41b0
7 changed files with 75 additions and 16 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.vs
x64/
ImGuiExternal/x64
ImGuiExternal/imgui.ini
ImGuiExternal/imgui.ini
build

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "ImGuiExternal/valve-bsp-parser"]
path = ImGuiExternal/valve-bsp-parser
url = https://github.com/ReactiioN1337/valve-bsp-parser

View File

@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30717.126
# Visual Studio Version 17
VisualStudioVersion = 17.1.32407.343
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImGuiExternal", "ImGuiExternal\ImGuiExternal.vcxproj", "{7D1BDD05-83F1-4D14-90B2-FFF94447B2F0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "valve-bsp-parser", "ImGuiExternal\valve-bsp-parser\valve-bsp-parser.vcxproj", "{39750587-C53C-44E3-8542-80112A0E8AB3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -21,6 +23,14 @@ Global
{7D1BDD05-83F1-4D14-90B2-FFF94447B2F0}.Release|x64.Build.0 = Release|x64
{7D1BDD05-83F1-4D14-90B2-FFF94447B2F0}.Release|x86.ActiveCfg = Release|Win32
{7D1BDD05-83F1-4D14-90B2-FFF94447B2F0}.Release|x86.Build.0 = Release|Win32
{39750587-C53C-44E3-8542-80112A0E8AB3}.Debug|x64.ActiveCfg = Debug|x64
{39750587-C53C-44E3-8542-80112A0E8AB3}.Debug|x64.Build.0 = Debug|x64
{39750587-C53C-44E3-8542-80112A0E8AB3}.Debug|x86.ActiveCfg = Debug|Win32
{39750587-C53C-44E3-8542-80112A0E8AB3}.Debug|x86.Build.0 = Debug|Win32
{39750587-C53C-44E3-8542-80112A0E8AB3}.Release|x64.ActiveCfg = Release|x64
{39750587-C53C-44E3-8542-80112A0E8AB3}.Release|x64.Build.0 = Release|x64
{39750587-C53C-44E3-8542-80112A0E8AB3}.Release|x86.ActiveCfg = Release|Win32
{39750587-C53C-44E3-8542-80112A0E8AB3}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -82,13 +82,13 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)\Directories\Microsoft DirectX SDK\Include;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)\Directories\Microsoft DirectX SDK\Lib\x64;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)valve-bsp-parser\include;$(ProjectDir)\Directories\Microsoft DirectX SDK\Include;$(ProjectDir)valve-bsp-parser\thirdparty\liblzma\include;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)build\$(Configuration)-x64\;$(ProjectDir)\Directories\Microsoft DirectX SDK\Lib\x64;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)\Directories\Microsoft DirectX SDK\Include;$(IncludePath)</IncludePath>
<LibraryPath>$(ProjectDir)\Directories\Microsoft DirectX SDK\Lib\x64;$(LibraryPath)</LibraryPath>
<IncludePath>$(ProjectDir)valve-bsp-parser\include;$(ProjectDir)\Directories\Microsoft DirectX SDK\Include;$(ProjectDir)valve-bsp-parser\thirdparty\liblzma\include;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)build\$(Configuration)-x64\;$(ProjectDir)\Directories\Microsoft DirectX SDK\Lib\x64;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -134,12 +134,14 @@
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>valve-bsp-parser.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -152,6 +154,7 @@
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@@ -160,6 +163,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalOptions>/ignore:4099 %(AdditionalOptions)</AdditionalOptions>
<AdditionalDependencies>valve-bsp-parser.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

View File

@@ -14,6 +14,7 @@
#define LIFESTATE 0x93 //player
#define BONEMATRIX 0x578 //player https://youtu.be/elKUMiqitxY
#define VIEW_MATRIX 0x5B0D68 //engine
#define MAP_NAME 0x47796D //engine
class Vector3 {
public:
@@ -45,6 +46,7 @@ namespace Game {
HANDLE handle = NULL;
uintptr_t client = NULL;
uintptr_t engine = NULL;
char path[MAX_PATH];
DWORD PID = 0;
}

View File

@@ -1,3 +1,4 @@
#include <valve-bsp-parser/bsp_parser.hpp>
#include "xorstr.hpp"
#include "Functions.h"
#include "Memory.h"
@@ -16,14 +17,19 @@ bool ally_esp_health_bar = false;
bool enemy_esp_health_bar = true;
bool ally_name = false;
bool enemy_name = true;
bool enemy_esp_visible = false;
bool ally_esp_visible = false;
bool crosshair = true;
bool ImGui_Initialised = false;
bool CreateConsole = false;
bool aimbot = true;
bool show_fov = true;
float aim_fov = 10.f;
bool aim_visible = true;
float smooth = 75.f;
using namespace rn;
namespace OverlayWindow {
WNDCLASSEX WindowClass;
HWND Hwnd;
@@ -38,13 +44,13 @@ namespace DirectX9Interface {
MSG Message = { NULL };
}
void DoAimbot(Vector3 headpos, float factor, bool show_fov) {
if (factor > 16.f)
bsp_parser _bsp_parser;
void DoAimbot(Vector3 headpos, float factor, bool show_fov, bool is_visible) {
if (factor > 16.f || (!is_visible && aim_visible))
return;
float fov = (factor / ((30 - aim_fov) - factor)) * 100;
float aimX = headpos.x - Process::WindowWidth / 2;
float aimY = headpos.y - Process::WindowHeight / 2;
if (show_fov) {
RGBA White = { 255, 255, 255, 255 };
DrawCircle((int)headpos.x, (int)headpos.y, fov, &White);
@@ -69,6 +75,23 @@ void Draw() {
RGBA Cyan = { 0, 231, 255, 255 };
if (crosshair) DrawCircleFilled(Process::WindowWidth/2, Process::WindowHeight/2, 3, &Cyan);
char map_name[256];
static bool parsed_map = false;
static std::string map_name_old = "";
for (int j = 0; j < 256; j++) {
char c = RPM<char>(Game::engine + MAP_NAME + j*sizeof(char));
if (c == '\0') {
map_name[j] = '\0';
break;
}
map_name[j] = c;
}
if (std::string(map_name) != map_name_old || !parsed_map) {
parsed_map = _bsp_parser.load_map(std::string(Game::path) + std::string("cstrike\\maps"), map_name);
map_name_old = std::string(map_name);
}
if (!ally_esp && !enemy_esp && !aimbot && !show_fov) {
return;
}
@@ -80,6 +103,7 @@ void Draw() {
uintptr_t entity_list = Game::client + ENTITY_LIST;
uintptr_t localplayer = RPM<uintptr_t>(Game::client + LOCALPLAYER);
Vector3 pos = RPM<Vector3>(localplayer + XYZ);
int localplayer_team = RPM<uintptr_t>(localplayer + TEAM);
int ent_idx = 0;
@@ -110,6 +134,7 @@ void Draw() {
continue;
}
bool is_visible = _bsp_parser.is_visible(vector3{ pos.x, pos.y, pos.z + 66 }, vector3{ absOrigin.x, absOrigin.y, absOrigin.z + 66 });
//getting name
DWORD list = RPM<DWORD>(Game::client + NAME_LIST) + 0x38;
@@ -144,30 +169,35 @@ void Draw() {
if (!WorldToScreen(neckpos, w2s_neckpos)) {
continue;
}
DoAimbot(w2s_neckpos, sqrt(abs(w2s_headpos.y - w2s_neckpos.y)), show_fov);
DoAimbot(w2s_neckpos, sqrt(abs(w2s_headpos.y - w2s_neckpos.y)), show_fov, is_visible);
#ifdef _DEBUG
char ent_text[256];
sprintf(ent_text, xorstr_("%s --> %d %f %f %f"), name, health, headpos.x, headpos.y, headpos.z);
sprintf(ent_text, xorstr_("%s --> %d"), name, health);
DrawStrokeText(30, 100 + 16*ent_idx, &White, ent_text);
ent_idx++;
#endif // _DEBUG
RGBA color = { 255, 255, 255, 255 };
if ((ent_team == localplayer_team && ally_box && ally_esp) || (ent_team != localplayer_team && enemy_box && enemy_esp)) {
if ((ent_team == localplayer_team && ally_box && ally_esp && ((ally_esp_visible && is_visible) || !ally_esp_visible))
|| (ent_team != localplayer_team && enemy_box && enemy_esp && ((enemy_esp_visible && is_visible) || !enemy_esp_visible))) {
DrawEspBox2D(w2s_absOrigin, w2s_headpos, &color, 1);
}
if ((ent_team == localplayer_team && ally_name && ally_esp) || (ent_team != localplayer_team && enemy_name && enemy_esp)) {
if ((ent_team == localplayer_team && ally_name && ally_esp && ((ally_esp_visible && is_visible) || !ally_esp_visible))
|| (ent_team != localplayer_team && enemy_name && enemy_esp && ((enemy_esp_visible && is_visible) || !enemy_esp_visible))) {
DrawNameTag(w2s_absOrigin, w2s_headpos, name);
}
if ((ent_team == localplayer_team && ally_esp_health_bar && ally_esp) || (ent_team != localplayer_team && enemy_esp_health_bar && enemy_esp)) {
if ((ent_team == localplayer_team && ally_esp_health_bar && ally_esp && ((ally_esp_visible && is_visible) || !ally_esp_visible))
|| (ent_team != localplayer_team && enemy_esp_health_bar && enemy_esp && ((enemy_esp_visible && is_visible) || !enemy_esp_visible))) {
DrawHealthBar(w2s_absOrigin, w2s_headpos, health);
}
if ((ent_team == localplayer_team && ally_skeleton && ally_esp) || (ent_team != localplayer_team && enemy_skeleton && enemy_esp)) {
if ((ent_team == localplayer_team && ally_skeleton && ally_esp && ((ally_esp_visible && is_visible) || !ally_esp_visible))
|| (ent_team != localplayer_team && enemy_skeleton && enemy_esp && ((enemy_esp_visible && is_visible) || !enemy_esp_visible))) {
DrawBones(bonematrix_addr, &color, 1);
}
}
@@ -181,6 +211,8 @@ void DrawMenu() {
ImGui::Separator();
ImGui::Checkbox("Ally ESP", &ally_esp);
ImGui::SameLine();
ImGui::Checkbox("Visible only##ally", &ally_esp_visible);
ImGui::Checkbox("Box##ally", &ally_box);
ImGui::Checkbox("Skeleton##ally", &ally_skeleton);
ImGui::Checkbox("Healthbar##ally", &ally_esp_health_bar);
@@ -188,6 +220,8 @@ void DrawMenu() {
ImGui::Separator();
ImGui::Checkbox("Enemy ESP", &enemy_esp);
ImGui::SameLine();
ImGui::Checkbox("Visible only##enemy", &enemy_esp_visible);
ImGui::Checkbox("Box##enemy", &enemy_box);
ImGui::Checkbox("Skeleton##enemy", &enemy_skeleton);
ImGui::Checkbox("Healthbar##enemy", &enemy_esp_health_bar);
@@ -197,6 +231,7 @@ void DrawMenu() {
ImGui::Checkbox("Aimbot", &aimbot);
ImGui::SameLine();
ImGui::Checkbox("Show FOV", &show_fov);
ImGui::Checkbox("Visible only##aimbot", &aim_visible);
ImGui::SliderFloat("FOV", &aim_fov, 1.f, 30.f, "%1.f", 1.f);
ImGui::SliderFloat("Smoothing", &smooth, 0.f, 100.f, "%1.f", 1.f);
@@ -465,6 +500,9 @@ int main() {
}
Game::handle = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, false, Game::PID);
DWORD size = MAX_PATH;
QueryFullProcessImageNameA(Game::handle, 0, Game::path, &size);
Game::path[strlen(Game::path) - 7] = '\0';
std::string s = RandomString(10);
OverlayWindow::Name = s.c_str();