Skip to content

Commit

Permalink
Updated to work for the cs2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
Fr0go1 committed Oct 13, 2023
1 parent 39c82a8 commit 07c9d3d
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
5 changes: 3 additions & 2 deletions CS2_External/CS2_External.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -127,7 +127,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard>stdcpp17</LanguageStandard>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<FloatingPointModel>Fast</FloatingPointModel>
Expand Down Expand Up @@ -167,6 +167,7 @@
<ClInclude Include="Radar\Radar.h" />
<ClInclude Include="Render.hpp" />
<ClInclude Include="resource.h" />
<ClInclude Include="Utils\Format.hpp" />
<ClInclude Include="Utils\style.hpp" />
<ClInclude Include="TriggerBot.hpp" />
<ClInclude Include="Utils\ConfigMenu.hpp" />
Expand Down
1 change: 1 addition & 0 deletions CS2_External/CS2_External.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
<ClInclude Include="mathstuff.h" />
<ClInclude Include="font\fontArray.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Utils\Format.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="OS-ImGui\imgui\imgui.cpp">
Expand Down
3 changes: 2 additions & 1 deletion CS2_External/Cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ void Cheats::Menu()
ImGui::ColorEdit4("##CrossHairColor", reinterpret_cast<float*>(&MenuConfig::CrossHairColor), ImGuiColorEditFlags_NoInputs);
float CrossHairSizeMin = 1, CrossHairSizeMax = 200;
Gui.SliderScalarEx1("CrossHairSize", ImGuiDataType_Float, &MenuConfig::CrossHairSize, &CrossHairSizeMin, &CrossHairSizeMax, "%.1f", ImGuiSliderFlags_None);

}
else if (tabb == 1) {
//aimbot
Expand Down Expand Up @@ -398,7 +399,7 @@ void Cheats::Run()
HealthBarPos = { Rect.x + Rect.z / 2 - 70 / 2,Rect.y - 13 };
HealthBarSize = { 70,8 };
}
Render::DrawHealthBar(EntityAddress, 100, Entity.Controller.Health, HealthBarPos, HealthBarSize, MenuConfig::HealthBarType);
Render::DrawHealthBar(EntityAddress, 100, Entity.Pawn.Health, HealthBarPos, HealthBarSize, MenuConfig::HealthBarType);
}

// Draw weaponName
Expand Down
2 changes: 1 addition & 1 deletion CS2_External/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ bool PlayerPawn::GetFFlags()

bool CEntity::IsAlive()
{
return this->Controller.AliveStatus == 1 && this->Controller.Health > 0;
return this->Controller.AliveStatus == 1 && this->Pawn.Health > 0;
}

bool CEntity::IsInScreen()
Expand Down
10 changes: 5 additions & 5 deletions CS2_External/Offsets.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ namespace Offset

struct
{
DWORD Health = 0x808;
DWORD Health = 0x32C;
DWORD TeamID = 0x3BF;
DWORD IsAlive = 0x804;
DWORD PlayerPawn = 0x7FC;
DWORD IsAlive = 0x7C4;
DWORD PlayerPawn = 0x7BC;
DWORD iszPlayerName = 0x610;
}Entity;

struct
{
DWORD Pos = 0xCD8;
DWORD Pos = 0x1214;
DWORD MaxHealth = 0x328;
DWORD CurrentHealth = 0x32C;
DWORD GameSceneNode = 0x310;
Expand All @@ -36,7 +36,7 @@ namespace Offset
DWORD iIDEntIndex = 0x152C;
DWORD iTeamNum = 0x3BF;
DWORD CameraServices = 0x10E0;
DWORD iFov = 0x214;
DWORD iFov = 0x210;
DWORD fFlags = 0x3C8;
DWORD bSpottedByMask = 0x1620 + 0xC; // entitySpottedState + bSpottedByMask
}Pawn;
Expand Down
16 changes: 16 additions & 0 deletions CS2_External/Utils/Format.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <string>

template <typename... Args>
inline std::string Format(const char* pFormat, Args...args)
{
int Length = std::snprintf(nullptr, 0, pFormat, args...);
if (Length <= 0)
return "";
char* Str = new char[Length + 1];
std::string Result;
std::snprintf(Str, Length + 1, pFormat, args...);
Result = std::string(Str);
delete[] Str;
return Result;
}
18 changes: 9 additions & 9 deletions CS2_External/main.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "Offsets.h"
#include "Cheats.h"
#include "Utils/Format.hpp"
#include <iostream>
#include <iomanip>
#include <format>

int main()
{
Expand All @@ -25,16 +25,16 @@ int main()
goto END;
}

std::cout << std::format("[Pid]:{}\n", ProcessMgr.ProcessID);
std::cout << std::format("[Client]:{:X}\n", gGame.GetClientDLLAddress());
std::cout << Format("[Game] Pid:%d\n", ProcessMgr.ProcessID);
std::cout << Format("[Game] Client:%llX\n", gGame.GetClientDLLAddress());

std::cout << "Offset:" << std::endl;
std::cout << std::format("[EntityList]:{:X}\n", Offset::EntityList);
std::cout << std::format("[Matrix]:{:X}\n", Offset::Matrix);
std::cout << std::format("[LocalPlayerController]:{:X}\n", Offset::LocalPlayerController);
std::cout << std::format("[ViewAngles]:{:X}\n", Offset::ViewAngle);
std::cout << std::format("[LocalPlayerPawn]:{:X}\n", Offset::LocalPlayerPawn);
std::cout << std::format("[ForceJump]:{:X}\n", Offset::ForceJump);
std::cout << Format("--EntityList:%llX\n", Offset::EntityList);
std::cout << Format("--Matrix:%llX\n", Offset::Matrix);
std::cout << Format("--LocalPlayerController:%llX\n", Offset::LocalPlayerController);
std::cout << Format("--ViewAngles:%llX\n", Offset::ViewAngle);
std::cout << Format("--LocalPlayerPawn:%llX\n", Offset::LocalPlayerPawn);
std::cout << Format("--ForceJump:%llX\n", Offset::ForceJump);

std::cout << "Runing..." << std::endl;

Expand Down

0 comments on commit 07c9d3d

Please sign in to comment.