• Ищем качественного (не новичок) разработчиков Xenforo для этого форума! В идеале, чтобы ты был фулл стек программистом. Если у тебя есть что показать, то свяжись с нами по контактным данным: https://t.me/DREDD

Вопрос Дайте плиз код на самый простой esp через WorldToScreen

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
22 Июл 2024
Сообщения
97
Реакции
1
Я просто хочу вообще понять как работает это. Я понимаю что еще нужен EntityList и поиск объектов на Матрице. Просто попомгите если не трудно :pikachu:
 
100 и 1000 исходников на форуме, человек не может CTRL+SHIFT+F нажать...
 
на форуме где то был слитый курс, тебе поможет посмотреть там
 
Я просто хочу вообще понять как работает это. Я понимаю что еще нужен EntityList и поиск объектов на Матрице. Просто попомгите если не трудно :pikachu:
На самый простой есп #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);
}
есп боксы с хеалт баром лол кек
 
На самый простой есп #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);
}
есп боксы с хеалт баром лол кек

Undetected ReadProcessMemory 2025 $$$ELF CODE
 
На самый простой есп #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);
}
есп боксы с хеалт баром лол кек
А можно объяснение плиззз по поводу матрицы
 
На самый простой есп #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);
}
есп боксы с хеалт баром лол кек
Топ, спс за исходник но меня почему-то из гитхаба кикнули после того как я комитнул но думаю пох
 
А можно объяснение плиззз по поводу матрицы
У тебя есть матрица 4 на 4 в самой игре, офсет есть в клиент длл offset.hpp
Ты береш создаёшь тоже матрицу размером 16 (matrix[16]) после этого ты берешь свои координаты (из надо будет брать из энтити листа, но я про матрицу пока что) далее ты пишешь фунцию WorldToScreen, туда передаешь свою матрицу, которую ты записываешь циклом перед этим, и пихаешь туда свое разрешение экрана, + структура куда пойдет запись, далее первые 4 значения матрици умножаешь на свои зд координаты,
Выглядит это так:
cpp:
Expand Collapse Copy
float clipX = pos.x * matrix[0]  + pos.y * matrix[1]  + pos.z * matrix[2]  + matrix[3];
float clipY = pos.x * matrix[4]  + pos.y * matrix[5]  + pos.z * matrix[6]  + matrix[7];
float clipZ = pos.x * matrix[8]  + pos.y * matrix[9]  + pos.z * matrix[10] + matrix[11];
float clipW = pos.x * matrix[12] + pos.y * matrix[13] + pos.z * matrix[14] + matrix[15];

4 значение это перспектива
После того как ты получил значения clip надо преобразовать их в 2д

cpp:
Expand Collapse Copy
float ndcX = clipX / clipW;
float ndcY = clipY / clipW;

Вот ты и получил свои значения, потом ты преобразует их уже в зависимости от разрешения твоего экрана

cpp:
Expand Collapse Copy
screen.x = (width / 2.0f) + (ndcX * width / 2.0f);
screen.y = (height / 2.0f) - (ndcY * height / 2.0f);

Выше могу ошибиться (пишу по памяти)

Ну и вот ты записал их в свою структуру для 2д, если тебе надо рисовать что-то что имеет только 1 точку на карте, то вынеси clipW, и в последствии домнажай на него свой размер,

Это все работает в цикле после вычисления самой матрици, дальше остаётся только использовать данные координаты и отрисовывать их имгуем с каждым кадром, рекомендую делать это в разных потоках, потому что иначе у тебя будут замедлятся кадры (хз как в экстеналах но думаю надо тоже выселения выносить из меню, чтобы не было посадок)

Если где-то не прав, поправьте
 
Последнее редактирование:
Назад
Сверху Снизу