Skip to content

Commit c27af9d

Browse files
authored
Merge pull request #104 from ByteCorum/WIP
Portable executable, Huge Bugfix
2 parents 54618bc + aa67b8e commit c27af9d

32 files changed

+167
-8293
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -405,3 +405,5 @@ FodyWeavers.xsd
405405
DragonBurn/imgui.ini
406406
DragonBurn/settings.yml
407407
DragonBurn/prefs.ini
408+
DragonBurn/Libs/zlib/*
409+
DragonBurn/Libs/curl/*

CMakeLists.txt

+1-5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ add_executable(DragonBurn
6464
DragonBurn/Features/Radar.cpp
6565
DragonBurn/Features/Radar.h
6666
DragonBurn/DragonBurn/Features/RCS.h
67+
DragonBurn/DragonBurn/Features/RCS.cpp
6768
DragonBurn/Features/SpectatorList.h
6869
DragonBurn/Features/TriggerBot.cpp
6970
DragonBurn/Features/TriggerBot.h
@@ -113,11 +114,6 @@ add_executable(DragonBurn
113114
DragonBurn/Resources/WeaponIcon.h
114115
)
115116

116-
# Linking with Curl
117-
find_package(CURL REQUIRED)
118-
target_link_libraries(DragonBurn ${CURL_LIBRARIES})
119-
include_directories(${CURL_INCLUDE_DIRS})
120-
121117
# Include OS-ImGui headers
122118
include_directories(${OS-ImGui_INCLUDE_DIRS})
123119

DragonBurn/AssemblyInfo.rc

0 Bytes
Binary file not shown.

DragonBurn/Config/ConfigSaver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace MyConfigSaver
2323
json ConfigData;
2424

2525
ConfigData["0"]["Name"] = "DragonBurn";
26-
ConfigData["0"]["Version"] = "1.0.3.0";
26+
ConfigData["0"]["Version"] = "1.0.4.3";
2727
ConfigData["0"]["Author"] = author;
2828

2929

DragonBurn/Core/Cheats.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int PreviousTotalHits = 0;
3333
// }
3434
//}
3535

36-
void RenderCrossHair(ImDrawList*);
36+
void RenderCrossHair(ImDrawList*, const CEntity&);
3737

3838
void RadarSetting(Base_Radar&);
3939

@@ -243,7 +243,7 @@ void Visual(CEntity LocalEntity)
243243
// CrossHair
244244
TriggerBot::TargetCheck(LocalEntity);
245245
Misc::AirCheck(LocalEntity);
246-
RenderCrossHair(ImGui::GetBackgroundDrawList());
246+
RenderCrossHair(ImGui::GetBackgroundDrawList(), LocalEntity);
247247
}
248248

249249
void Radar(Base_Radar Radar, CEntity LocalEntity)
@@ -331,9 +331,9 @@ void RadarSetting(Base_Radar& Radar)
331331
Radar.Opened = true;
332332
}
333333

334-
void RenderCrossHair(ImDrawList* drawList)
334+
void RenderCrossHair(ImDrawList* drawList, const CEntity& LocalEntity)
335335
{
336-
if (!CrosshairsCFG::ShowCrossHair)
336+
if (!CrosshairsCFG::ShowCrossHair || LocalEntity.Controller.TeamID == 0)
337337
return;
338338

339339
if (CrosshairsCFG::isAim && MenuConfig::TargetingCrosshairs)

DragonBurn/DragonBurn.vcxproj

+9-8
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@
9090
<OutDir>$(SolutionDir)\built\</OutDir>
9191
<IntDir>built\</IntDir>
9292
<RunCodeAnalysis>false</RunCodeAnalysis>
93-
<IncludePath>Libs\json;Libs\zlib\include;Libs\curl\include</IncludePath>
93+
<IncludePath>Libs\json</IncludePath>
9494
<ExternalIncludePath>$(ExternalIncludePath)</ExternalIncludePath>
9595
<TargetName>DragonBurn</TargetName>
96-
<LibraryPath>Libs\zlib\lib;Libs\curl\lib;$(LibraryPath)</LibraryPath>
96+
<LibraryPath>$(LibraryPath)</LibraryPath>
9797
</PropertyGroup>
9898
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
9999
<OutDir>$(SolutionDir)\built\</OutDir>
100100
<IntDir>built\</IntDir>
101101
<RunCodeAnalysis>false</RunCodeAnalysis>
102-
<IncludePath>Libs\json;Libs\zlib\include;Libs\curl\include</IncludePath>
102+
<IncludePath>Libs\json</IncludePath>
103103
<ExternalIncludePath>$(ExternalIncludePath)</ExternalIncludePath>
104104
<TargetName>DragonBurn</TargetName>
105-
<LibraryPath>Libs\zlib\lib;Libs\curl\lib;$(LibraryPath)</LibraryPath>
105+
<LibraryPath>$(LibraryPath)</LibraryPath>
106106
</PropertyGroup>
107107
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
108108
<ClCompile>
@@ -138,14 +138,14 @@
138138
<ClCompile>
139139
<WarningLevel>Level3</WarningLevel>
140140
<SDLCheck>false</SDLCheck>
141-
<PreprocessorDefinitions>CURL_STATICLIB;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
141+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
142142
<ConformanceMode>true</ConformanceMode>
143143
<LanguageStandard>stdcpp17</LanguageStandard>
144144
</ClCompile>
145145
<Link>
146146
<SubSystem>Console</SubSystem>
147147
<GenerateDebugInformation>true</GenerateDebugInformation>
148-
<AdditionalDependencies>libcurl.lib;Ws2_32.lib;Crypt32.lib;Wldap32.lib;Normaliz.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
148+
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
149149
</Link>
150150
</ItemDefinitionGroup>
151151
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -154,7 +154,7 @@
154154
<FunctionLevelLinking>true</FunctionLevelLinking>
155155
<IntrinsicFunctions>true</IntrinsicFunctions>
156156
<SDLCheck>false</SDLCheck>
157-
<PreprocessorDefinitions>CURL_STATICLIB;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
157+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
158158
<ConformanceMode>true</ConformanceMode>
159159
<LanguageStandard>stdcpp17</LanguageStandard>
160160
</ClCompile>
@@ -163,7 +163,7 @@
163163
<EnableCOMDATFolding>true</EnableCOMDATFolding>
164164
<OptimizeReferences>true</OptimizeReferences>
165165
<GenerateDebugInformation>true</GenerateDebugInformation>
166-
<AdditionalDependencies>libcurl.lib;Ws2_32.lib;Crypt32.lib;Wldap32.lib;Normaliz.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
166+
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
167167
</Link>
168168
</ItemDefinitionGroup>
169169
<ItemGroup>
@@ -229,6 +229,7 @@
229229
<ClCompile Include="Features\Aimbot.cpp" />
230230
<ClCompile Include="Features\Misc.cpp" />
231231
<ClCompile Include="Features\Radar.cpp" />
232+
<ClCompile Include="Features\RCS.cpp" />
232233
<ClCompile Include="Features\TriggerBot.cpp" />
233234
<ClCompile Include="Game\Bone.cpp" />
234235
<ClCompile Include="Game\Entity.cpp" />

DragonBurn/DragonBurn.vcxproj.filters

+3
Original file line numberDiff line numberDiff line change
@@ -265,5 +265,8 @@
265265
<ClCompile Include="Offsets\Offsets.cpp">
266266
<Filter>Offsets</Filter>
267267
</ClCompile>
268+
<ClCompile Include="Features\RCS.cpp">
269+
<Filter>Features\Aim</Filter>
270+
</ClCompile>
268271
</ItemGroup>
269272
</Project>

DragonBurn/Features/BombTimer.h

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ namespace bmb
3535

3636
return site;
3737
}
38+
else
39+
return 0;
3840

3941
}
4042

DragonBurn/Features/RCS.cpp

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#include "RCS.h"
2+
3+
void RCS::UpdateAngles(const CEntity& Local, Vec2& Angles)
4+
{
5+
auto oldPunch = Vec2{ };
6+
auto shotsFired = Local.Pawn.ShotsFired;
7+
8+
int ScreenCenterX = Gui.Window.Size.x / 2;
9+
int ScreenCenterY = Gui.Window.Size.y / 2;
10+
11+
if (shotsFired)
12+
{
13+
uintptr_t clientState;
14+
auto viewAngles = Local.Pawn.ViewAngle;
15+
auto aimPunch = Local.Pawn.AimPunchAngle;
16+
17+
auto newAngles = Vec2
18+
{
19+
viewAngles.x + oldPunch.x - aimPunch.x * 2.f,
20+
viewAngles.y + oldPunch.y - aimPunch.y * 2.f,
21+
};
22+
23+
if (newAngles.x > 89.f)
24+
newAngles.x = 89.f;
25+
26+
if (newAngles.x < -89.f)
27+
newAngles.x = -89.f;
28+
29+
while (newAngles.y > 180.f)
30+
newAngles.y -= 360.f;
31+
32+
while (newAngles.y < -180.f)
33+
newAngles.y += 360.f;
34+
35+
newAngles.x += ScreenCenterX;
36+
newAngles.y += ScreenCenterY;
37+
Angles = newAngles;//
38+
oldPunch = aimPunch;
39+
}
40+
else
41+
{
42+
oldPunch.x = oldPunch.y = 0.f;
43+
}
44+
45+
//if (Local.Pawn.ShotsFired > RCSBullet)
46+
//{
47+
Vec2 PunchAngle;
48+
if (Local.Pawn.AimPunchCache.Count <= 0 && Local.Pawn.AimPunchCache.Count > 0xFFFF)
49+
return;
50+
if (!ProcessMgr.ReadMemory<Vec2>(Local.Pawn.AimPunchCache.Data + (Local.Pawn.AimPunchCache.Count - 1) * sizeof(Vec3), PunchAngle))
51+
return;
52+
53+
Angles.x = PunchAngle.x;
54+
Angles.y = PunchAngle.y;
55+
//}
56+
}
57+
58+
void RCS::RecoilControl(CEntity LocalPlayer)
59+
{
60+
if (!MenuConfig::RCS)
61+
return;
62+
static Vec2 OldPunch;
63+
if (LocalPlayer.Pawn.ShotsFired > RCSBullet && AimControl::HasTarget)
64+
{
65+
Vec2 viewAngles = LocalPlayer.Pawn.ViewAngle;
66+
Vec2 delta = viewAngles - (viewAngles + (OldPunch - (LocalPlayer.Pawn.AimPunchAngle * 2.f)));
67+
68+
int MouseX = (int)(delta.y / (LocalPlayer.Client.Sensitivity * 0.011f) * RCSScale.x);
69+
int MouseY = (int)(delta.x / (LocalPlayer.Client.Sensitivity * 0.011f) * RCSScale.y);
70+
71+
if ((GetAsyncKeyState(VK_LBUTTON) & 0x8000))
72+
{
73+
mouse_event(MOUSEEVENTF_MOVE, MouseX, -MouseY, 0, 0);
74+
}
75+
76+
OldPunch = LocalPlayer.Pawn.AimPunchAngle * 2.0f;
77+
}
78+
else
79+
{
80+
OldPunch = Vec2{ 0,0 };
81+
}
82+
}

DragonBurn/Features/RCS.h

+3-82
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,11 @@
11
#pragma once
2-
#include <math.h>
3-
#include "..\Game\Entity.h"
4-
#include "..\Game\View.hpp"
5-
#include "..\Config\MenuConfig.hpp"
2+
#include "Aimbot.h"
63

74
namespace RCS
85
{
96
inline int RCSBullet = 1;
107
inline Vec2 RCSScale = { 1.f,1.f };
118

12-
inline void UpdateAngles(const CEntity& Local, Vec2& Angles)
13-
{
14-
auto oldPunch = Vec2{ };
15-
auto shotsFired = Local.Pawn.ShotsFired;
16-
17-
int ScreenCenterX = Gui.Window.Size.x / 2;
18-
int ScreenCenterY = Gui.Window.Size.y / 2;
19-
20-
if (shotsFired)
21-
{
22-
uintptr_t clientState;
23-
auto viewAngles = Local.Pawn.ViewAngle;
24-
auto aimPunch = Local.Pawn.AimPunchAngle;
25-
26-
auto newAngles = Vec2
27-
{
28-
viewAngles.x + oldPunch.x - aimPunch.x * 2.f,
29-
viewAngles.y + oldPunch.y - aimPunch.y * 2.f,
30-
};
31-
32-
if (newAngles.x > 89.f)
33-
newAngles.x = 89.f;
34-
35-
if (newAngles.x < -89.f)
36-
newAngles.x = -89.f;
37-
38-
while (newAngles.y > 180.f)
39-
newAngles.y -= 360.f;
40-
41-
while (newAngles.y < -180.f)
42-
newAngles.y += 360.f;
43-
44-
newAngles.x += ScreenCenterX;
45-
newAngles.y += ScreenCenterY;
46-
Angles = newAngles;
47-
oldPunch = aimPunch;
48-
}
49-
else
50-
{
51-
oldPunch.x = oldPunch.y = 0.f;
52-
}
53-
54-
if (true/*Local.Pawn.ShotsFired > RCSBullet*/)
55-
{
56-
Vec2 PunchAngle;
57-
if (Local.Pawn.AimPunchCache.Count <= 0 && Local.Pawn.AimPunchCache.Count > 0xFFFF)
58-
return;
59-
if (!ProcessMgr.ReadMemory<Vec2>(Local.Pawn.AimPunchCache.Data + (Local.Pawn.AimPunchCache.Count - 1) * sizeof(Vec3), PunchAngle))
60-
return;
61-
62-
Angles.x = PunchAngle.x;
63-
Angles.y = PunchAngle.y;
64-
}
65-
}
66-
67-
inline void RecoilControl(CEntity LocalPlayer)
68-
{
69-
if (!MenuConfig::RCS)
70-
return;
71-
static Vec2 OldPunch;
72-
if (LocalPlayer.Pawn.ShotsFired > RCSBullet)
73-
{
74-
Vec2 viewAngles = LocalPlayer.Pawn.ViewAngle;
75-
Vec2 delta = viewAngles - (viewAngles + (OldPunch - (LocalPlayer.Pawn.AimPunchAngle * 2.f)));
76-
77-
int MouseX = (int)(delta.y / (LocalPlayer.Client.Sensitivity * 0.011f) * RCSScale.x);
78-
int MouseY = (int)(delta.x / (LocalPlayer.Client.Sensitivity * 0.011f) * RCSScale.y);
79-
80-
if ((GetAsyncKeyState(VK_LBUTTON) & 0x8000))
81-
mouse_event(MOUSEEVENTF_MOVE, MouseX, -MouseY, 0, 0);
82-
83-
OldPunch = LocalPlayer.Pawn.AimPunchAngle * 2.0f;
84-
}
85-
else
86-
{
87-
OldPunch = Vec2{ 0,0 };
88-
}
89-
}
9+
void UpdateAngles(const CEntity&, Vec2&);
10+
void RecoilControl(CEntity);
9011
}

0 commit comments

Comments
 (0)