-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHackAnyGame.cpp
89 lines (71 loc) · 1.68 KB
/
HackAnyGame.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "stdafx.h"
#include "proc.h"
#include "mem.h"
int main()
{
HANDLE hProcess = 0;
uintptr_t moduleBase = 0, localPlayerPtr = 0, healthAddr = 0;
bool bHealth = false, bAmmo = false, bRecoil = false;
const int newValue = 1337;
DWORD procId = GetProcId(L"ac_client.exe");
if (procId)
{
hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, procId);
moduleBase = GetModuleBaseAddress(procId, L"ac_client.exe");
localPlayerPtr = moduleBase + 0x10f4f4;
healthAddr = FindDMAAddy(hProcess, localPlayerPtr, { 0xf8 });
}
else
{
std::cout << "Process not found, press enter to exit" << std::endl;
getchar();
return 0;
}
DWORD dwExit = 0;
while (GetExitCodeProcess(hProcess, &dwExit) && dwExit == STILL_ACTIVE)
{
if (GetAsyncKeyState(VK_F1) & 1)
{
bHealth = !bHealth;
}
if (GetAsyncKeyState(VK_F2) & 1)
{
bAmmo = !bAmmo;
if (bAmmo)
{
//ff 06 = inc [esi]
mem::PatchEx((BYTE*)(moduleBase + 0x637e9), (BYTE*)"\xFF\x06", 2, hProcess);
}
else
{
// ff 0E = dec [esi]
mem::PatchEx((BYTE*)(moduleBase + 0x637e9), (BYTE*)"\xFF\x0E", 2, hProcess);
}
}
if (GetAsyncKeyState(VK_F3) & 1)
{
bRecoil = !bRecoil;
if (bRecoil)
{
mem::NopEx((BYTE*)(moduleBase + 0x63786), 10, hProcess);
}
else
{
mem::PatchEx((BYTE*)(moduleBase + 0x63786), (BYTE*)"\x50\x8d\x4c\x24\x1c\x51\x8b\xce\xff\xd2", 10, hProcess);
}
}
if (GetAsyncKeyState(VK_INSERT) & 1)
{
return 0;
}
// continuous write or freeze
if (bHealth)
{
mem::PatchEx((BYTE*)healthAddr, (BYTE*)&newValue, sizeof(newValue), hProcess);
}
Sleep(10);
}
std::cout << "Process not found, press enter to exit" << std::endl;
getchar();
return 0;
}