Я просто хочу вообще понять как работает это. Я понимаю что еще нужен EntityList и поиск объектов на Матрице. Просто попомгите если не трудно
На самый простой есп #include <Windows.h>
#include <vector>
#include "imgui.h"
#include "imgui_impl_dx9.h"
struct Vec3 { float x, y, z; };
struct Vec2 { float x, y; };
template<typename T>
T ReadMemory(HANDLE hProcess, DWORD ptr) {
T buffer;
ReadProcessMemory(hProcess, (LPCVOID)ptr, &buffer, sizeof(T), NULL);
return buffer;
}
void RenderESP() {
// Получаем матрицу вида
float viewMatrix[4][4];
ReadProcessMemory(hProcess, (LPCVOID)(clientBase + dwViewMatrix), &viewMatrix, sizeof(viewMatrix), NULL);
//локал игрок
DWORD localPlayer = ReadMemory<DWORD>(hProcess, clientBase + dwLocalPlayer);
for (int i = 0; i < 64; i++) {
DWORD entity = ReadMemory<DWORD>(hProcess, clientBase + dwEntityList + i * 0x10);
if (!entity) continue;
int team = ReadMemory<int>(hProcess, entity + m_iTeamNum);
if (team == ReadMemory<int>(hProcess, localPlayer + m_iTeamNum)) continue; //чек на тимейтов
Vec3 enemyPos = ReadMemory<Vec3>(hProcess, entity + m_vecOrigin);
Vec2 screenPos;
if (WorldToScreen(viewMatrix, enemyPos, screenPos, 1920, 1080)) {
// пастим есп боксы лол кек чебурек
ImGui::GetBackgroundDrawList()->AddRect(
ImVec2(screenPos.x - 10, screenPos.y - 20),
ImVec2(screenPos.x + 10, screenPos.y + 20),
ImColor(255, 0, 0)
);
int health = ReadMemory<int>(hProcess, entity + m_iHealth);
ImGui::GetBackgroundDrawList()->AddText(
ImVec2(screenPos.x, screenPos.y - 30),
ImColor(0, 255, 0),
std::to_string(health).c_str()
);
}
}
}
while (true) {
RenderESP();
Sleep(1);
}
есп боксы с хеалт баром лол кек