-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
315 lines (265 loc) · 10.6 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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#include <Windows.h>
#include "auth.hpp"
#include <string>
#include "utils.hpp"
#include "skStr.h"
#include "includes.hpp"
#include "SDK.hpp"
#include "Overwatch.hpp"
#include <io.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
std::string tm_to_readable_time(tm ctx);
static std::time_t string_to_timet(std::string timestamp);
static std::tm timet_to_tm(time_t timestamp);
const std::string compilation_date = (std::string)skCrypt(__DATE__);
const std::string compilation_time = (std::string)skCrypt(__TIME__);
/*using namespace KeyAuth;
auto name = skCrypt("Fart Life");
auto ownerid = skCrypt("f2xkEdn27f");
auto secret = skCrypt("db33eed6ce5518b451f4d209e4bcaa04a25a31e0be360d9d3e01f35011c12400");
auto version = skCrypt("1.0");
auto url = skCrypt("https://keyauth.win/api/1.2/"); */
void MainThread() {
using namespace OW;
std::cout << "Launch in Main Menu and go to Practice Range..\n";
while (!SDK->Initialize() || !SDK->GetGlobalKey())
{
std::cout << "Waiting Overwatch..\n";
Sleep(2000);
}
_beginthread((_beginthread_proc_type)entity_scan_thread, 0, 0);
Sleep(50);
_beginthread((_beginthread_proc_type)entity_thread, 0, 0);
_beginthread((_beginthread_proc_type)viewmatrix_thread, 0, 0);
Sleep(500);
_beginthread((_beginthread_proc_type)aimbot_thread, 0, 0);
_beginthread((_beginthread_proc_type)overlay_thread, 0, 0);
_beginthread((_beginthread_proc_type)configsavenloadthread, 0, 0);
Sleep(10);
_beginthread((_beginthread_proc_type)looprpmthread, 0, 0);
//_beginthread((_beginthread_proc_type)playmusicthread, 0, 0);
while (FindWindowA(skCrypt("TankWindowClass"), NULL))
{
auto viewMatrixVal = SDK->RPM<uint64_t>(SDK->dwGameBase + offset::Address_viewmatrix_base) ^ offset::offset_viewmatrix_xor_key;
viewMatrixVal = SDK->RPM<uint64_t>(viewMatrixVal + 0x5C0);
viewMatrixVal = SDK->RPM<uint64_t>(viewMatrixVal + 0x48);
//mutex.lock();
viewMatrix_xor_ptr = viewMatrixVal + 0x130;
//mutex.unlock();
auto view = SDK->RPM<uint64_t>(SDK->dwGameBase + offset::Address_viewmatrix_base_test) + offset::offset_viewmatrix_ptr;
//mutex.lock();
viewMatrixPtr = view;
//mutex.unlock();
//viewMatrixPtr = viewMatrix_xor_ptr;
Sleep(100);
}
}
/*
Video on what ownerid and secret are https://youtu.be/uJ0Umy_C6Fg
Video on how to add KeyAuth to your own application https://youtu.be/GB4XW_TsHqA
Video to use Web Loader (control loader from customer panel) https://youtu.be/9-qgmsUUCK4
*/
//api KeyAuthApp(name.decrypt(), ownerid.decrypt(), secret.decrypt(), version.decrypt(), url.decrypt());
int main()
{
if (!OW::Config::loginornot) MainThread();
std::string consoleTitle = (std::string)skCrypt("Loader - Built at: ") + compilation_date + " " + compilation_time;
SetConsoleTitleA(consoleTitle.c_str());
std::cout << skCrypt("\n\nConnecting to server..");
/*KeyAuthApp.init();
if (!KeyAuthApp.data.success)
{
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
//Optional - check if HWID or IP blacklisted
if (KeyAuthApp.checkblack()) {
abort();
}*/
//std::cout << skCrypt("\n\n App data:");
//std::cout << skCrypt("\n Number of users: ") << KeyAuthApp.data.numUsers;
//std::cout << skCrypt("\n Number of online users: ") << KeyAuthApp.data.numOnlineUsers;
//std::cout << skCrypt("\n Number of keys: ") << KeyAuthApp.data.numKeys;
//std::cout << skCrypt("\n 当前版本: ") << KeyAuthApp.data.version;
//std::cout << skCrypt("\n Loader Ready. ") << KeyAuthApp.data.version;
//std::cout << skCrypt("\n Customer panel link: ") << KeyAuthApp.data.customerPanelLink;
//std::cout << skCrypt("\n Checking session validation status (remove this if causing your loader to be slow)");
/*KeyAuthApp.check();
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
if (std::filesystem::exists(".\\test.json")) //change test.txt to the path of your file :smile:
{
if (!CheckIfJsonKeyExists(".\\test.json", "username"))
{
std::string key = ReadFromJson(".\\test.json", "license");
KeyAuthApp.license(key);
if (!KeyAuthApp.data.success)
{
std::remove(".\\test.json");
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
std::cout << skCrypt("\nAuto logging in...");
}
else
{
std::string username = ReadFromJson(".\\test.json", "username");
std::string password = ReadFromJson(".\\test.json", "password");
KeyAuthApp.login(username, password);
if (!KeyAuthApp.data.success)
{
std::remove(".\\test.json");
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
std::cout << skCrypt("\nSuccess");
}
KeyAuthApp.log("Locked.");
}
else
{
std::string username;
std::string password;
std::string key;
std::cout << skCrypt("\n Input Your Lisence: ");
std::cin >> key;
KeyAuthApp.license(key);
if (!KeyAuthApp.data.success)
{
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
if (username.empty() || password.empty())
{
WriteToJson(".\\test.json", "license", key, false, "", "");
std::cout << skCrypt("Created file.");
}
else
{
WriteToJson(".\\test.json", "username", username, true, "password", password);
std::cout << skCrypt("Created file.");
}
}
//std::cout << skCrypt("\n用户数据:");
//std::cout << skCrypt("\n Username: ") << KeyAuthApp.data.username;
//std::cout << skCrypt("\n IP地址: ") << KeyAuthApp.data.ip;
std::cout << skCrypt("\n\n HWID: ") << KeyAuthApp.data.hwid;
std::cout << skCrypt("\n Activated: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.data.createdate)));
//std::cout << skCrypt("\n 上一次登录: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.data.lastlogin)));
//std::cout << skCrypt("\n 卡密信息:\n ");
for (int i = 0; i < KeyAuthApp.data.subscriptions.size(); i++) { // Prompto#7895 was here
auto sub = KeyAuthApp.data.subscriptions.at(i);
//std::cout << skCrypt("\n name: ") << sub.name;
std::cout << skCrypt("Expires: ") << tm_to_readable_time(timet_to_tm(string_to_timet(sub.expiry)));
expiretime = string_to_timet(sub.expiry);
}
std::cout << skCrypt("\n Checking..");
KeyAuthApp.check();
std::cout << skCrypt("\n Status: ") << KeyAuthApp.data.message;
*/
#pragma region example functions
/*
// download file, change file.exe to whatever you want.
// remember, certain paths like windows folder will require you to turn on auto run as admin https://stackoverflow.com/a/19617989
std::vector<std::uint8_t> bytes = KeyAuthApp.download("362906");
if (!KeyAuthApp.data.success) // check whether file downloaded correctly
{
std::cout << skCrypt("\n\n Status: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
std::ofstream file("file.dll", std::ios_base::out | std::ios_base::binary);
file.write((char*)bytes.data(), bytes.size());
file.close();
*/
// KeyAuthApp.setvar("discord", "test#0001"); // set the value of user variable 'discord' to 'test#0001'
// std::string userVar = KeyAuthApp.getvar("discord");
// if (!KeyAuthApp.data.success) // check whether user variable exists and was retrieved correctly
// {
// std::cout << skCrypt("\n\n Status: ") << KeyAuthApp.data.message;
// Sleep(1500);
// exit(0);
// }
// std::cout << "\n user variable - " + userVar; // get value of the user variable 'discord'
/*
// let's say you want to send request to https://keyauth.win/api/seller/?sellerkey=f43795eb89d6060b74cdfc56978155ef&type=black&ip=1.1.1.1&hwid=abc
// but doing that from inside the loader is a bad idea as the link could get leaked.
// Instead, you should create a webhook with the https://keyauth.win/api/seller/?sellerkey=f43795eb89d6060b74cdfc56978155ef part as the URL
// then in your loader, put the rest of the link (the other paramaters) in your loader. And then it will send request from KeyAuth server and return response in string resp
// example to send normal request with no POST data
std::string resp = KeyAuthApp.webhook("5iZMT1f1XW", "?mak=best&debug=1");
// example to send form data
resp = KeyAuthApp.webhook("5iZMT1f1XW", "", "type=init&ver=1.0&name=test&ownerid=j9Gj0FTemM", "application/x-www-form-urlencoded");
// example to send JSON
resp = KeyAuthApp.webhook("5iZMT1f1XW", "", "{\"content\": \"webhook message here\",\"embeds\": null}", "application/json");
if (!KeyAuthApp.data.success) // check whether webhook request sent correctly
{
std::cout << skCrypt("\n\n Status: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
std::cout << "\n Response recieved from webhook request: " + resp;
*/
// get data from global variable with name 'status'
// std::cout << "\n status - " + KeyAuthApp.var("status");
// KeyAuthApp.log("user logged in"); // send event to logs. if you set discord webhook in app settings, it will send there instead of dashboard
// KeyAuthApp.ban(); // ban the current user, must be logged in
// KeyAuthApp.ban("Don't try to crack my loader, cunt."); // ban the current user (with a reason), must be logged in
/*
// allow users to communicate amongst each other with through KeyAuth. Thank you Nuss31#1102 for this C++ implementation
// send chat messages
std::cout << skCrypt("\n Type Chat message: ");
std::string message;
//getline is important cause cin alone stops captureing after a space
std::getline(std::cin, message);
if (!KeyAuthApp.chatsend("test", message))
{
std::cout << KeyAuthApp.data.message << std::endl;
}
// get chat messages
KeyAuthApp.chatget("test");
for (int i = 0; i < KeyAuthApp.data.channeldata.size(); i++)
{
std::cout << "\n Author:" + KeyAuthApp.data.channeldata[i].author + " | Message:" + KeyAuthApp.data.channeldata[i].message + " | Send Time:" + tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.data.channeldata[i].timestamp)));
}
*/
/*
// change username
// allow users to change their usernames when logged-in
std::cout << skCrypt("\n Change Username To: ");
std::string newusername;
std::cin >> newusername;
KeyAuthApp.changeusername(newusername);
if (KeyAuthApp.data.success)
{
std::cout << KeyAuthApp.data.message << std::endl;
}
*/
#pragma endregion Example on how to use KeyAuth functions
using namespace OW;
bool is_login = false;
std::string license{};
std::cout << "Loading functions..\n";
MainThread();
Sleep(10000);
exit(0);
}
std::string tm_to_readable_time(tm ctx) {
char buffer[80];
strftime(buffer, sizeof(buffer), "%a %m/%d/%y %H:%M:%S %Z", &ctx);
return std::string(buffer);
}
static std::time_t string_to_timet(std::string timestamp) {
auto cv = strtol(timestamp.c_str(), NULL, 10); // long
return (time_t)cv;
}
static std::tm timet_to_tm(time_t timestamp) {
std::tm context;
localtime_s(&context, ×tamp);
return context;
}