-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAssaultCubeESP.cpp
66 lines (52 loc) · 2.04 KB
/
AssaultCubeESP.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "Header.h"
#include <iostream>
#include <Windows.h>
int main()
{
int Players;
color = CreateSolidBrush(RGB(255, 0, 255));
HWND hwnd = FindWindowA(NULL, "AssaultCube");
if (!hwnd) {
std::cout << "window not found" << std::endl;
}
else
{
std::cout << "window found" << std::endl;
}
HTDC = GetDC(hwnd);
DWORD pID;
GetWindowThreadProcessId(hwnd, &pID);
if (!pID)
{
std::cout << "not found pID" << std::endl;
}
else
{
std::cout << "process id : " << pID << std::endl;
}
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, false, pID);
DWORD baseaddress = GetModuleBaseAddress(pID, L"ac_client.exe");
std::cout << "base address: " << baseaddress << std::endl;
DWORD entitybase = baseaddress + entitybaseaddress;
DWORD playernumberaddress = baseaddress + numberofplayersaddress;
ReadProcessMemory(handle, (LPVOID)playernumberaddress, &Players, 4, 0);
float viewmatrix[16];
DWORD entitytemp;
DWORD entitylast;
while (true)
{
for (int a = 1; a <= Players; a++)
{
ReadProcessMemory(handle, (LPVOID)(baseaddress + viewmatrixaddress), &viewmatrix, sizeof(viewmatrix), 0);
ReadProcessMemory(handle, (LPVOID)(entitybase), &entitytemp, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitytemp + a * 4), &entitylast, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitylast + offsetx[0]), &enemyb.x, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitylast + offsety[0]), &enemyb.y, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitylast + offsetz[0]), &enemyb.z, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitylast + headx[0]), &enemyh.x, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitylast + heady[0]), &enemyh.y, 4, 0);
ReadProcessMemory(handle, (LPVOID)(entitylast + headz[0]), &enemyh.z, 4, 0);
ESP(enemyb, enemyh, viewmatrix);
}
}
}