├── Loader Base
├── Loader Base.sln
└── Loader Base
│ ├── Loader Base.vcxproj
│ ├── Loader Base.vcxproj.filters
│ ├── Loader Base.vcxproj.user
│ ├── includes.h
│ ├── main.cpp
│ ├── termcolor.h
│ ├── tool.cpp
│ └── tool.h
├── README.md
├── screenshots
├── pic1.png
├── pic2.png
└── pic3.png
└── web files
├── check.php
└── version.php
/Loader Base/Loader Base.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27428.2043
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Loader Base", "Loader Base\Loader Base.vcxproj", "{8DFC0718-C3C1-4AD8-AA21-C4878237C131}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Debug|x64.ActiveCfg = Debug|x64
17 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Debug|x64.Build.0 = Debug|x64
18 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Debug|x86.ActiveCfg = Debug|Win32
19 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Debug|x86.Build.0 = Debug|Win32
20 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Release|x64.ActiveCfg = Release|x64
21 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Release|x64.Build.0 = Release|x64
22 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Release|x86.ActiveCfg = Release|Win32
23 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}.Release|x86.Build.0 = Release|Win32
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | GlobalSection(ExtensibilityGlobals) = postSolution
29 | SolutionGuid = {E8B6704F-D45B-4B54-9D84-702BFF8BFF4B}
30 | EndGlobalSection
31 | EndGlobal
32 |
--------------------------------------------------------------------------------
/Loader Base/Loader Base/Loader Base.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | 15.0
23 | {8DFC0718-C3C1-4AD8-AA21-C4878237C131}
24 | LoaderBase
25 | 10.0.16299.0
26 |
27 |
28 |
29 | Application
30 | true
31 | v141
32 | MultiByte
33 |
34 |
35 | Application
36 | false
37 | v141
38 | true
39 | MultiByte
40 |
41 |
42 | Application
43 | true
44 | v141
45 | MultiByte
46 |
47 |
48 | Application
49 | false
50 | v141
51 | true
52 | MultiByte
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Level3
76 | Disabled
77 | true
78 | true
79 |
80 |
81 |
82 |
83 | Level3
84 | Disabled
85 | true
86 | true
87 |
88 |
89 |
90 |
91 | Level3
92 | MaxSpeed
93 | true
94 | true
95 | true
96 | true
97 |
98 |
99 | true
100 | true
101 |
102 |
103 |
104 |
105 | Level3
106 | MaxSpeed
107 | true
108 | true
109 | true
110 | true
111 |
112 |
113 | true
114 | true
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/Loader Base/Loader Base/Loader Base.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Archivos de origen
20 |
21 |
22 | Archivos de origen
23 |
24 |
25 |
26 |
27 | Archivos de encabezado
28 |
29 |
30 | Archivos de encabezado
31 |
32 |
33 | Archivos de encabezado
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Loader Base/Loader Base/Loader Base.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Loader Base/Loader Base/includes.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | using namespace std;
4 |
5 | #define _CRT_SECURE_NO_WARNINGS
6 | #define SECURITY_WIN32
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include < Winternl.h>
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 | #include
27 | #include
28 | #include
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 |
36 | #pragma comment(lib,"Winmm.lib")
37 | #pragma comment(lib,"Comctl32.lib")
38 | #pragma comment (lib,"Gdiplus.lib")
39 | #pragma comment (lib, "ws2_32.lib" )
40 | #pragma comment( lib, "Msimg32" )
41 | #pragma comment(lib, "IPHLPAPI.lib")
42 | #pragma comment(lib, "wininet")
43 | #pragma comment(lib, "Dbghelp.lib")
44 | #pragma comment (lib, "urlmon.lib")
45 | #pragma comment(lib, "ComCtl32.lib")
46 | #pragma comment(lib, "shlwapi.lib")
47 |
48 |
49 | #include "tool.h"
50 | #include "termcolor.h"
51 |
--------------------------------------------------------------------------------
/Loader Base/Loader Base/main.cpp:
--------------------------------------------------------------------------------
1 | // SIMPLE LOADER BASE
2 | // -----------------------------------------------
3 | // coded by https://github.com/quikk1 27/11/2018
4 | // :license: GNU GPL, see LICENSE for details.
5 | // -----------------------------------------------
6 |
7 | #define VERSION (string)"1.0.0" //PROGRAM VERSION!
8 | #define WEBSITE (string)"yourwebsite.com" // !!! CHANGE THIS TO YOUR DOMAIN !!!
9 |
10 | #include "includes.h"
11 |
12 | tool* tools;
13 |
14 | int main() {
15 |
16 |
17 |
18 | string username;
19 | string password;
20 |
21 | #ifdef NDEBUG //If not debug release
22 |
23 | tools->checkPrivileges(); //Checks is program is running with admin privileges.
24 | tools->checkInternet(); //Checks if the user is connected to internet.
25 |
26 |
27 | #endif // NDEBUG
28 |
29 | string check_version = tools->httpRequest(WEBSITE, "version.php"); //Gets version from website file using GET method.
30 |
31 | if (check_version == VERSION) { //Checks if version of program is equal to the latest.
32 |
33 | tools->setupConsole("Loader base", 400, 200); //Sets console title, width and heigth.
34 |
35 | tools->title(); // [[ cout << termcolor::green << "//---LOADER BASE---\\" << endl << endl; ]]
36 |
37 | tools->gotoxy(2, 3); cout << termcolor::magenta << "Username: " << termcolor::white;
38 |
39 | do { //Asks for username while string username is empty.
40 | tools->gotoxy(12, 3);
41 | getline(cin, username);
42 |
43 | } while (username.empty());
44 |
45 | tools->gotoxy(2, 4); cout << termcolor::magenta << "Pass: ";
46 |
47 | tools->toggleText(); //Hides text.
48 |
49 | do { //Asks for password while string password is empty.
50 |
51 | tools->gotoxy(8, 4);
52 | getline(cin, password);
53 |
54 | } while (password.empty());
55 |
56 | tools->toggleText(); //Makes text visible again.
57 |
58 | HW_PROFILE_INFO hwProfileInfo;
59 | string hwid;
60 |
61 | if (GetCurrentHwProfile(&hwProfileInfo)) { //If we can read hwProfileInfo
62 |
63 | hwid = hwProfileInfo.szHwProfileGuid; //Gets hwid
64 |
65 | char request[512];
66 | sprintf(request, "/check.php?username=%s&password=%s&hwid=%s", username.c_str(), password.c_str(), hwid.c_str());
67 |
68 | string login_response = tools->httpRequest(WEBSITE, request); //Makes HTTP GET with login credential.
69 |
70 | string first_response = login_response.substr(0, 1); // Substracts first digit (LOGIN) from response
71 | string second_response = login_response.substr(1, 2); // Substracts second digit (HWID) from response
72 |
73 | if (first_response == "1") { //If password is correct
74 |
75 | if (second_response == "1" || second_response == "3") { //If hwid is correct or is not set yet (It will set it)
76 |
77 | system("cls"); //Clears screen
78 | tools->toggleCursor(); //Toggles cursor
79 | tools->title();
80 |
81 | tools->gotoxy(2, 2); cout << termcolor::magenta << "1. Inject 1.dll";
82 | tools->gotoxy(2, 3); cout << termcolor::magenta << "2. Inject 2.dll";
83 | int key_chosen = _getch(); //Gets key pressed
84 |
85 | switch (key_chosen) {
86 |
87 | case '1': //If pressed 1
88 | system("cls");
89 | if (tools->downloadFile("yourwebsite.com/1.dll", "c://1.dll")) { //If downloaded DLL from website [[ !!! CHANGE FIRST PARAM TO YOUR WEBSITE !!! ]]
90 | tools->loadLibrary("notepad.exe", "c://1.dll"); //Injects DLL to process
91 | cout << "1.dll injected into notepad.exe";
92 | }
93 | else {
94 |
95 | int msgboxID = MessageBoxA(
96 | NULL,
97 | (LPCSTR)"Couldn't download DLL.",
98 | (LPCSTR)"Loader base",
99 | MB_OK
100 | );
101 | exit(-1);
102 |
103 | }
104 | break;
105 | case '2': //If pressed 2
106 | system("cls");
107 | if (tools->downloadFile("yourwebsite.com/2.dll", "c://2.dll")) { //If downloaded DLL from website [[ !!! CHANGE FIRST PARAM TO YOUR WEBSITE !!! ]]
108 | tools->loadLibrary("notepad.exe", "c://2.dll"); //Injects DLL to process
109 | cout << "2.dll injected";
110 | }
111 | else {
112 |
113 | int msgboxID = MessageBoxA(
114 | NULL,
115 | (LPCSTR)"Couldn't download DLL.",
116 | (LPCSTR)"Loader base",
117 | MB_OK
118 | );
119 | exit(-1);
120 |
121 | }
122 | break;
123 | }
124 |
125 |
126 | Sleep(2000);
127 | exit(-1);
128 |
129 | }
130 | else {
131 |
132 | int msgboxID = MessageBoxA(
133 | NULL,
134 | (LPCSTR)"Wrong HWID.",
135 | (LPCSTR)"Loader base",
136 | MB_OK
137 | );
138 | exit(-1);
139 |
140 | }
141 |
142 | }
143 | else {
144 |
145 | int msgboxID = MessageBoxA(
146 | NULL,
147 | (LPCSTR)"Wrong password.",
148 | (LPCSTR)"Loader base",
149 | MB_OK
150 | );
151 | exit(-1);
152 |
153 | }
154 |
155 | }
156 | else {
157 |
158 | int msgboxID = MessageBoxA(
159 | NULL,
160 | (LPCSTR)"Couldn't read hwid.",
161 | (LPCSTR)"Loader base",
162 | MB_OK
163 | );
164 | exit(-1);
165 |
166 | }
167 |
168 |
169 | }
170 | else {
171 |
172 | int msgboxID = MessageBoxA(
173 | NULL,
174 | (LPCSTR)"There is a new version avaiable, please download it.",
175 | (LPCSTR)"Loader base",
176 | MB_OK
177 | );
178 | exit(-1);
179 |
180 | }
181 |
182 | return 0;
183 | }
--------------------------------------------------------------------------------
/Loader Base/Loader Base/termcolor.h:
--------------------------------------------------------------------------------
1 | //!
2 | //! termcolor
3 | //! ~~~~~~~~~
4 | //!
5 | //! termcolor is a header-only c++ library for printing colored messages
6 | //! to the terminal. Written just for fun with a help of the Force.
7 | //!
8 | //! :copyright: (c) 2013 by Ihor Kalnytskyi
9 | //! :license: BSD, see LICENSE for details
10 | //!
11 |
12 | #ifndef TERMCOLOR_HPP_
13 | #define TERMCOLOR_HPP_
14 |
15 | // the following snippet of code detects the current OS and
16 | // defines the appropriate macro that is used to wrap some
17 | // platform specific things
18 | #if defined(_WIN32) || defined(_WIN64)
19 | # define TERMCOLOR_OS_WINDOWS
20 | #elif defined(__APPLE__)
21 | # define TERMCOLOR_OS_MACOS
22 | #elif defined(__unix__) || defined(__unix)
23 | # define TERMCOLOR_OS_LINUX
24 | #else
25 | # error unsupported platform
26 | #endif
27 |
28 |
29 | // This headers provides the `isatty()`/`fileno()` functions,
30 | // which are used for testing whether a standart stream refers
31 | // to the terminal. As for Windows, we also need WinApi funcs
32 | // for changing colors attributes of the terminal.
33 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
34 | # include
35 | #elif defined(TERMCOLOR_OS_WINDOWS)
36 | # include
37 | # include
38 | #endif
39 |
40 |
41 | #include
42 | #include
43 |
44 |
45 |
46 | namespace termcolor
47 | {
48 | // Forward declaration of the `_internal` namespace.
49 | // All comments are below.
50 | namespace _internal
51 | {
52 | // An index to be used to access a private storage of I/O streams. See
53 | // colorize / nocolorize I/O manipulators for details.
54 | static int colorize_index = std::ios_base::xalloc();
55 |
56 | inline FILE* get_standard_stream(const std::ostream& stream);
57 | inline bool is_colorized(std::ostream& stream);
58 | inline bool is_atty(const std::ostream& stream);
59 |
60 | #if defined(TERMCOLOR_OS_WINDOWS)
61 | inline void win_change_attributes(std::ostream& stream, int foreground, int background = -1);
62 | #endif
63 | }
64 |
65 | inline
66 | std::ostream& colorize(std::ostream& stream)
67 | {
68 | stream.iword(_internal::colorize_index) = 1L;
69 | return stream;
70 | }
71 |
72 | inline
73 | std::ostream& nocolorize(std::ostream& stream)
74 | {
75 | stream.iword(_internal::colorize_index) = 0L;
76 | return stream;
77 | }
78 |
79 | inline
80 | std::ostream& reset(std::ostream& stream)
81 | {
82 | if (_internal::is_colorized(stream))
83 | {
84 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
85 | stream << "\033[00m";
86 | #elif defined(TERMCOLOR_OS_WINDOWS)
87 | _internal::win_change_attributes(stream, -1, -1);
88 | #endif
89 | }
90 | return stream;
91 | }
92 |
93 |
94 | inline
95 | std::ostream& bold(std::ostream& stream)
96 | {
97 | if (_internal::is_colorized(stream))
98 | {
99 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
100 | stream << "\033[1m";
101 | #elif defined(TERMCOLOR_OS_WINDOWS)
102 | #endif
103 | }
104 | return stream;
105 | }
106 |
107 |
108 | inline
109 | std::ostream& dark(std::ostream& stream)
110 | {
111 | if (_internal::is_colorized(stream))
112 | {
113 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
114 | stream << "\033[2m";
115 | #elif defined(TERMCOLOR_OS_WINDOWS)
116 | #endif
117 | }
118 | return stream;
119 | }
120 |
121 |
122 | inline
123 | std::ostream& underline(std::ostream& stream)
124 | {
125 | if (_internal::is_colorized(stream))
126 | {
127 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
128 | stream << "\033[4m";
129 | #elif defined(TERMCOLOR_OS_WINDOWS)
130 | #endif
131 | }
132 | return stream;
133 | }
134 |
135 |
136 | inline
137 | std::ostream& blink(std::ostream& stream)
138 | {
139 | if (_internal::is_colorized(stream))
140 | {
141 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
142 | stream << "\033[5m";
143 | #elif defined(TERMCOLOR_OS_WINDOWS)
144 | #endif
145 | }
146 | return stream;
147 | }
148 |
149 |
150 | inline
151 | std::ostream& reverse(std::ostream& stream)
152 | {
153 | if (_internal::is_colorized(stream))
154 | {
155 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
156 | stream << "\033[7m";
157 | #elif defined(TERMCOLOR_OS_WINDOWS)
158 | #endif
159 | }
160 | return stream;
161 | }
162 |
163 |
164 | inline
165 | std::ostream& concealed(std::ostream& stream)
166 | {
167 | if (_internal::is_colorized(stream))
168 | {
169 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
170 | stream << "\033[8m";
171 | #elif defined(TERMCOLOR_OS_WINDOWS)
172 | #endif
173 | }
174 | return stream;
175 | }
176 |
177 |
178 | inline
179 | std::ostream& grey(std::ostream& stream)
180 | {
181 | if (_internal::is_colorized(stream))
182 | {
183 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
184 | stream << "\033[30m";
185 | #elif defined(TERMCOLOR_OS_WINDOWS)
186 | _internal::win_change_attributes(stream,
187 | 0 // grey (black)
188 | );
189 | #endif
190 | }
191 | return stream;
192 | }
193 |
194 | inline
195 | std::ostream& red(std::ostream& stream)
196 | {
197 | if (_internal::is_colorized(stream))
198 | {
199 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
200 | stream << "\033[31m";
201 | #elif defined(TERMCOLOR_OS_WINDOWS)
202 | _internal::win_change_attributes(stream,
203 | FOREGROUND_RED
204 | );
205 | #endif
206 | }
207 | return stream;
208 | }
209 |
210 | inline
211 | std::ostream& green(std::ostream& stream)
212 | {
213 | if (_internal::is_colorized(stream))
214 | {
215 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
216 | stream << "\033[32m";
217 | #elif defined(TERMCOLOR_OS_WINDOWS)
218 | _internal::win_change_attributes(stream,
219 | FOREGROUND_GREEN
220 | );
221 | #endif
222 | }
223 | return stream;
224 | }
225 |
226 | inline
227 | std::ostream& yellow(std::ostream& stream)
228 | {
229 | if (_internal::is_colorized(stream))
230 | {
231 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
232 | stream << "\033[33m";
233 | #elif defined(TERMCOLOR_OS_WINDOWS)
234 | _internal::win_change_attributes(stream,
235 | FOREGROUND_GREEN | FOREGROUND_RED
236 | );
237 | #endif
238 | }
239 | return stream;
240 | }
241 |
242 | inline
243 | std::ostream& blue(std::ostream& stream)
244 | {
245 | if (_internal::is_colorized(stream))
246 | {
247 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
248 | stream << "\033[34m";
249 | #elif defined(TERMCOLOR_OS_WINDOWS)
250 | _internal::win_change_attributes(stream,
251 | FOREGROUND_BLUE
252 | );
253 | #endif
254 | }
255 | return stream;
256 | }
257 |
258 | inline
259 | std::ostream& magenta(std::ostream& stream)
260 | {
261 | if (_internal::is_colorized(stream))
262 | {
263 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
264 | stream << "\033[35m";
265 | #elif defined(TERMCOLOR_OS_WINDOWS)
266 | _internal::win_change_attributes(stream,
267 | FOREGROUND_BLUE | FOREGROUND_RED
268 | );
269 | #endif
270 | }
271 | return stream;
272 | }
273 |
274 | inline
275 | std::ostream& cyan(std::ostream& stream)
276 | {
277 | if (_internal::is_colorized(stream))
278 | {
279 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
280 | stream << "\033[36m";
281 | #elif defined(TERMCOLOR_OS_WINDOWS)
282 | _internal::win_change_attributes(stream,
283 | FOREGROUND_BLUE | FOREGROUND_GREEN
284 | );
285 | #endif
286 | }
287 | return stream;
288 | }
289 |
290 | inline
291 | std::ostream& white(std::ostream& stream)
292 | {
293 | if (_internal::is_colorized(stream))
294 | {
295 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
296 | stream << "\033[37m";
297 | #elif defined(TERMCOLOR_OS_WINDOWS)
298 | _internal::win_change_attributes(stream,
299 | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED
300 | );
301 | #endif
302 | }
303 | return stream;
304 | }
305 |
306 |
307 |
308 | inline
309 | std::ostream& on_grey(std::ostream& stream)
310 | {
311 | if (_internal::is_colorized(stream))
312 | {
313 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
314 | stream << "\033[40m";
315 | #elif defined(TERMCOLOR_OS_WINDOWS)
316 | _internal::win_change_attributes(stream, -1,
317 | 0 // grey (black)
318 | );
319 | #endif
320 | }
321 | return stream;
322 | }
323 |
324 | inline
325 | std::ostream& on_red(std::ostream& stream)
326 | {
327 | if (_internal::is_colorized(stream))
328 | {
329 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
330 | stream << "\033[41m";
331 | #elif defined(TERMCOLOR_OS_WINDOWS)
332 | _internal::win_change_attributes(stream, -1,
333 | BACKGROUND_RED
334 | );
335 | #endif
336 | }
337 | return stream;
338 | }
339 |
340 | inline
341 | std::ostream& on_green(std::ostream& stream)
342 | {
343 | if (_internal::is_colorized(stream))
344 | {
345 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
346 | stream << "\033[42m";
347 | #elif defined(TERMCOLOR_OS_WINDOWS)
348 | _internal::win_change_attributes(stream, -1,
349 | BACKGROUND_GREEN
350 | );
351 | #endif
352 | }
353 | return stream;
354 | }
355 |
356 | inline
357 | std::ostream& on_yellow(std::ostream& stream)
358 | {
359 | if (_internal::is_colorized(stream))
360 | {
361 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
362 | stream << "\033[43m";
363 | #elif defined(TERMCOLOR_OS_WINDOWS)
364 | _internal::win_change_attributes(stream, -1,
365 | BACKGROUND_GREEN | BACKGROUND_RED
366 | );
367 | #endif
368 | }
369 | return stream;
370 | }
371 |
372 | inline
373 | std::ostream& on_blue(std::ostream& stream)
374 | {
375 | if (_internal::is_colorized(stream))
376 | {
377 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
378 | stream << "\033[44m";
379 | #elif defined(TERMCOLOR_OS_WINDOWS)
380 | _internal::win_change_attributes(stream, -1,
381 | BACKGROUND_BLUE
382 | );
383 | #endif
384 | }
385 | return stream;
386 | }
387 |
388 | inline
389 | std::ostream& on_magenta(std::ostream& stream)
390 | {
391 | if (_internal::is_colorized(stream))
392 | {
393 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
394 | stream << "\033[45m";
395 | #elif defined(TERMCOLOR_OS_WINDOWS)
396 | _internal::win_change_attributes(stream, -1,
397 | BACKGROUND_BLUE | BACKGROUND_RED
398 | );
399 | #endif
400 | }
401 | return stream;
402 | }
403 |
404 | inline
405 | std::ostream& on_cyan(std::ostream& stream)
406 | {
407 | if (_internal::is_colorized(stream))
408 | {
409 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
410 | stream << "\033[46m";
411 | #elif defined(TERMCOLOR_OS_WINDOWS)
412 | _internal::win_change_attributes(stream, -1,
413 | BACKGROUND_GREEN | BACKGROUND_BLUE
414 | );
415 | #endif
416 | }
417 | return stream;
418 | }
419 |
420 | inline
421 | std::ostream& on_white(std::ostream& stream)
422 | {
423 | if (_internal::is_colorized(stream))
424 | {
425 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
426 | stream << "\033[47m";
427 | #elif defined(TERMCOLOR_OS_WINDOWS)
428 | _internal::win_change_attributes(stream, -1,
429 | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_RED
430 | );
431 | #endif
432 | }
433 |
434 | return stream;
435 | }
436 |
437 |
438 |
439 | //! Since C++ hasn't a way to hide something in the header from
440 | //! the outer access, I have to introduce this namespace which
441 | //! is used for internal purpose and should't be access from
442 | //! the user code.
443 | namespace _internal
444 | {
445 | //! Since C++ hasn't a true way to extract stream handler
446 | //! from the a given `std::ostream` object, I have to write
447 | //! this kind of hack.
448 | inline
449 | FILE* get_standard_stream(const std::ostream& stream)
450 | {
451 | if (&stream == &std::cout)
452 | return stdout;
453 | else if ((&stream == &std::cerr) || (&stream == &std::clog))
454 | return stderr;
455 |
456 | return 0;
457 | }
458 |
459 | // Say whether a given stream should be colorized or not. It's always
460 | // true for ATTY streams and may be true for streams marked with
461 | // colorize flag.
462 | inline
463 | bool is_colorized(std::ostream& stream)
464 | {
465 | return is_atty(stream) || static_cast(stream.iword(colorize_index));
466 | }
467 |
468 | //! Test whether a given `std::ostream` object refers to
469 | //! a terminal.
470 | inline
471 | bool is_atty(const std::ostream& stream)
472 | {
473 | FILE* std_stream = get_standard_stream(stream);
474 |
475 | // Unfortunately, fileno() ends with segmentation fault
476 | // if invalid file descriptor is passed. So we need to
477 | // handle this case gracefully and assume it's not a tty
478 | // if standard stream is not detected, and 0 is returned.
479 | if (!std_stream)
480 | return false;
481 |
482 | #if defined(TERMCOLOR_OS_MACOS) || defined(TERMCOLOR_OS_LINUX)
483 | return ::isatty(fileno(std_stream));
484 | #elif defined(TERMCOLOR_OS_WINDOWS)
485 | return ::_isatty(_fileno(std_stream));
486 | #endif
487 | }
488 |
489 | #if defined(TERMCOLOR_OS_WINDOWS)
490 | //! Change Windows Terminal colors attribute. If some
491 | //! parameter is `-1` then attribute won't changed.
492 | inline void win_change_attributes(std::ostream& stream, int foreground, int background)
493 | {
494 | // yeah, i know.. it's ugly, it's windows.
495 | static WORD defaultAttributes = 0;
496 |
497 | // Windows doesn't have ANSI escape sequences and so we use special
498 | // API to change Terminal output color. That means we can't
499 | // manipulate colors by means of "std::stringstream" and hence
500 | // should do nothing in this case.
501 | if (!_internal::is_atty(stream))
502 | return;
503 |
504 | // get terminal handle
505 | HANDLE hTerminal = INVALID_HANDLE_VALUE;
506 | if (&stream == &std::cout)
507 | hTerminal = GetStdHandle(STD_OUTPUT_HANDLE);
508 | else if (&stream == &std::cerr)
509 | hTerminal = GetStdHandle(STD_ERROR_HANDLE);
510 |
511 | // save default terminal attributes if it unsaved
512 | if (!defaultAttributes)
513 | {
514 | CONSOLE_SCREEN_BUFFER_INFO info;
515 | if (!GetConsoleScreenBufferInfo(hTerminal, &info))
516 | return;
517 | defaultAttributes = info.wAttributes;
518 | }
519 |
520 | // restore all default settings
521 | if (foreground == -1 && background == -1)
522 | {
523 | SetConsoleTextAttribute(hTerminal, defaultAttributes);
524 | return;
525 | }
526 |
527 | // get current settings
528 | CONSOLE_SCREEN_BUFFER_INFO info;
529 | if (!GetConsoleScreenBufferInfo(hTerminal, &info))
530 | return;
531 |
532 | if (foreground != -1)
533 | {
534 | info.wAttributes &= ~(info.wAttributes & 0x0F);
535 | info.wAttributes |= static_cast(foreground);
536 | }
537 |
538 | if (background != -1)
539 | {
540 | info.wAttributes &= ~(info.wAttributes & 0xF0);
541 | info.wAttributes |= static_cast(background);
542 | }
543 |
544 | SetConsoleTextAttribute(hTerminal, info.wAttributes);
545 | }
546 | #endif // TERMCOLOR_OS_WINDOWS
547 |
548 | } // namespace _internal
549 |
550 | } // namespace termcolor
551 |
552 |
553 | #undef TERMCOLOR_OS_WINDOWS
554 | #undef TERMCOLOR_OS_MACOS
555 | #undef TERMCOLOR_OS_LINUX
556 |
557 | #endif // TERMCOLOR_HPP_
--------------------------------------------------------------------------------
/Loader Base/Loader Base/tool.cpp:
--------------------------------------------------------------------------------
1 | #include "includes.h"
2 | #include "tool.h"
3 | #include "termcolor.h"
4 | #include
5 | using namespace std;
6 |
7 | tool::tool()
8 | {
9 | }
10 |
11 |
12 | tool::~tool()
13 | {
14 | }
15 |
16 | void tool::set_console(int w, int h) {
17 |
18 | HWND console = GetConsoleWindow();
19 | RECT r;
20 | GetWindowRect(console, &r);
21 |
22 | MoveWindow(console, r.left, r.top, w, h, TRUE);
23 | }
24 | void tool::checkInternet() {
25 |
26 | if (!InternetCheckConnectionA((LPCSTR)"http://www.google.com", FLAG_ICC_FORCE_CONNECTION, 0) && !InternetCheckConnectionA((LPCSTR)"http://www.facebook.com", FLAG_ICC_FORCE_CONNECTION, 0)) {
27 |
28 | int msgboxID = MessageBoxA(
29 | NULL,
30 | (LPCSTR)"There is a new version avaiable.",
31 | (LPCSTR)"Error",
32 | MB_OK
33 | );
34 |
35 | exit(-1);
36 |
37 | }
38 | }
39 |
40 | int tool::GetProcessIdByName(const std::string& p_name)
41 | {
42 | HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
43 | PROCESSENTRY32 structprocsnapshot = { 0 };
44 |
45 | structprocsnapshot.dwSize = sizeof(PROCESSENTRY32);
46 |
47 | if (snapshot == INVALID_HANDLE_VALUE)return 0;
48 | if (Process32First(snapshot, &structprocsnapshot) == FALSE)return 0;
49 |
50 | while (Process32Next(snapshot, &structprocsnapshot))
51 | {
52 | if (!strcmp(structprocsnapshot.szExeFile, p_name.c_str()))
53 | {
54 | CloseHandle(snapshot);
55 | return structprocsnapshot.th32ProcessID;
56 | }
57 | }
58 | CloseHandle(snapshot);
59 | return 0;
60 |
61 | }
62 |
63 | string tool::httpRequest(string site, string param)
64 | {
65 | HINTERNET hInternet = InternetOpenW(L"User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);
66 |
67 | if (hInternet == NULL)
68 | {
69 | return "InternetOpenW failed(hInternet): " + GetLastError();
70 | }
71 | else
72 | {
73 | wstring widestr;
74 | for (int i = 0; i < site.length(); ++i)
75 | {
76 | widestr += wchar_t(site[i]);
77 | }
78 | const wchar_t* site_name = widestr.c_str();
79 |
80 | wstring widestr2;
81 | for (int i = 0; i < param.length(); ++i)
82 | {
83 | widestr2 += wchar_t(param[i]);
84 | }
85 | const wchar_t* site_param = widestr2.c_str();
86 |
87 |
88 |
89 | HINTERNET hConnect = InternetConnectW(hInternet, site_name, 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, NULL);
90 |
91 | if (hConnect == NULL)
92 | {
93 | return "InternetConnectW failed(hConnect == NULL): " + GetLastError();
94 | }
95 | else
96 | {
97 | const wchar_t* parrAcceptTypes[] = { L"text/*", NULL };
98 |
99 | HINTERNET hRequest = HttpOpenRequestW(hConnect, L"GET", site_param, NULL, NULL, parrAcceptTypes, 0, 0);
100 |
101 | if (hRequest == NULL)
102 | {
103 | return "HttpOpenRequestW failed(hRequest == NULL): " + GetLastError();
104 | }
105 | else
106 | {
107 | BOOL bRequestSent = HttpSendRequestW(hRequest, NULL, 0, NULL, 0);
108 |
109 | if (!bRequestSent)
110 | {
111 | return "!bRequestSent HttpSendRequestW failed with error code " + GetLastError();
112 | }
113 | else
114 | {
115 | std::string strResponse;
116 | const int nBuffSize = 1024;
117 | char buff[nBuffSize];
118 |
119 | BOOL bKeepReading = true;
120 | DWORD dwBytesRead = -1;
121 |
122 | while (bKeepReading && dwBytesRead != 0)
123 | {
124 | bKeepReading = InternetReadFile(hRequest, buff, nBuffSize, &dwBytesRead);
125 | strResponse.append(buff, dwBytesRead);
126 | }
127 | return strResponse;
128 | }
129 | InternetCloseHandle(hRequest);
130 | }
131 | InternetCloseHandle(hConnect);
132 | }
133 | InternetCloseHandle(hInternet);
134 | }
135 | }
136 |
137 | bool tool::downloadFile(string url, string filepath) {
138 |
139 | DeleteUrlCacheEntry(url.c_str());
140 |
141 | HRESULT hr = URLDownloadToFile(
142 | NULL,
143 | url.c_str(),
144 | filepath.c_str(),
145 | 0,
146 | NULL);
147 |
148 | if (SUCCEEDED(hr))
149 | return true;
150 | else
151 | return false;
152 |
153 | }
154 |
155 |
156 | void tool::loadLibrary(string process, string dllpath) {
157 |
158 | DWORD dwProc = GetProcessIdByName(process);
159 |
160 | HANDLE hProc = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, dwProc);
161 |
162 | LPVOID allocMem = VirtualAllocEx(hProc, NULL, sizeof(dllpath), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
163 |
164 | WriteProcessMemory(hProc, allocMem, dllpath.c_str(), sizeof(dllpath), NULL);
165 |
166 | CreateRemoteThread(hProc, 0, 0, (LPTHREAD_START_ROUTINE)LoadLibrary, allocMem, 0, 0);
167 |
168 | CloseHandle(hProc);
169 |
170 | }
171 |
172 |
173 | void tool::checkPrivileges() {
174 |
175 |
176 | bool IsRunningAsAdmin = false;
177 |
178 | BOOL fRet = FALSE;
179 | HANDLE hToken = NULL;
180 | if (OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &hToken)) {
181 | TOKEN_ELEVATION Elevation;
182 | DWORD cbSize = sizeof(TOKEN_ELEVATION);
183 | if (GetTokenInformation(hToken, TokenElevation, &Elevation, sizeof(Elevation), &cbSize)) {
184 | fRet = Elevation.TokenIsElevated;
185 | }
186 | }
187 | if (hToken) {
188 | CloseHandle(hToken);
189 | }
190 | IsRunningAsAdmin = fRet;
191 |
192 | if (!IsRunningAsAdmin) {
193 |
194 | int msgboxID = MessageBoxA(
195 | NULL,
196 | (LPCSTR)"Please, run as admin.",
197 | (LPCSTR)"Error",
198 | MB_OK
199 | );
200 | exit(-1);
201 |
202 |
203 | }
204 |
205 | }
206 |
207 | void tool::setupConsole(string consoletitle, int w, int h) {
208 |
209 | SetConsoleTitleA(consoletitle.c_str());
210 | set_console(w, h);
211 |
212 |
213 | }
214 | void tool::title() {
215 |
216 | cout << termcolor::green << "//---LOADER BASE---\\" << endl << endl;
217 |
218 | }
219 |
220 | void tool::toggleText() {
221 |
222 | HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
223 | DWORD mode = 0;
224 |
225 | GetConsoleMode(hStdin, &mode);
226 | SetConsoleMode(hStdin, mode & (~ENABLE_ECHO_INPUT));
227 |
228 | }
229 |
230 | void tool::gotoxy(int x, int y) {
231 |
232 | HANDLE hCon;
233 | hCon = GetStdHandle(STD_OUTPUT_HANDLE);
234 | COORD dwPos;
235 | dwPos.X = x;
236 | dwPos.Y = y;
237 |
238 | SetConsoleCursorPosition(hCon, dwPos);
239 |
240 |
241 | }
242 |
243 | void tool::toggleCursor() {
244 |
245 | HANDLE hCon;
246 | hCon = GetStdHandle(STD_OUTPUT_HANDLE);
247 | CONSOLE_CURSOR_INFO cci;
248 | cci.dwSize = 1;
249 | cci.bVisible = FALSE;
250 |
251 | SetConsoleCursorInfo(hCon, &cci);
252 |
253 | }
254 |
--------------------------------------------------------------------------------
/Loader Base/Loader Base/tool.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | class tool
5 | {
6 | public:
7 |
8 |
9 | void set_console(int w, int h);
10 | void gotoxy(int x, int y);
11 | void toggleCursor();
12 | void setupConsole(std::string consoletitle, int w, int h);
13 | void title();
14 | void checkInternet();
15 | int GetProcessIdByName(const std::string& p_name);
16 | string httpRequest(string site, string param);
17 | void checkPrivileges();
18 | void toggleText();
19 | bool downloadFile(string url, string filepath);
20 | void loadLibrary(string process, string dllpath);
21 |
22 | tool();
23 | ~tool();
24 | };
25 |
26 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple C++ DLL loader.
2 |
3 | The whole code is commented to help beginners.
4 |
5 | You'll find here:
6 | -Program privileges check.
7 | -Internet connection check.
8 | -Program version check.
9 | -Login without mysqlconn.
10 | -szHwProfileGuid login system.
11 | -Download DLL from website.
12 | -Inject DLL using LoadLibrary
13 |
14 | Screenshots:
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/screenshots/pic1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quikk1/console-loader-base/2d2ff18de57f16358d421d8646f3095e7b0b6776/screenshots/pic1.png
--------------------------------------------------------------------------------
/screenshots/pic2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quikk1/console-loader-base/2d2ff18de57f16358d421d8646f3095e7b0b6776/screenshots/pic2.png
--------------------------------------------------------------------------------
/screenshots/pic3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/quikk1/console-loader-base/2d2ff18de57f16358d421d8646f3095e7b0b6776/screenshots/pic3.png
--------------------------------------------------------------------------------
/web files/check.php:
--------------------------------------------------------------------------------
1 | query($sql);
12 |
13 | if ($result->num_rows > 0) {
14 | // Outputting the rows
15 | while($row = $result->fetch_assoc())
16 | {
17 |
18 | $password = $row['password'];
19 |
20 | $sql_pass = $_GET['password'];
21 |
22 | function Redirect($url, $permanent = false)
23 | {
24 | if (headers_sent() === false)
25 | {
26 | header('Location: ' . $url, true, ($permanent === true) ? 301 : 302);
27 | }
28 | exit();
29 | }
30 |
31 | if($sql_pass !== $row['password'])
32 | {
33 | echo "0"; // pass is wrong
34 | }
35 | else
36 | {
37 | echo "1"; // pass is correct
38 | }
39 |
40 | if (strlen($row['hwid']) > 1)
41 | {
42 | if ($hwid !== $row['hwid'])
43 | {
44 | echo "2"; // hwid is wrong
45 | }
46 | else
47 | {
48 | echo "1"; // hwid is correct
49 | }
50 | }
51 | else
52 | {
53 | $sql = "UPDATE ". $tables ." SET hwid='$hwid' WHERE username='$user'";
54 | if(mysqli_query($link, $sql))
55 | {
56 | echo $row['hwid'];
57 | echo "3"; // sets hwid
58 | }
59 | else
60 | {
61 | echo "4"; // rest of errors
62 | }
63 | }
64 | }
65 | }
66 | ?>
67 |
--------------------------------------------------------------------------------
/web files/version.php:
--------------------------------------------------------------------------------
1 | 0.0.1
--------------------------------------------------------------------------------