// Тема для тех кто хочет узнать как это работает 1) Внедряем hDirectX header class и ProcMem, нам нужен ProcMem для того, чтобы прочесть память; Вызываем процесс ProcMem Mem; Code ProcMem Mem; 2) Внедряем дефины, позже объясню #define LocalPlayer 0x00000 //LocalPlayer offset #define EntityList 0x00000 // EntityList offset #define ViewMatrix 0x00000 // ViewMatrix offset #define iHealth 0x00000 // iHealth offset [Always: 0xFC] #define iTeamNum 0x00000 // Team offset [Always: 0xF0] #define ArmorValue 0x00000 // Armor Value [Cuz cool?] #define IsDormant 0x00000 // Is dormant or na? [Always: 0xE9] #define vecOrigin 0x00000 // vecOrigin offset [Always: 0x134]; Code #define LocalPlayer 0x00000 //LocalPlayer offset #define EntityList 0x00000 // EntityList offset #define ViewMatrix 0x00000 // ViewMatrix offset #define iHealth 0x00000 // iHealth offset [Always: 0xFC] #define iTeamNum 0x00000 // Team offset [Always: 0xF0] #define ArmorValue 0x00000 // Armor Value [Cuz cool?] #define IsDormant 0x00000 // Is dormant or na? [Always: 0xE9] #define vecOrigin 0x00000 // vecOrigin offset [Always: 0x134]; 3) Создаем структуру; Не забываем сделать Engine, Client DWORDS, Our window RECT [COLOR=#b3b300]DWORD Client; DWROD Engine; RECT OurWindow;[/COLOR] [COLOR=rgb(0, 179, 179)][/COLOR] [COLOR=#b3b300] Code [COLOR=#b3b300]DWORD Client; DWROD Engine; RECT OurWindow;[/COLOR] [COLOR=rgb(0, 179, 179)][/COLOR] [COLOR=#b3b300] 4) Создаем структуру для наших союзников и врагов [/COLOR] [COLOR=#b3b300]struct SimplePlayer_t { uintptr_t pLocal; int Health; int TeamNum; int Dormant; int ArmorValueInt; float Posi[3]; void ReadInfo() { pLocal = Mem.Read<uintptr_t>(Client + LocalPlayer); Health = Mem.Read<int>(pLocal + iHealth); TeamNum = Mem.Read<int>(pLocal + iTeamNum); ArmorValue = Mem.Read<int>(pLocal + ArmorValue); Dormant = Mem.Read<int>(pLocal + IsDormant); Posi[0] = Mem.Read<float>(pLocal + vecOrigin); Posi[1] = Mem.Read<float>(pLocal + vecOrigin + 0x4); Posi[2] = Mem.Read<float>(pLocal + vecOrigin + 0x8); } }SimplePlayer;[/COLOR] Code [COLOR=#b3b300]struct SimplePlayer_t { uintptr_t pLocal; int Health; int TeamNum; int Dormant; int ArmorValueInt; float Posi[3]; void ReadInfo() { pLocal = Mem.Read<uintptr_t>(Client + LocalPlayer); Health = Mem.Read<int>(pLocal + iHealth); TeamNum = Mem.Read<int>(pLocal + iTeamNum); ArmorValue = Mem.Read<int>(pLocal + ArmorValue); Dormant = Mem.Read<int>(pLocal + IsDormant); Posi[0] = Mem.Read<float>(pLocal + vecOrigin); Posi[1] = Mem.Read<float>(pLocal + vecOrigin + 0x4); Posi[2] = Mem.Read<float>(pLocal + vecOrigin + 0x8); } }SimplePlayer;[/COLOR] 4) Теперь добавим vMatrix Struct, перед тем как перейти к самому главному typedef struct { float flMatrix[4][4]; }WorldToScreenMatrix_t; Code typedef struct { float flMatrix[4][4]; }WorldToScreenMatrix_t; 5) А теперь самое интересное, ведь до этого было несложно). Готовы? struct EnemyPlayer_t { uintptr_t CEntityList; int Health; int TeamNum; int Dormant; int ArmorValueInt; float Posi[3]; void ReadInfo(int _pInfo) { CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10)); Health = Mem.Read<int>(CEntityList + iHealth); TeamNum = Mem.Read<int>(CEntityList + iTeamNum); ArmorValue = Mem.Read<int>(CEntityList + ArmorValue); Dormant = Mem.Read<int>(CEntityList + IsDormant); Posi[0] = Mem.Read<float>(CEntityList + vecOrigin); Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4); Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8); } }EnemyPlayer[32]; Code struct EnemyPlayer_t { uintptr_t CEntityList; int Health; int TeamNum; int Dormant; int ArmorValueInt; float Posi[3]; void ReadInfo(int _pInfo) { CEntityList = Mem.Read<uintptr_t>(Client + EntityList + (_pInfo * 0x10)); Health = Mem.Read<int>(CEntityList + iHealth); TeamNum = Mem.Read<int>(CEntityList + iTeamNum); ArmorValue = Mem.Read<int>(CEntityList + ArmorValue); Dormant = Mem.Read<int>(CEntityList + IsDormant); Posi[0] = Mem.Read<float>(CEntityList + vecOrigin); Posi[1] = Mem.Read<float>(CEntityList + vecOrigin + 0x4); Posi[2] = Mem.Read<float>(CEntityList + vecOrigin + 0x8); } }EnemyPlayer[32]; 6) Позже мы будем читать наших врагов по ReadInfo function. Самое время для The WorldToScreen Part. Это самая сложная функция. [SIZE=5][COLOR=#ffff00]bool WorldToScreenM(float * from, float * to) { WorldToScreenMatrix_t WorldToScreenMatrix; WorldToScreenMatrix = Mem.Read<WorldToScreenMatrix_t>(Client + ViewMatrix); float w = 0.0f; to[0] = WorldToScreenMatrix.flMatrix[0][0] * from[0] + WorldToScreenMatrix.flMatrix[0][1] * from[1] + WorldToScreenMatrix.flMatrix[0][2] * from[2] + WorldToScreenMatrix.flMatrix[0][3]; to[1] = WorldToScreenMatrix.flMatrix[1][0] * from[0] + WorldToScreenMatrix.flMatrix[1][1] * from[1] + WorldToScreenMatrix.flMatrix[1][2] * from[2] + WorldToScreenMatrix.flMatrix[1][3]; w = WorldToScreenMatrix.flMatrix[3][0] * from[0] + WorldToScreenMatrix.flMatrix[3][1] * from[1] + WorldToScreenMatrix.flMatrix[3][2] * from[2] + WorldToScreenMatrix.flMatrix[3][3]; if (w < 0.01f) return false; float invw = 1.0f / w; to[0] *= invw; to[1] *= invw; int width = (int)(OurWindow.right - OurWindow.left); int height = (int)(OurWindow.bottom - OurWindow.top); float x = width / 2; float y = height / 2; x += 0.5 * to[0] * width + 0.5; y -= 0.5 * to[1] * height + 0.5; to[0] = x + OurWindow.left; // Our Window to[1] = y + OurWindow.top; return true; }[/COLOR][/SIZE] Code [SIZE=5][COLOR=#ffff00]bool WorldToScreenM(float * from, float * to) { WorldToScreenMatrix_t WorldToScreenMatrix; WorldToScreenMatrix = Mem.Read<WorldToScreenMatrix_t>(Client + ViewMatrix); float w = 0.0f; to[0] = WorldToScreenMatrix.flMatrix[0][0] * from[0] + WorldToScreenMatrix.flMatrix[0][1] * from[1] + WorldToScreenMatrix.flMatrix[0][2] * from[2] + WorldToScreenMatrix.flMatrix[0][3]; to[1] = WorldToScreenMatrix.flMatrix[1][0] * from[0] + WorldToScreenMatrix.flMatrix[1][1] * from[1] + WorldToScreenMatrix.flMatrix[1][2] * from[2] + WorldToScreenMatrix.flMatrix[1][3]; w = WorldToScreenMatrix.flMatrix[3][0] * from[0] + WorldToScreenMatrix.flMatrix[3][1] * from[1] + WorldToScreenMatrix.flMatrix[3][2] * from[2] + WorldToScreenMatrix.flMatrix[3][3]; if (w < 0.01f) return false; float invw = 1.0f / w; to[0] *= invw; to[1] *= invw; int width = (int)(OurWindow.right - OurWindow.left); int height = (int)(OurWindow.bottom - OurWindow.top); float x = width / 2; float y = height / 2; x += 0.5 * to[0] * width + 0.5; y -= 0.5 * to[1] * height + 0.5; to[0] = x + OurWindow.left; // Our Window to[1] = y + OurWindow.top; return true; }[/COLOR][/SIZE] 7) Теперь, когда самое главное позади, возвращаемся к cDirectX.cpp #include "pEspIncludes.h" // include cfg. Code #include "pEspIncludes.h" // include cfg. 8) Теперь читаем Engine.dll и Client.dll(в csgo) bool xOnce = false; if(!xOnce) { Client = Mem.Module("client.dll"); Engine = Mem.Module("engine.dll"); xOnce = true; } Code bool xOnce = false; if(!xOnce) { Client = Mem.Module("client.dll"); Engine = Mem.Module("engine.dll"); xOnce = true; } 9) После того, как мы прочитали игроков на сервере добавляем их в ReadInfo. GetWindowRect(FindWindowA(NULL, "Counter-Strike: Global Offensive"), &OurWindow); // Find Our Window SimplePlayer.ReadInfo(); // Read Our Player Informations. for(int i = 0; i < 32; i++) { //ESP Codenz. } Code GetWindowRect(FindWindowA(NULL, "Counter-Strike: Global Offensive"), &OurWindow); // Find Our Window SimplePlayer.ReadInfo(); // Read Our Player Informations. for(int i = 0; i < 32; i++) { //ESP Codenz. } 10) Теперь для врагов)) EnemyPlayer[i].ReadInfo(i); Code EnemyPlayer[i].ReadInfo(i); 11) Добавим есп, чтобы оно висело на врагах if (EnemyPlayer[i].TeamNum != 2 && EnemyPlayer[i].TeamNum != 3) Code if (EnemyPlayer[i].TeamNum != 2 && EnemyPlayer[i].TeamNum != 3) 12) Убираем есп, когда противник мертв) if(EnemyPlayer[i].Dormant) continue; // Boxes if(EnemyPlayer[i].Health < 1) continue; Code if(EnemyPlayer[i].Dormant) continue; // Boxes if(EnemyPlayer[i].Health < 1) continue; 13) Добавим рассылку на врагов float W2SP[3]; Code float W2SP[3]; 14) Ура почти все!!!1 Добавляем рассылку на vecOrigin has WorldToScreen if(WorldToScreenM(EnemyPlayer[i].Posi, W2SP)) { // SnapLine code here. } Code if(WorldToScreenM(EnemyPlayer[i].Posi, W2SP)) { // SnapLine code here. } 15) Последняя поправка, добавляем линии DrawLine(GetSystemMetrics(SM_CXSCREEN) / 2, GetSystemMetrics(SM_CYSCREEN), W2SP[0], W2SP[1], your colors..); Code DrawLine(GetSystemMetrics(SM_CXSCREEN) / 2, GetSystemMetrics(SM_CYSCREEN), W2SP[0], W2SP[1], your colors..); 16)Убираем не нужное) int width = abs(W2SP[1] - W2SPHead[1]); int height = width / 2; Code int width = abs(W2SP[1] - W2SPHead[1]); int height = width / 2;