forked from ctosvip/EclipsedSpoofer-EAC-BE
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUtil.h
231 lines (209 loc) · 7.09 KB
/
Util.h
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
#pragma once
#pragma once
// warnings
#define no_init_all deprecated
#pragma warning( disable : 4129 )
// sdk
#include <Windows.h>
#include <string>
#include <vector>
#include <unordered_map>
#include <thread>
#include <chrono>
#include <sstream>
#include <TlHelp32.h>
#include <Psapi.h>
#include <iostream>
#include <cassert>
#pragma warning(disable:4191 4099)
#pragma warning(disable:4996)
#define BLACK 0
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define MAGENTA 5
#define BROWN 6
#define LIGHTGRAY 7
#define DARKGRAY 8
#define LIGHTBLUE 9
#define LIGHTGREEN 10
#define LIGHTCYAN 11
#define LUGHTRED 12
#define LIGHTMAGENTA 13
#define YELLOW 14
#define WHITE 15
// lib
#pragma comment(lib, "ntdll.lib")
// vmprotect
// curl
// defines
#include <cstdio>
#pragma comment(lib, "Urlmon.lib")
#define stra(x) VMProtectDecryptStringA(x)
#include "api/KeyAuth.hpp"
#include "xorstr.hpp"
#include <cstdlib>
#include <fstream>
#include <ostream>
#include <filesystem>
#include "util.h"
#include "mapper/kdmapper.hpp"
#include <sys/stat.h>
#include <conio.h>
// xor
#include "xorstr.hpp"
// self
#include "api/KeyAuth.hpp"
#include "process.h"
namespace Util {
void SetColor(unsigned short color)
{
HANDLE con = 0;
con = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(con, color);
}
void Clear()
{
COORD topLeft = { 0, 0 };
HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO screen;
DWORD written;
GetConsoleScreenBufferInfo(console, &screen);
FillConsoleOutputCharacterA(console, ' ', screen.dwSize.X * screen.dwSize.Y, topLeft, &written);
FillConsoleOutputAttribute(console, FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE, screen.dwSize.X * screen.dwSize.Y, topLeft, &written);
SetConsoleCursorPosition(console, topLeft);
return;
}
void Command(const char* Command) {
system(Command);
}
void WriteLine(std::string text, int time = 1) {
std::cout << std::setw(35);
for (int i = 0; text[i] != '\0'; i++) {
Sleep(time);
std::cout << text[i];
if (text[i] == ' ')
Sleep(0);
}
}
void WriteCentered(std::string text, int time = 1) {
std::cout << std::setw(25);
for (int i = 0; text[i] != '\0'; i++) {
Sleep(time);
std::cout << text[i];
if (text[i] == ' ')
Sleep(0);
}
}
std::string GenRandomString(const int len) {
VMStart();
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"*'?=`´_:;-><\\=)(/&%$§\"{[]}"
"abcdefghijklmnopqrstuvwxyz";
std::string tmp_s;
tmp_s.reserve(len);
for (int i = 0; i < len; ++i) {
tmp_s += alphanum[rand() % (sizeof(alphanum) - 1)];
}
VMEnd();
return tmp_s;
}
DWORD NewVolume() {
VMStart();
auto randchar = []() -> char
{
const char charset[] =
"0123456789"
"ABCDEF";
const size_t max_index = (sizeof(charset) - 1);
return charset[rand() % max_index];
};
std::string str(8, 0);
std::generate_n(str.begin(), 8, randchar);
VMEnd();
return std::strtoul(str.c_str(), NULL, 16);
}
enum State { Detected, Undetected, Unknown};
void SetConsoleWindow(HANDLE conout, SHORT cols, SHORT rows)
{
VM_FISH_WHITE_START
CONSOLE_SCREEN_BUFFER_INFOEX sbInfoEx;
sbInfoEx.cbSize = sizeof(CONSOLE_SCREEN_BUFFER_INFOEX);
GetConsoleScreenBufferInfoEx(conout, &sbInfoEx);
sbInfoEx.dwSize.X = cols;
sbInfoEx.dwSize.Y = rows;
sbInfoEx.srWindow = { 0, 0, cols, rows };
sbInfoEx.dwMaximumWindowSize = { cols, rows };
SetConsoleScreenBufferInfoEx(conout, &sbInfoEx);
DWORD mode;
GetConsoleMode(conout, &mode);
mode &= ~ENABLE_WRAP_AT_EOL_OUTPUT;
SetConsoleMode(conout, mode);
VM_FISH_WHITE_END
}
void WriteStatus(std::string name, State state) {
SetColor(CYAN);
WriteLine((name + ": "));
switch (state) {
case Undetected: SetColor(GREEN); std::cout << "Undetected"; break;
case Detected: SetColor(RED); std::cout << "Detected"; break;
case Unknown: SetColor(YELLOW); std::cout << "Unknown"; break;
}
std::cout << std::endl;
}
int s_width = 888;
void Logo() {
std::cout << XorStr(R"(
:::::::: ::::::::: :::::::: :::::::: :::::::::: :::::::::: :::::::::
:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++#++ +#++:++#+ +#+ +:+ +#+ +:+ :#::+::# +#++:++# +#++:++#:
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ### ######## ######## ### ########## ### ###
)") << std::endl; '\n';
}
void CoolLogo() {
std::cout << XorStr(R"(
:::::::::: :::::::: ::: ::::::::::: ::::::::: :::::::: :::::::::: :::::::::
:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++# +#+ +#+ +#+ +#++:++#+ +#++:++#++ +#++:++# +#+ +:+
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
########## ######## ########## ########### ### ######## ########## #########
:::::::: ::::::::: :::::::: :::::::: :::::::::: :::::::::: :::::::::
:+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#++:++#++ +#++:++#+ +#+ +:+ +#+ +:+ :#::+::# +#++:++# +#++:++#:
+#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ### ######## ######## ### ########## ### ###
)") << std::endl; '\n';
}
void PrintMainMenu() {
Util::Clear();
Util::Logo();
Util::SetColor(CYAN);
Util::WriteLine(XorStr("\n =================================================================\n"), 0.6);
std::cout << std::endl;
Util::SetColor(LIGHTBLUE);
Util::WriteLine(XorStr("[1] Clean Tracking Files and Registry Values\n"));
Util::WriteLine(XorStr("[2] Spoof HWID\n"));
Util::WriteLine(XorStr("[3] Spoof Network\n"));
Util::WriteLine(XorStr("[4] Fix Windows License\n"));
Util::WriteLine(XorStr("[5] Help\n"));
Util::WriteLine(XorStr("[6] Check All Serials\n"));
Util::SetColor(CYAN);
std::cout << std::endl;
Util::WriteLine(XorStr("\n =================================================================\n"), 0.6);
std::cout << std::endl;
std::cout << std::endl;
std::cout << std::endl;
Util::WriteLine("Please choose an selection: ");
Util::SetColor(LIGHTBLUE);
}
}