-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
92 lines (78 loc) · 2.08 KB
/
main.cpp
File metadata and controls
92 lines (78 loc) · 2.08 KB
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
90
91
92
#include "pch.h"
#include "Memory.h"
#include "Menu.h"
#include "Features.h"
void Exit(HANDLE handle)
{
if (handle)
CloseHandle(handle);
std::cin.get();
exit(0);
}
int main()
{
for (unsigned int i = 0; i < Menu::TOTAL_OPTIONS; ++i)
{
Menu::toggled[i] = false;
if (Menu::options[i].length() > Menu::largestString)
Menu::largestString = Menu::options[i].length();
}
if (Menu::largestString >= Menu::padding)
{
Menu::padding = Menu::largestString + 2;
}
const wchar_t* processName = L"ac_client.exe";
Memory::pid = Memory::GetPID(processName);
std::string option;
if (Memory::pid)
{
std::wcout << "Found process " << processName << " with ID (" << Memory::pid << ")\n";
}
else
{
std::wcout << "Couldn\'t find " << processName << "!\n";
return 0;
}
Memory::pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Memory::pid);
if (Memory::pHandle != NULL)
{
std::wcout << "Process " << processName << " succesfully opened!\n";
}
else
{
std::wcout << "Error opening " << processName << "!\n";
Exit(Memory::pHandle);
}
Memory::BaseAddress = Memory::GetModuleBaseAddress(Memory::pid, processName);
if (Memory::BaseAddress)
{
std::cout << "Found Module Base Address: " << "0x" << std::hex << Memory::BaseAddress << std::dec << std::endl;
}
else
{
std::cout << "Couldn\'t find module base address!\n";
Exit(Memory::pHandle);
}
DWORD dwExit = 0;
Menu::WriteMenu();
while (GetExitCodeProcess(Memory::pHandle, &dwExit) && dwExit == STILL_ACTIVE)
{
if (GetAsyncKeyState(VK_NUMPAD1) & 1)
{
Menu::Select(1);
}
else if (GetAsyncKeyState(VK_NUMPAD2) & 1)
{
Menu::Select(2);
}
else if (GetAsyncKeyState(VK_NUMPAD3) & 1)
{
Menu::Select(3);
}
else if (GetAsyncKeyState(VK_NUMPAD0) & 1)
{
break;
}
}
Exit(Memory::pHandle);
}