11#include < Windows.h>
22#include " auth.hpp"
33#include < string>
4+ #include < thread>
45#include " utils.hpp"
56#include " skStr.h"
67std::string tm_to_readable_time (tm ctx);
@@ -11,22 +12,23 @@ const std::string compilation_time = (std::string)skCrypt(__TIME__);
1112
1213using namespace KeyAuth ;
1314
15+ // copy and paste from https://keyauth.cc/app/ and replace these string variables
16+ // Please watch tutorial HERE
1417std::string name = skCrypt(" name" ).decrypt();
1518std::string ownerid = skCrypt(" ownerid" ).decrypt();
1619std::string secret = skCrypt(" secret" ).decrypt();
1720std::string version = skCrypt(" 1.0" ).decrypt();
18- std::string url = skCrypt(" https://keyauth.win/api/1.2 /" ).decrypt(); // change if you're self-hosting
21+ std::string url = skCrypt(" https://keyauth.win/api/1.3 /" ).decrypt(); // change if using KeyAuth custom domains feature
1922std::string path = skCrypt(" " ).decrypt(); // optional, set a path if you're using the token validation setting
2023
21- api KeyAuthApp (name, ownerid, secret, version, url, path);
24+ api KeyAuthApp (name, ownerid, version, url, path);
2225
2326int main ()
2427{
25- // Freeing memory to prevent memory leak or memory scraping
26- name.clear (); ownerid.clear (); secret.clear (); version.clear (); url.clear ();
2728 std::string consoleTitle = skCrypt (" Loader - Built at: " ).decrypt () + compilation_date + " " + compilation_time;
2829 SetConsoleTitleA (consoleTitle.c_str ());
2930 std::cout << skCrypt (" \n\n Connecting.." );
31+
3032 KeyAuthApp.init ();
3133 if (!KeyAuthApp.response .success )
3234 {
@@ -111,12 +113,14 @@ int main()
111113 exit (1 );
112114 }
113115
116+ if (KeyAuthApp.response .message .empty ()) exit (11 );
114117 if (!KeyAuthApp.response .success )
115118 {
116119 std::cout << skCrypt (" \n Status: " ) << KeyAuthApp.response .message ;
117120 Sleep (1500 );
118121 exit (1 );
119122 }
123+
120124 if (username.empty () || password.empty ())
121125 {
122126 WriteToJson (" test.json" , " license" , key, false , " " , " " );
@@ -127,10 +131,19 @@ int main()
127131 WriteToJson (" test.json" , " username" , username, true , " password" , password);
128132 std::cout << skCrypt (" Successfully Created File For Auto Login" );
129133 }
130-
131-
132134 }
133135
136+ /*
137+ * Do NOT remove this checkAuthenticated() function.
138+ * It protects you from cracking, it would be NOT be a good idea to remove it
139+ */
140+ std::cout << ownerid;
141+ std::string owner = ownerid;
142+ std::cout << " \n Owner: " + owner;
143+ std::thread run (checkAuthenticated, ownerid);
144+ // do NOT remove checkAuthenticated(), it MUST stay for security reasons
145+
146+ if (KeyAuthApp.user_data .username .empty ()) exit (10 );
134147 std::cout << skCrypt (" \n User data:" );
135148 std::cout << skCrypt (" \n Username: " ) << KeyAuthApp.user_data .username ;
136149 std::cout << skCrypt (" \n IP address: " ) << KeyAuthApp.user_data .ip ;
0 commit comments