1
1
#include < Windows.h>
2
2
#include " auth.hpp"
3
3
#include < string>
4
+ #include < thread>
4
5
#include " utils.hpp"
5
6
#include " skStr.h"
6
7
std::string tm_to_readable_time (tm ctx);
@@ -11,22 +12,23 @@ const std::string compilation_time = (std::string)skCrypt(__TIME__);
11
12
12
13
using namespace KeyAuth ;
13
14
15
+ // copy and paste from https://keyauth.cc/app/ and replace these string variables
16
+ // Please watch tutorial HERE
14
17
std::string name = skCrypt(" name" ).decrypt();
15
18
std::string ownerid = skCrypt(" ownerid" ).decrypt();
16
19
std::string secret = skCrypt(" secret" ).decrypt();
17
20
std::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
19
22
std::string path = skCrypt(" " ).decrypt(); // optional, set a path if you're using the token validation setting
20
23
21
- api KeyAuthApp (name, ownerid, secret, version, url, path);
24
+ api KeyAuthApp (name, ownerid, version, url, path);
22
25
23
26
int main ()
24
27
{
25
- // Freeing memory to prevent memory leak or memory scraping
26
- name.clear (); ownerid.clear (); secret.clear (); version.clear (); url.clear ();
27
28
std::string consoleTitle = skCrypt (" Loader - Built at: " ).decrypt () + compilation_date + " " + compilation_time;
28
29
SetConsoleTitleA (consoleTitle.c_str ());
29
30
std::cout << skCrypt (" \n\n Connecting.." );
31
+
30
32
KeyAuthApp.init ();
31
33
if (!KeyAuthApp.response .success )
32
34
{
@@ -111,12 +113,14 @@ int main()
111
113
exit (1 );
112
114
}
113
115
116
+ if (KeyAuthApp.response .message .empty ()) exit (11 );
114
117
if (!KeyAuthApp.response .success )
115
118
{
116
119
std::cout << skCrypt (" \n Status: " ) << KeyAuthApp.response .message ;
117
120
Sleep (1500 );
118
121
exit (1 );
119
122
}
123
+
120
124
if (username.empty () || password.empty ())
121
125
{
122
126
WriteToJson (" test.json" , " license" , key, false , " " , " " );
@@ -127,10 +131,19 @@ int main()
127
131
WriteToJson (" test.json" , " username" , username, true , " password" , password);
128
132
std::cout << skCrypt (" Successfully Created File For Auto Login" );
129
133
}
130
-
131
-
132
134
}
133
135
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 );
134
147
std::cout << skCrypt (" \n User data:" );
135
148
std::cout << skCrypt (" \n Username: " ) << KeyAuthApp.user_data .username ;
136
149
std::cout << skCrypt (" \n IP address: " ) << KeyAuthApp.user_data .ip ;
0 commit comments