diff --git a/auth.cpp b/auth.cpp index 9789f41..6902225 100644 --- a/auth.cpp +++ b/auth.cpp @@ -155,13 +155,6 @@ void KeyAuth::api::init() if ((hasher(result ^ 0xA5A5) & 0xFFFF) == (expectedHash & 0xFFFF)) { auto json = response_decoder.parse(response); - if (json[(XorStr("ownerid"))] != ownerid) { - LI_FN(exit)(8); - } - - std::string message = json[(XorStr("message"))]; - - load_response_data(json); if (json[(XorStr("ownerid"))] != ownerid) { LI_FN(exit)(8); @@ -188,6 +181,7 @@ void KeyAuth::api::init() else if (json[(XorStr("message"))] == XorStr("invalidver")) { std::string dl = json[(XorStr("download"))]; + api::app_data.downloadLink = json[XorStr("download")]; if (dl == "") { MessageBoxA(0, XorStr("Version in the loader does match the one on the dashboard, and the download link on dashboard is blank.\n\nTo 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 file.close(); } - std::string message = json[(XorStr("message"))]; - - std::hash hasher; - size_t expectedHash = hasher(68); - size_t resultCode = hasher(json[(XorStr("code"))]); - - if (!json[(XorStr("success"))] || (json[(XorStr("success"))] && (resultCode == expectedHash))) { - load_response_data(json); - if (json[(XorStr("success"))]) - load_user_data(json[(XorStr("info"))]); - - if (api::response.message != XorStr("Initialized").c_str()) { - LI_FN(GlobalAddAtomA)(seed.c_str()); - - std::string file_path = XorStr("C:\\ProgramData\\").c_str() + seed; - std::ofstream file(file_path); - if (file.is_open()) { - file << seed; - file.close(); - } std::string regPath = XorStr("Software\\").c_str() + seed; HKEY hKey; 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) { instance.disable2fa(code); } - } - else { - LI_FN(exit)(7); - } } void KeyAuth::api::web_login() @@ -1873,8 +1843,6 @@ void checkRegistry() { LI_FN(RegCloseKey)(hKey); } Sleep(1500); // thread interval - Sleep(1500); // thread interval - } } std::string checksum() @@ -1921,9 +1889,13 @@ void RedactField(nlohmann::json& jsonObject, const std::string& fieldName) } } -void debugInfo(std::string data, std::string url, std::string response, std::string headers) { +void KeyAuth::api::debugInfo(std::string data, std::string url, std::string response, std::string headers) { // output debug logs to C:\ProgramData\KeyAuth\Debug\ + if (!KeyAuth::api::debug) { + return; + } + std::string redacted_response = "n/a"; // for logging the headers, since response is not avaliable there if (response != "n/a") { diff --git a/auth.hpp b/auth.hpp index 53bd10e..60a204a 100644 --- a/auth.hpp +++ b/auth.hpp @@ -16,8 +16,11 @@ namespace KeyAuth { public: std::string name, ownerid, version, url, path; + static bool debug; - api(std::string name, std::string ownerid, std::string version, std::string url, std::string path) : name(name), ownerid(ownerid), version(version), url(url), path(path) {} + api(std::string name, std::string ownerid, std::string version, std::string url, std::string path, bool debug = true) { + debug = debug; + } void ban(std::string reason = ""); void init(); @@ -70,6 +73,7 @@ namespace KeyAuth { std::string numKeys; std::string version; std::string customerPanelLink; + std::string downloadLink; }; class responsedata { @@ -102,6 +106,8 @@ namespace KeyAuth { std::string sessionid, enckey; static std::string req(std::string data, std::string url); + + static void debugInfo(std::string data, std::string url, std::string response, std::string headers); void load_user_data(nlohmann::json data) { @@ -131,7 +137,7 @@ namespace KeyAuth { api::app_data.version = data[XorStr("version")]; api::app_data.customerPanelLink = data[XorStr("customerPanelLink")]; } - + void load_response_data(nlohmann::json data) { api::response.success = data[XorStr("success")]; api::response.message = data["message"]; diff --git a/library.vcxproj b/library.vcxproj index c5cdbf5..884ee9e 100644 --- a/library.vcxproj +++ b/library.vcxproj @@ -313,309 +313,4 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {03a87d79-b6bb-4199-bd0c-97158912f6ab} - library - 10.0 - - - - StaticLibrary - true - v143 - Unicode - - - StaticLibrary - false - v143 - true - MultiByte - - - StaticLibrary - true - v143 - Unicode - - - StaticLibrary - false - false - MultiByte - v143 - - - - - - - - - - - - - - - - - - - - - true - - - false - .\libsodium;.\nlohmann;.\curl;.\;$(IncludePath) - $(ProjectName)_x86 - - - true - - - false - .\libsodium;.\nlohmann;.\curl;.\;$(IncludePath) - $(ProjectName)_x64 - - - - Level3 - true - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - Use - pch.h - - - - - true - - - - - Level3 - true - true - true - CURL_STATICLIB;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - stdcpp17 - - - - - true - true - true - - - - - Level3 - true - _DEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - - - - - true - - - - - Level3 - true - true - true - SODIUM_STATIC;CURL_STATICLIB;_CRT_SECURE_NO_WARNINGS;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - stdcpp17 - MultiThreadedDLL - None - %(AdditionalIncludeDirectories) - - - - - true - true - true - - - MachineX64 - libsodium.lib;libcurl.lib%(AdditionalDependencies) - .\curl;.\libsodium;%(AdditionalLibraryDirectories) - /NODEFAULTLIB:libcurl.lib %(AdditionalOptions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file +