This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathMain.cpp
231 lines (205 loc) · 5.82 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
#include "Main.h"
#include "pch.h"
int Width = GetSystemMetrics(SM_CXSCREEN);
int Height = GetSystemMetrics(SM_CYSCREEN);
const MARGINS Margin = { -1 };
char lWindowName[256] = "Its Random";
HWND hWnd;
char tWindowName[256] = "Gameloop【Turbo AOW Engine】";
HWND tWnd;
RECT tSize;
MSG Message;
FILE* f;
void AConsole()
{
AllocConsole();
freopen_s(&f, "CONOUT$", "w", stdout);
}
void gen_random(char* s, const int len) {
srand(time(NULL));
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < len; ++i) {
s[i] = alphanum[rand() % (sizeof(alphanum) - 1)];
}
s[len] = 0;
}
void initall()
{
//g_pEsp->viewWordBase = base;
int ProcessId = ProcManager::getAowProcID();
if (!ProcessId)
{
MessageBox(0, "Game Loop Not Found Exiting...","Error",MB_OK);
exit(1);
}
g_pMemoryManager->init(ProcessId, false);
if (!g_pMemoryManager->DriverLoaded) {
MessageBox(0, "Error Loading Driver", "Error", MB_OK);
exit(1);
}
g_pEsp->viewWordBase = g_pEsp->getViewWorld();
g_pEsp->GetModuleBaseAddress(ProcessId, "aow_exe.exe");
g_pEsp->GetMagic();
g_pEsp->initMagic();
g_pEsp->init();
}
LRESULT CALLBACK WinProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch (Message)
{
case WM_PAINT:
Render();
break;
case WM_CREATE:
DwmExtendFrameIntoClientArea(hWnd, &Margin);
break;
case WM_DESTROY:
PostQuitMessage(1);
return 0;
default:
return DefWindowProc(hWnd, Message, wParam, lParam);
break;
}
return 0;
}
std::vector<std::string> SplitString(char str[])
{
std::vector<std::string> retstr;
char* token = strtok(str, " ");
while (token != NULL)
{
retstr.push_back(token);
token = strtok(NULL, " ");
}
return retstr;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hSecInstance, LPSTR nCmdLine, INT nCmdShow)
{
std::string argv = GetCommandLineA();
std::vector<std::string> splited = SplitString(GetCommandLineA());
int vtadds = 0;
//MessageBoxA(0, argv.c_str(), std::to_string(splited.size()).c_str(), MB_OK);
char* logkey = new char[32];
std::string enterdkey = "";
//AConsole();
if (false)
{
std::cout << termcolor::blue << "COPY THE KEY AND PRESS OK " << termcolor::reset;
gen_random(logkey, 32);
std::string linkChar = "https://shrinkearn.com/st?api=9e7699d679c6140314c6f4cd195fe708a26f4df6&url=http://urlecho.appspot.com/echo?body=";
linkChar.append(logkey);
ShellExecute(NULL, NULL, linkChar.c_str(), NULL, NULL, SW_SHOWNORMAL);
MessageBoxA(0, "Copy Key and Press Ok", "", MB_OK);
HANDLE h;
if (!OpenClipboard(NULL))
std::cout << "Can't open clipboard";
h = GetClipboardData(CF_TEXT);
enterdkey = (char*)h;
CloseClipboard();
if (strcmp(logkey, enterdkey.c_str()) != 0)
{
std::cout << termcolor::red << "Error : Wrong Key" << termcolor::reset;
MessageBoxA(0, "WRONG KEY", "", 0);
exit(EXIT_FAILURE);
}
}
else
{
AConsole();
}
initall();
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)SetWindowToTarget, 0, 0, 0);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)aimbotload, 0, 0, 0);
ZeroMemory(lWindowName, sizeof(lWindowName));
srand(time(NULL));
gen_random(lWindowName, (rand() % 30) + 2);
WNDCLASSEX wClass;
wClass.cbClsExtra = NULL;
wClass.cbSize = sizeof(WNDCLASSEX);
wClass.cbWndExtra = NULL;
wClass.hbrBackground = (HBRUSH)CreateSolidBrush(D3DCOLOR_ARGB(0, 0, 0, 0));
wClass.hCursor = LoadCursor(0, IDC_ARROW);
wClass.hIcon = LoadIcon(0, IDI_APPLICATION);
wClass.hIconSm = LoadIcon(0, IDI_APPLICATION);
wClass.hInstance = hInstance;
wClass.lpfnWndProc = WinProc;
wClass.lpszClassName = lWindowName;
wClass.lpszMenuName = lWindowName;
wClass.style = CS_VREDRAW | CS_HREDRAW;
if(!RegisterClassEx(&wClass))
exit(1);
tWnd = FindWindow(0, tWindowName);
if (!IsWindow(tWnd))
{
char tWindowName2[256] = "Gameloop【Turbo AOW Engine-4.4】";
ZeroMemory(tWindowName, 256);
memcpy(tWindowName, tWindowName2, sizeof(tWindowName2));
tWnd = FindWindow(0, tWindowName);
}
if (IsWindow(tWnd))
tWnd = FindWindowEx(tWnd, NULL, "AEngineRenderWindowClass", NULL);
if (tWnd)
{
GetWindowRect(tWnd, &tSize);
Width = tSize.right - tSize.left;
Height = tSize.bottom - tSize.top;
hWnd = CreateWindowEx(WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_LAYERED, lWindowName, lWindowName, WS_POPUP, tSize.left, tSize.top, Width, Height, 0, 0, 0, 0);
SetLayeredWindowAttributes(hWnd, 0, 255, LWA_ALPHA);
//SetLayeredWindowAttributes(hWnd, 0, RGB(0, 0, 0), LWA_COLORKEY);
ShowWindow( hWnd, SW_NORMAL);
}
DirectXInit(hWnd);
LoadFont();
UpdateWindow(hWnd);
for (;;)
{
if(PeekMessage(&Message, hWnd, 0, 0, PM_REMOVE))
{
DispatchMessage(&Message);
TranslateMessage(&Message);
}
}
return Message.wParam;
}
void SetWindowToTarget()
{
while(true)
{
tWnd = FindWindow(0, tWindowName);
if (!IsWindow(tWnd))
{
char tWindowName2[256] = "Gameloop【Turbo AOW Engine-4.4】";
ZeroMemory(tWindowName, 256);
memcpy(tWindowName, tWindowName2, sizeof(tWindowName2));
tWnd = FindWindow(0, tWindowName);
}
if (IsWindow(tWnd))
tWnd = FindWindowEx(tWnd, NULL, "AEngineRenderWindowClass", NULL);
if (tWnd)
{
GetWindowRect(tWnd, &tSize);
Width = tSize.right - tSize.left;
Height = tSize.bottom - tSize.top;
DWORD dwStyle = GetWindowLong(tWnd, GWL_EXSTYLE);
if(dwStyle & WS_BORDER)
{
tSize.top += 23;
Height -= 23;
}
MoveWindow(hWnd, tSize.left, tSize.top, Width, Height, true);
}
else
{
char ErrorMsg[125];
sprintf(ErrorMsg, "Make sure %s is running!", tWindowName);
MessageBox(0, ErrorMsg, "Error - Cannot find the game!", MB_OK | MB_ICONERROR);
exit(1);
}
g_pEsp->update();
GetKey();
Sleep(5);
}
}