-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmain.cpp
65 lines (53 loc) · 1.18 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
62
63
64
65
#include "sdk.h"
#include "game.h"
#include "xor.h"
#include <thread>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hSecInstance, LPSTR nCmdLine, INT nCmdShow)
{
LoadLibrary("user32.dll");
#if DEBUG
AllocConsole();
FILE* f;
freopen_s(&f, "CONOUT$", "w", stdout);
#endif
char* gn = globals::decGn();
while (!process_id) {
process_id = get_process_id(gn);
#if DEBUG
utils::log(xorstr_("[+] Waiting for game to open..."));
#endif
Sleep(1000);
}
globals::module_base = DriverGetBase(gn);
memset(gn, 0, 18);
delete[] gn;
globals::peb = DriverGetPEB();
#if DEBUG
utils::log(xorstr_("[+] Found Game!"));
utils::loghex(xorstr_("[>] PEB: "), globals::peb);
utils::loghex(xorstr_("[>] BASE: "), globals::module_base);
#endif
Game& g_MW = Game::get();
g_MW.Init();
while (1) {
#if DEBUG
if (GetAsyncKeyState(VK_PRIOR) & 1) {
g_MW.UpdateAddresses();
}
if (GetAsyncKeyState(VK_NEXT) & 1) {
g_MW.PrintEntityDbg();
}
#endif
if (GetAsyncKeyState(VK_HOME) & 1) {
g_MW.ToggleESP();
}
if (GetAsyncKeyState(VK_END) & 1) {
g_MW.End();
break;
}
}
#if DEBUG
fclose(f);
FreeConsole();
#endif
}