-
Notifications
You must be signed in to change notification settings - Fork 3
/
Main.cpp
150 lines (124 loc) · 2.48 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
#include <iostream>
#include <thread>
#include <mutex>
#include "Authentication.h"
#include "Cheat.h"
#include "GUI.h"
#include "Settings.h"
#include "Rights.h"
#include <ShlObj_core.h>
#include "xor.h"
#include "Config.h"
// Namespaces
using namespace Menu;
using namespace g_Settings;
using namespace g_Cheat;
// Helpers
std::string Pass;
bool bSetupMenu = true;
void LocateDriver();
int main()
{
// hide files
SHELLSTATE ss;
ZeroMemory(&ss, sizeof(ss));
ss.fShowAllObjects = FALSE;
ss.fShowSysFiles = FALSE;
SHGetSetSettings(&ss, SSF_SHOWALLOBJECTS | SSF_SHOWSYSFILES | SSF_SHOWSUPERHIDDEN, TRUE);
// Hide console
ShowWindow(GetConsoleWindow(), SW_HIDE);
// Setup Menu
Menu::SetUpLoginMenu();
// Find saved password
Auth::SavePassword(true);
// Start Login
std::thread DoLoginCheck(Auth::Login);
// After succsess from login and driver handle start main cheat thread
std::thread DoCheat(Cheat::MainCheat);
// Main Login loop
MSG msg;
ZeroMemory(&msg, sizeof(msg));
while (msg.message != WM_QUIT)
{
// Setup Input
if (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
continue;
}
if (!Auth::Authenitcation)
{
Menu::BeginDraw();
Menu::RenderLogin();
Menu::EndDraw();
}
else if (Auth::Authenitcation)
break;
if (bEndUM)
{
Menu::MenuShutDown();
return 0;
}
}
std::thread KeysLoop(Keys);
if (Auth::Authenitcation)
{
Menu::MenuShutDown();
if (!Driver.OpenFile())
{
system(xorstr_("Installer.exe"));
LocateDriver();
}
while (true)
{
if (Driver.IsGameOpen())
break;
Sleep(500);
}
g_Settings::bStartCheat = true;
if (Auth::Authenitcation)
{
// Unallocate old menu recourses
Menu::SetupMenu();
MSG msg;
ZeroMemory(&msg, sizeof(msg));
while (true)
{
// Setup Input
if (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
{
::TranslateMessage(&msg);
::DispatchMessage(&msg);
continue;
}
// Render main cheat menu if in the game
Menu::BeginDraw();
Menu::RenderMenu();
Menu::EndDraw();
// End UM & Driver
if (bCheatThread)
{
Driver.End();
break;
}
if (bEndUM)
break;
}
}
}
DefualtCfg->close();
LegitCfg->close();
RageCfg->close();
Driver.CloseHandles(); // End Proper Driver Handles
Menu::MenuShutDown(); // End Menu Allocations and Handles
return 0;
}
void LocateDriver()
{
bool bStatus = false;
do
{
bStatus = Driver.OpenFile();
} while (!bStatus);
}