-
Notifications
You must be signed in to change notification settings - Fork 23
/
main.cpp
256 lines (218 loc) · 7.95 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
#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>
#include "USEVEH.h"
#include "menu.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;
HANDLE hMainThread;
CONTEXT c{};
std::string name = "imp"; // application name. right above the blurred text aka the secret on the licenses tab among other tabs
std::string ownerid = ""; // ownerid, found in account settings. click your profile picture on top right of dashboard and then account settings.
std::string secret = ""; // app secret, the blurred text on licenses tab and other tabs
std::string version = "3.5"; // leave alone unless you've changed version on website
std::string url = skCrypt("https://keyauth.win/api/1.2/").decrypt(); // change if you're self-hosting
void MainThread() {
using namespace OW;
/*while (!SDK->Initialize() || !SDK->GetGlobalKey())
{
std::cout << "等待开启守望先锋..\n";
Sleep(2000);
}*/
std::cout << skCrypt("Launch in MainMenu then Go to Practice Range...\n");
/*while (Config::got != 1) {
Sleep(1000);
}*/
while (!SDK->GetGlobalKey()) {
Sleep(10);
}
_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);
menu::Initialize();
_beginthread((_beginthread_proc_type)configsavenloadthread, 0, 0);
Sleep(10);
//_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 + 0x118);
//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, ownerid, secret, version, url);
int i = 0;
unsigned short tempyaw = 0;
unsigned short temppitch = 0;
DWORD WINAPI MainProject(LPVOID lpParam)
{
if (OW::Config::loginornot) {
std::string consoleTitle = (std::string)skCrypt("Loader - Built at: ") + compilation_date + " " + compilation_time;
SetConsoleTitleA(consoleTitle.c_str());
std::cout << skCrypt("\n\n连接服务器..");
KeyAuthApp.init();
if (!KeyAuthApp.data.success)
{
std::cout << skCrypt("\n 状态: ") << 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 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 状态: ") << 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("\n成功自动登入,若更换卡密请自行删除test.json");
}
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("\n成功自动登入");
}
KeyAuthApp.log("禁止顶号");
}
else
{
std::string username;
std::string password;
std::string key;
std::cout << skCrypt("\n 输入您的卡号: ");
std::cin >> key;
KeyAuthApp.license(key);
if (!KeyAuthApp.data.success)
{
std::cout << skCrypt("\n 状态: ") << KeyAuthApp.data.message;
Sleep(1500);
exit(0);
}
if (username.empty() || password.empty())
{
WriteToJson(".\\test.json", "license", key, false, "", "");
std::cout << skCrypt("成功创建自动登录文件,若更换卡密请自行删除");
}
else
{
WriteToJson(".\\test.json", "username", username, true, "password", password);
std::cout << skCrypt("成功创建自动登录文件,若更换卡密请自行删除");
}
}
std::cout << skCrypt("\n用户数据:");
//std::cout << skCrypt("\n Username: ") << KeyAuthApp.data.username;
std::cout << skCrypt("\n IP地址: ") << KeyAuthApp.data.ip;
std::cout << skCrypt("\n HWID: ") << KeyAuthApp.data.hwid;
std::cout << skCrypt("\n 激活日期: ") << 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("卡号过期日期: ") << tm_to_readable_time(timet_to_tm(string_to_timet(sub.expiry)));
expiretime = string_to_timet(sub.expiry);
}
std::cout << skCrypt("\n 检查激活状态..");
KeyAuthApp.check();
std::cout << skCrypt("\n 状态: ") << KeyAuthApp.data.message;
_beginthread((_beginthread_proc_type)OW::looprpmthread, 0, 0);
MainThread();
}
if (!OW::Config::loginornot) {
_beginthread((_beginthread_proc_type)OW::looprpmthread, 0, 0);
MainThread();
}
while (true) {}
return 0;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
AllocConsole();
freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
printf("Injected Successfully!\n");
DisableThreadLibraryCalls(hModule);
CreateThread(NULL, 0, MainProject, lpReserved, 0, NULL);
}
return 1;
using namespace OW;
bool is_login = false;
std::string license{};
std::cout << "Loading..\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;
}