@@ -155,13 +155,6 @@ void KeyAuth::api::init()
155
155
if ((hasher (result ^ 0xA5A5 ) & 0xFFFF ) == (expectedHash & 0xFFFF ))
156
156
{
157
157
auto json = response_decoder.parse (response);
158
- if (json[(XorStr (" ownerid" ))] != ownerid) {
159
- LI_FN (exit)(8 );
160
- }
161
-
162
- std::string message = json[(XorStr (" message" ))];
163
-
164
- load_response_data (json);
165
158
166
159
if (json[(XorStr (" ownerid" ))] != ownerid) {
167
160
LI_FN (exit)(8 );
@@ -188,6 +181,7 @@ void KeyAuth::api::init()
188
181
else if (json[(XorStr (" message" ))] == XorStr (" invalidver" ))
189
182
{
190
183
std::string dl = json[(XorStr (" download" ))];
184
+ api::app_data.downloadLink = json[XorStr (" download" )];
191
185
if (dl == " " )
192
186
{
193
187
MessageBoxA (0 , XorStr (" Version in the loader does match the one on the dashboard, and the download link on dashboard is blank.\n\n To fix this, either fix the loader so it matches the version on the dashboard. Or if you intended for it to have different versions, update the download link on dashboard so it will auto-update correctly." ).c_str (), NULL , MB_ICONERROR);
@@ -290,26 +284,6 @@ void KeyAuth::api::login(std::string username, std::string password, std::string
290
284
file.close ();
291
285
}
292
286
293
- std::string message = json[(XorStr (" message" ))];
294
-
295
- std::hash<int > hasher;
296
- size_t expectedHash = hasher (68 );
297
- size_t resultCode = hasher (json[(XorStr (" code" ))]);
298
-
299
- if (!json[(XorStr (" success" ))] || (json[(XorStr (" success" ))] && (resultCode == expectedHash))) {
300
- load_response_data (json);
301
- if (json[(XorStr (" success" ))])
302
- load_user_data (json[(XorStr (" info" ))]);
303
-
304
- if (api::response.message != XorStr (" Initialized" ).c_str ()) {
305
- LI_FN (GlobalAddAtomA)(seed.c_str ());
306
-
307
- std::string file_path = XorStr (" C:\\ ProgramData\\ " ).c_str () + seed;
308
- std::ofstream file (file_path);
309
- if (file.is_open ()) {
310
- file << seed;
311
- file.close ();
312
- }
313
287
std::string regPath = XorStr (" Software\\ " ).c_str () + seed;
314
288
HKEY hKey;
315
289
LONG result = RegCreateKeyExA (HKEY_CURRENT_USER, regPath.c_str (), 0 , NULL , 0 , KEY_WRITE, NULL , &hKey, NULL );
@@ -504,10 +478,6 @@ KeyAuth::api::Tfa& KeyAuth::api::Tfa::handleInput(KeyAuth::api& instance) {
504
478
instance.disable2fa (code);
505
479
}
506
480
507
- }
508
- else {
509
- LI_FN (exit)(7 );
510
- }
511
481
}
512
482
513
483
void KeyAuth::api::web_login ()
@@ -1873,8 +1843,6 @@ void checkRegistry() {
1873
1843
LI_FN (RegCloseKey)(hKey);
1874
1844
}
1875
1845
Sleep (1500 ); // thread interval
1876
- Sleep (1500 ); // thread interval
1877
- }
1878
1846
}
1879
1847
1880
1848
std::string checksum ()
@@ -1921,9 +1889,13 @@ void RedactField(nlohmann::json& jsonObject, const std::string& fieldName)
1921
1889
}
1922
1890
}
1923
1891
1924
- void debugInfo (std::string data, std::string url, std::string response, std::string headers) {
1892
+ void KeyAuth::api:: debugInfo (std::string data, std::string url, std::string response, std::string headers) {
1925
1893
// output debug logs to C:\ProgramData\KeyAuth\Debug\
1926
1894
1895
+ if (!KeyAuth::api::debug) {
1896
+ return ;
1897
+ }
1898
+
1927
1899
std::string redacted_response = " n/a" ;
1928
1900
// for logging the headers, since response is not avaliable there
1929
1901
if (response != " n/a" ) {
0 commit comments