diff --git a/memory-external/hacks/hack.hpp b/memory-external/hacks/hack.hpp index a6eeb25..6354902 100644 --- a/memory-external/hacks/hack.hpp +++ b/memory-external/hacks/hack.hpp @@ -10,6 +10,16 @@ namespace hack { ProcessModule base_client; ProcessModule base_engine; + std::string ReadString(HANDLE proc, uintptr_t memoryAddress, size_t maxLength = 512) + { + char buffer[512] = { 0 }; + SIZE_T bytesRead = 0; + + ReadProcessMemory(proc, (LPCVOID)memoryAddress, buffer, maxLength, &bytesRead); + + return std::string(buffer); + } + void loop() { const uintptr_t localPlayer = process->read(base_client.base + updater::offsets::dwLocalPlayer); if (!localPlayer) @@ -60,6 +70,7 @@ namespace hack { continue; const int playerHealth = process->read(pCSPlayerPawn + updater::offsets::m_iHealth); + const int playerArmor = process->read(pCSPlayerPawn + updater::offsets::m_ArmorValue); if (playerHealth <= 0 || playerHealth > 100) continue; @@ -75,6 +86,18 @@ namespace hack { playerName = std::string(buf); } + const auto clipping_weapon = process->read(pCSPlayerPawn + 0x1290); + const auto weapon_data = process->read(clipping_weapon + 0x360); + const auto weaponName_ptr = process->read(weapon_data + 0xc18); + std::string weaponName = "Invalid Weapon Name"; + + if (!weaponName_ptr) { + weaponName = "Invalid Weapon Name"; + } + else { + weaponName = ReadString(process->handle_, weaponName_ptr, 32); + } + const Vector3 origin = process->read(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 }; @@ -148,12 +171,34 @@ 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) { 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