Начинающий
-
Автор темы
- #1
Код:
#include "Glow.h"
#include "imgui/imgui.h"
using namespace G;
extern ImVec4 glowColor;
uintptr_t G::client = (uintptr_t)GetModuleHandle("Client.dll");
void G::Glow()
{
uintptr_t client = (uintptr_t)GetModuleHandle("client.dll");
auto localpawn = *(uintptr_t*)(client + O::dwLocalPlayerPawn);
if (!localpawn)
return;
auto localTeam = *(int*)(localpawn + O::m_iTeamNum);
if (!localTeam)
return;
auto entitylist = *(uintptr_t*)(client + O::dwEntityList);
if (!entitylist)
return;
for (int i = 1; i < 64; i++)
{
uintptr_t list_entry1 = *(uintptr_t*)(entitylist + (8 * (i & 0x7FFF) >> 9) + 16);
if (!list_entry1)
continue;
uintptr_t playerController = *(uintptr_t*)(list_entry1 + 120 * (i & 0x1FF));
if (!playerController)
continue;
uint32_t playerPawn = *(uint32_t*)(playerController + O::m_hPlayerPawn);
if (!playerPawn)
continue;
uintptr_t list_entry2 = *(uintptr_t*)(entitylist + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);
if (!list_entry2)
continue;
uintptr_t pCSPlayerPawnPtr = *(uintptr_t*)(list_entry2 + 120 * (playerPawn & 0x1FF));
if (!pCSPlayerPawnPtr)
continue;
int team = *(int*)(pCSPlayerPawnPtr + O::m_iTeamNum);
if (!team)
continue;
if (team == localTeam)
continue;
int health = *(int*)(pCSPlayerPawnPtr + O::m_iHealth);
if (health <= 0)
continue;
DWORD colorArgb = ((DWORD)(glowColor.w * 255) << 24) |
((DWORD)(glowColor.z * 255) << 16) |
((DWORD)(glowColor.y * 255) << 8) |
((DWORD)(glowColor.x * 255));
*(DWORD*)(pCSPlayerPawnPtr + O::m_Glow + O::m_glowColorOverride) = colorArgb;
*(DWORD*)(pCSPlayerPawnPtr + O::m_Glow + O::m_bGlowing) = 1;
}
}