Merge pull request #40 from ifBars/main
Add player armor, weapon name, $ amount, isDefusing tag, an armor bar, and C4 ESP
This commit is contained in:
@@ -195,7 +195,32 @@ namespace updater {
|
||||
offsets::dwViewMatrix = data["dwViewMatrix"];
|
||||
if (data["dwBuildNumber"].is_number())
|
||||
offsets::dwBuildNumber = data["dwBuildNumber"];
|
||||
if (data["dwPlantedC4"].is_number())
|
||||
offsets::dwPlantedC4 = data["dwPlantedC4"];
|
||||
|
||||
if (data["m_flC4Blow"].is_number())
|
||||
offsets::m_flC4Blow = data["m_flC4Blow"];
|
||||
if (data["m_flNextBeep"].is_number())
|
||||
offsets::m_flNextBeep = data["m_flNextBeep"];
|
||||
if (data["m_flTimerLength"].is_number())
|
||||
offsets::m_flTimerLength = data["m_flTimerLength"];
|
||||
|
||||
if (data["m_pInGameMoneyServices"].is_number())
|
||||
offsets::m_pInGameMoneyServices = data["m_pInGameMoneyServices"];
|
||||
if (data["m_iAccount"].is_number())
|
||||
offsets::m_iAccount = data["m_iAccount"];
|
||||
if (data["m_vecAbsOrigin"].is_number())
|
||||
offsets::m_vecAbsOrigin = data["m_vecAbsOrigin"];
|
||||
if (data["m_pGameSceneNode"].is_number())
|
||||
offsets::m_pGameSceneNode = data["m_pGameSceneNode"];
|
||||
if (data["m_bIsDefusing"].is_number())
|
||||
offsets::m_bIsDefusing = data["m_bIsDefusing"];
|
||||
if (data["m_szName"].is_number())
|
||||
offsets::m_szName = data["m_szName"];
|
||||
if (data["m_pClippingWeapon "].is_number())
|
||||
offsets::m_pClippingWeapon = data["m_pClippingWeapon "];
|
||||
if (data["m_ArmorValue "].is_number())
|
||||
offsets::m_ArmorValue = data["m_ArmorValue "];
|
||||
if (data["m_iHealth"].is_number())
|
||||
offsets::m_iHealth = data["m_iHealth"];
|
||||
if (data["dwPlayerPawn"].is_number())
|
||||
@@ -219,7 +244,20 @@ namespace updater {
|
||||
data["dwEntityList"] = offsets::dwEntityList;
|
||||
data["dwViewMatrix"] = offsets::dwViewMatrix;
|
||||
data["dwBuildNumber"] = offsets::dwBuildNumber;
|
||||
data["dwPlantedC4"] = offsets::dwPlantedC4;
|
||||
|
||||
data["m_flNextBeep"] = offsets::m_flNextBeep;
|
||||
data["m_flC4Blow"] = offsets::m_flC4Blow;
|
||||
data["m_flTimerLength"] = offsets::m_flTimerLength;
|
||||
|
||||
data["m_pInGameMoneyServices"] = offsets::m_pInGameMoneyServices;
|
||||
data["m_iAccount"] = offsets::m_iAccount;
|
||||
data["m_vecAbsOrigin"] = offsets::m_vecAbsOrigin;
|
||||
data["m_pGameSceneNode"] = offsets::m_pGameSceneNode;
|
||||
data["m_bIsDefusing"] = offsets::m_bIsDefusing;
|
||||
data["m_szName"] = offsets::m_szName;
|
||||
data["m_pClippingWeapon"] = offsets::m_pClippingWeapon;
|
||||
data["m_ArmorValue"] = offsets::m_ArmorValue;
|
||||
data["m_iHealth"] = offsets::m_iHealth;
|
||||
data["dwPlayerPawn"] = offsets::dwPlayerPawn;
|
||||
data["dwSanitizedName"] = offsets::dwSanitizedName;
|
||||
|
||||
@@ -30,14 +30,27 @@ namespace updater {
|
||||
const inline std::string github_repo_api = "https://api.github.com/repos/IMXNOOBX/cs2-external-esp/commits";
|
||||
const inline std::string raw_updated_offets = "https://github.com/IMXNOOBX/cs2-external-esp/raw/main/offsets/offsets.json";
|
||||
|
||||
inline int build_number = 13962;
|
||||
inline int build_number = 13963;
|
||||
|
||||
namespace offsets {
|
||||
inline std::ptrdiff_t dwLocalPlayer = 0x17DE508;
|
||||
inline std::ptrdiff_t dwEntityList = 0x178FC88;
|
||||
inline std::ptrdiff_t dwViewMatrix = 0x187DAB0;
|
||||
inline std::ptrdiff_t dwLocalPlayer = 0x17E27C8;
|
||||
inline std::ptrdiff_t dwEntityList = 0x1793DC8;
|
||||
inline std::ptrdiff_t dwViewMatrix = 0x1881D70;
|
||||
inline std::ptrdiff_t dwBuildNumber = 0x487514;
|
||||
inline std::ptrdiff_t dwPlantedC4 = 0x1887FC0;
|
||||
|
||||
inline std::ptrdiff_t m_flC4Blow = 0xEB0;
|
||||
inline std::ptrdiff_t m_flNextBeep = 0xEAC;
|
||||
inline std::ptrdiff_t m_flTimerLength = 0xEB8;
|
||||
|
||||
inline std::ptrdiff_t m_pInGameMoneyServices = 0x6D0;
|
||||
inline std::ptrdiff_t m_iAccount = 0x40;
|
||||
inline std::ptrdiff_t m_vecAbsOrigin = 0xC8;
|
||||
inline std::ptrdiff_t m_pGameSceneNode = 0x310;
|
||||
inline std::ptrdiff_t m_bIsDefusing = 0x1390;
|
||||
inline std::ptrdiff_t m_szName = 0xC18;
|
||||
inline std::ptrdiff_t m_pClippingWeapon = 0x1290;
|
||||
inline std::ptrdiff_t m_ArmorValue = 0x14F0;
|
||||
inline std::ptrdiff_t m_iHealth = 0x32C;
|
||||
inline std::ptrdiff_t dwPlayerPawn = 0x7BC;
|
||||
inline std::ptrdiff_t dwSanitizedName = 0x720;
|
||||
|
||||
@@ -17,9 +17,18 @@ namespace hack {
|
||||
|
||||
const int localTeam = process->read<int>(localPlayer + updater::offsets::m_iTeamNum);
|
||||
const view_matrix_t view_matrix = process->read<view_matrix_t>(base_client.base + updater::offsets::dwViewMatrix);
|
||||
const Vector3 localOrigin = process->read<Vector3>(localPlayer + updater::offsets::m_vecOrigin);
|
||||
const uintptr_t entity_list = process->read<uintptr_t>(base_client.base + updater::offsets::dwEntityList);
|
||||
|
||||
const std::uint32_t localPlayerPawn = process->read<std::uint32_t>(localPlayer + updater::offsets::dwPlayerPawn);
|
||||
if (!localPlayerPawn)
|
||||
return;
|
||||
const uintptr_t localList_entry2 = process->read<uintptr_t>(entity_list + 0x8 * ((localPlayerPawn & 0x7FFF) >> 9) + 16);
|
||||
const uintptr_t localpCSPlayerPawn = process->read<uintptr_t>(localList_entry2 + 120 * (localPlayerPawn & 0x1FF));
|
||||
if (!localpCSPlayerPawn)
|
||||
return;
|
||||
|
||||
const Vector3 localOrigin = process->read<Vector3>(localpCSPlayerPawn + updater::offsets::m_vecOrigin);
|
||||
|
||||
int playerIndex = 0;
|
||||
uintptr_t list_entry;
|
||||
|
||||
@@ -29,6 +38,42 @@ namespace hack {
|
||||
* (This could have been done by getting a entity list count from the engine, but I'm too lazy to do that)
|
||||
**/
|
||||
while (true) {
|
||||
bool c4IsPlanted = process->read<bool>(base_client.base + updater::offsets::dwPlantedC4 - 0x8);
|
||||
if (c4IsPlanted)
|
||||
{
|
||||
const uintptr_t planted_c4 = process->read<uintptr_t>(process->read<uintptr_t>(base_client.base + updater::offsets::dwPlantedC4));
|
||||
|
||||
const uintptr_t c4Node = process->read<uintptr_t>(planted_c4 + updater::offsets::m_pGameSceneNode);
|
||||
|
||||
const Vector3 c4Origin = process->read<Vector3>(c4Node + updater::offsets::m_vecAbsOrigin);
|
||||
|
||||
const Vector3 c4ScreenPos = c4Origin.world_to_screen(view_matrix);
|
||||
|
||||
float distance = localOrigin.calculate_distance(c4Origin);
|
||||
float roundedDistance = std::round(distance / 500.f);
|
||||
|
||||
float height = 10 - roundedDistance;
|
||||
float width = height * 1.2f;
|
||||
|
||||
render::DrawFilledBox(
|
||||
g::hdcBuffer,
|
||||
c4ScreenPos.x - (width / 2),
|
||||
c4ScreenPos.y - (height / 2),
|
||||
width,
|
||||
height,
|
||||
config::esp_box_color_enemy
|
||||
);
|
||||
|
||||
render::RenderText(
|
||||
g::hdcBuffer,
|
||||
c4ScreenPos.x + (width / 2 + 5),
|
||||
c4ScreenPos.y,
|
||||
"C4",
|
||||
config::esp_name_color,
|
||||
10
|
||||
);
|
||||
}
|
||||
|
||||
playerIndex++;
|
||||
list_entry = process->read<uintptr_t>(entity_list + (8 * (playerIndex & 0x7FFF) >> 9) + 16);
|
||||
if (!list_entry)
|
||||
@@ -38,6 +83,9 @@ namespace hack {
|
||||
if (!player)
|
||||
continue;
|
||||
|
||||
const uintptr_t playerMoneyServices = process->read<uintptr_t>(player + updater::offsets::m_pInGameMoneyServices);
|
||||
const int32_t money = process->read<int32_t>(playerMoneyServices + updater::offsets::m_iAccount);
|
||||
|
||||
/**
|
||||
* Skip rendering your own character and teammates
|
||||
*
|
||||
@@ -60,6 +108,7 @@ namespace hack {
|
||||
continue;
|
||||
|
||||
const int playerHealth = process->read<int>(pCSPlayerPawn + updater::offsets::m_iHealth);
|
||||
const int playerArmor = process->read<int>(pCSPlayerPawn + updater::offsets::m_ArmorValue);
|
||||
if (playerHealth <= 0 || playerHealth > 100)
|
||||
continue;
|
||||
|
||||
@@ -75,6 +124,20 @@ namespace hack {
|
||||
playerName = std::string(buf);
|
||||
}
|
||||
|
||||
const auto clippingWeapon = process->read<std::uint64_t>(pCSPlayerPawn + updater::offsets::m_pClippingWeapon);
|
||||
const auto weaponData = process->read<std::uint64_t>(clippingWeapon + 0x360);
|
||||
const auto weaponNameAddress = process->read<std::uint64_t>(weaponData + updater::offsets::m_szName);
|
||||
std::string weaponName = "Invalid Weapon Name";
|
||||
|
||||
if (!weaponNameAddress) {
|
||||
weaponName = "Invalid Weapon Name";
|
||||
}
|
||||
else {
|
||||
char buf[32];
|
||||
process->read_raw(weaponNameAddress, buf, sizeof(buf));
|
||||
weaponName = std::string(buf);
|
||||
}
|
||||
|
||||
const Vector3 origin = process->read<Vector3>(pCSPlayerPawn + updater::offsets::m_vecOrigin);
|
||||
const Vector3 head = { origin.x, origin.y, origin.z + 75.f };
|
||||
const Vector3 head2 = { origin.x + 10, origin.y + 10, origin.z + 75.f };
|
||||
@@ -107,6 +170,15 @@ namespace hack {
|
||||
(localTeam == playerTeam ? config::esp_box_color_team : config::esp_box_color_enemy)
|
||||
);
|
||||
|
||||
render::DrawBorderBox(
|
||||
g::hdcBuffer,
|
||||
screenHead.x - (width / 2 + 10),
|
||||
screenHead.y + (height * (100 - playerArmor) / 100),
|
||||
2,
|
||||
height - (height * (100 - playerArmor) / 100),
|
||||
RGB(0, 185, 255)
|
||||
);
|
||||
|
||||
render::DrawBorderBox(
|
||||
g::hdcBuffer,
|
||||
screenHead.x - (width / 2 + 5),
|
||||
@@ -148,16 +220,63 @@ namespace hack {
|
||||
10
|
||||
);
|
||||
|
||||
render::RenderText(
|
||||
g::hdcBuffer,
|
||||
screenHead.x + (width / 2 + 5),
|
||||
screenHead.y + 20,
|
||||
(std::to_string(playerArmor) + "armor").c_str(),
|
||||
RGB(
|
||||
(255 - playerArmor),
|
||||
(55 + playerArmor * 2),
|
||||
75
|
||||
),
|
||||
10
|
||||
);
|
||||
|
||||
if (config::show_extra_flags)
|
||||
{
|
||||
const bool isDefusing = process->read<bool>(pCSPlayerPawn + updater::offsets::m_bIsDefusing);
|
||||
|
||||
render::RenderText(
|
||||
g::hdcBuffer,
|
||||
screenHead.x + (width / 2 + 5),
|
||||
screenHead.y + 20,
|
||||
screenHead.y + 30,
|
||||
weaponName.c_str(),
|
||||
config::esp_distance_color,
|
||||
10
|
||||
);
|
||||
|
||||
render::RenderText(
|
||||
g::hdcBuffer,
|
||||
screenHead.x + (width / 2 + 5),
|
||||
screenHead.y + 40,
|
||||
(std::to_string(roundedDistance) + "m away").c_str(),
|
||||
config::esp_distance_color,
|
||||
10
|
||||
);
|
||||
|
||||
render::RenderText(
|
||||
g::hdcBuffer,
|
||||
screenHead.x + (width / 2 + 5),
|
||||
screenHead.y + 50,
|
||||
("$" + std::to_string(money)).c_str(),
|
||||
RGB(0, 125, 0),
|
||||
10
|
||||
);
|
||||
|
||||
std::string defuText = "Player is defusing";
|
||||
|
||||
if (isDefusing)
|
||||
{
|
||||
render::RenderText(
|
||||
g::hdcBuffer,
|
||||
screenHead.x + (width / 2 + 5),
|
||||
screenHead.y + 60,
|
||||
defuText.c_str(),
|
||||
config::esp_distance_color,
|
||||
10
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+16
-4
@@ -1,12 +1,24 @@
|
||||
{
|
||||
"build_number": 13964,
|
||||
"dwBuildNumber": 4748564,
|
||||
"dwLocalPlayer": 25063768,
|
||||
"dwEntityList": 24741688,
|
||||
"dwLocalPlayer": 25713704,
|
||||
"dwViewMatrix": 25716496,
|
||||
"dwBuildNumber": 4748564,
|
||||
"dwPlantedC4": 25742032,
|
||||
"m_flC4Blow": 3760,
|
||||
"m_flNextBeep": 3756,
|
||||
"m_flTimerLength": 3768,
|
||||
"m_pInGameMoneyServices": 1744,
|
||||
"m_iAccount": 64,
|
||||
"m_vecAbsOrigin": 200,
|
||||
"m_pGameSceneNode": 784,
|
||||
"m_bIsDefusing": 5008,
|
||||
"m_szName": 3096,
|
||||
"m_pClippingWeapon": 4752,
|
||||
"m_ArmorValue": 5360,
|
||||
"m_iHealth": 812,
|
||||
"dwPlayerPawn": 1980,
|
||||
"dwSanitizedName": 1824,
|
||||
"dwViewMatrix": 25716496,
|
||||
"m_iHealth": 812,
|
||||
"m_iTeamNum": 959,
|
||||
"m_vecOrigin": 4628
|
||||
}
|
||||
Reference in New Issue
Block a user