diff --git a/x64/auth.hpp b/x64/auth.hpp index d735076..5b25c9d 100644 --- a/x64/auth.hpp +++ b/x64/auth.hpp @@ -14,9 +14,9 @@ namespace KeyAuth { class api { public: - std::string name, ownerid, secret, version, url, path; + std::string name, ownerid, version, url, path; - api(std::string name, std::string ownerid, std::string secret, std::string version, std::string url, std::string path) : name(name), ownerid(ownerid), secret(secret), version(version), url(url), path(path) {} + 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) {} void ban(std::string reason = ""); void init(); @@ -75,7 +75,7 @@ namespace KeyAuth { public: // response data std::vector channeldata; - bool success{}; + bool success{false}; std::string message; }; diff --git a/x64/example.vcxproj b/x64/example.vcxproj index 364c0d8..f1a731d 100644 --- a/x64/example.vcxproj +++ b/x64/example.vcxproj @@ -104,7 +104,7 @@ true true true - CURL_STATICLIB;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true stdcpp17 @@ -113,7 +113,7 @@ true true true - libcurl.lib;library_x86.lib;%(AdditionalDependencies) + library_x86.lib;%(AdditionalDependencies) @@ -139,6 +139,7 @@ true stdcpp17 MultiThreadedDLL + %(AdditionalIncludeDirectories) Console diff --git a/x64/library_x64.lib b/x64/library_x64.lib index c39fbb9..f8f9d12 100644 Binary files a/x64/library_x64.lib and b/x64/library_x64.lib differ diff --git a/x64/main.cpp b/x64/main.cpp index 847d163..86fad96 100644 --- a/x64/main.cpp +++ b/x64/main.cpp @@ -1,6 +1,7 @@ #include #include "auth.hpp" #include +#include #include "utils.hpp" #include "skStr.h" std::string tm_to_readable_time(tm ctx); @@ -11,22 +12,23 @@ const std::string compilation_time = (std::string)skCrypt(__TIME__); using namespace KeyAuth; +// copy and paste from https://keyauth.cc/app/ and replace these string variables +// Please watch tutorial HERE std::string name = skCrypt("name").decrypt(); std::string ownerid = skCrypt("ownerid").decrypt(); std::string secret = skCrypt("secret").decrypt(); std::string version = skCrypt("1.0").decrypt(); -std::string url = skCrypt("https://keyauth.win/api/1.2/").decrypt(); // change if you're self-hosting +std::string url = skCrypt("https://keyauth.win/api/1.3/").decrypt(); // change if using KeyAuth custom domains feature std::string path = skCrypt("").decrypt(); //optional, set a path if you're using the token validation setting -api KeyAuthApp(name, ownerid, secret, version, url, path); +api KeyAuthApp(name, ownerid, version, url, path); int main() { - // Freeing memory to prevent memory leak or memory scraping - name.clear(); ownerid.clear(); secret.clear(); version.clear(); url.clear(); std::string consoleTitle = skCrypt("Loader - Built at: ").decrypt() + compilation_date + " " + compilation_time; SetConsoleTitleA(consoleTitle.c_str()); std::cout << skCrypt("\n\n Connecting.."); + KeyAuthApp.init(); if (!KeyAuthApp.response.success) { @@ -111,12 +113,14 @@ int main() exit(1); } + if (KeyAuthApp.response.message.empty()) exit(11); if (!KeyAuthApp.response.success) { std::cout << skCrypt("\n Status: ") << KeyAuthApp.response.message; Sleep(1500); exit(1); } + if (username.empty() || password.empty()) { WriteToJson("test.json", "license", key, false, "", ""); @@ -127,10 +131,19 @@ int main() WriteToJson("test.json", "username", username, true, "password", password); std::cout << skCrypt("Successfully Created File For Auto Login"); } - - } + /* + * Do NOT remove this checkAuthenticated() function. + * It protects you from cracking, it would be NOT be a good idea to remove it + */ + std::cout << ownerid; + std::string owner = ownerid; + std::cout << "\nOwner: " + owner; + std::thread run(checkAuthenticated, ownerid); + // do NOT remove checkAuthenticated(), it MUST stay for security reasons + + if (KeyAuthApp.user_data.username.empty()) exit(10); std::cout << skCrypt("\n User data:"); std::cout << skCrypt("\n Username: ") << KeyAuthApp.user_data.username; std::cout << skCrypt("\n IP address: ") << KeyAuthApp.user_data.ip; diff --git a/x64/utils.hpp b/x64/utils.hpp index 37823ad..b34d077 100644 --- a/x64/utils.hpp +++ b/x64/utils.hpp @@ -45,3 +45,12 @@ bool WriteToJson(std::string path, std::string name, std::string value, bool use return true; } + +void checkAuthenticated(std::string ownerid) { + while (true) { + if (GlobalFindAtomA(ownerid.c_str()) == 0) { + exit(13); + } + Sleep(1000); // thread interval + } +}