-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
61 lines (48 loc) · 1.15 KB
/
main.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
#include <iostream>
#include <windows.h>
HWND getGameWindow(const char *game = "AssaultCube")
{
HWND window = FindWindow(NULL, game);
if (!window)
{
std::cout << game << " window not found.\n";
return window;
}
std::cout << game << " window captured!\n";
return window;
}
HANDLE getGameProcessHandler()
{
DWORD process;
GetWindowThreadProcessId(getGameWindow(), &process);
return OpenProcess(PROCESS_ALL_ACCESS, false, process);
}
void setBullet(int bullets, HANDLE handle)
{
DWORD_PTR memory_address = 0x082F2A0;
WriteProcessMemory(handle, (LPVOID)memory_address, &bullets, 4, 0);
}
void setGranades(int granades, HANDLE handle)
{
DWORD_PTR memory_address = 0x082F2A4;
WriteProcessMemory(handle, (LPVOID)memory_address, &granades, 4, 0);
}
void reload()
{
HANDLE handle = getGameProcessHandler();
// std::cout << "\nType the entity address memory: ";
// std::cin >> memory_address;
while (true)
{
if (GetAsyncKeyState(VK_TAB))
{
setBullet(500, handle);
setGranades(5, handle);
}
}
}
int main()
{
reload();
return 0;
}