Skip to content

Commit fd64976

Browse files
Updated x86 library and main.cpp
1 parent 2dd55c6 commit fd64976

File tree

2 files changed

+47
-35
lines changed

2 files changed

+47
-35
lines changed

x86/lib/auth.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ void KeyAuth::api::init()
162162
for (uint8_t x : out) {
163163
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
164164
}
165-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
166-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
165+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
166+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
167167
}
168168

169169
load_response_data(json);
@@ -242,8 +242,8 @@ void KeyAuth::api::login(std::string username, std::string password)
242242
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
243243
}
244244

245-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
246-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
245+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
246+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
247247
}
248248

249249
load_response_data(json);
@@ -315,8 +315,8 @@ void KeyAuth::api::changeUsername(std::string newusername)
315315
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
316316
}
317317

318-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
319-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
318+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
319+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
320320
}
321321

322322
load_response_data(json);
@@ -565,8 +565,8 @@ void KeyAuth::api::web_login()
565565
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
566566
}
567567

568-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
569-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
568+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
569+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
570570
}
571571

572572
// Respond to the request.
@@ -780,8 +780,8 @@ void KeyAuth::api::regstr(std::string username, std::string password, std::strin
780780
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
781781
}
782782

783-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
784-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
783+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
784+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
785785
}
786786

787787
load_response_data(json);
@@ -818,8 +818,8 @@ void KeyAuth::api::upgrade(std::string username, std::string key) {
818818
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
819819
}
820820

821-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
822-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
821+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
822+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
823823
}
824824

825825
json[(XorStr("success"))] = false;
@@ -856,8 +856,8 @@ void KeyAuth::api::license(std::string key) {
856856
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
857857
}
858858

859-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
860-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
859+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
860+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
861861
}
862862

863863
load_response_data(json);
@@ -908,8 +908,8 @@ std::string KeyAuth::api::getvar(std::string var) {
908908
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
909909
}
910910

911-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
912-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
911+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
912+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
913913
}
914914

915915
load_response_data(json);
@@ -944,8 +944,8 @@ void KeyAuth::api::ban(std::string reason) {
944944
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
945945
}
946946

947-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
948-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
947+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
948+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
949949
}
950950

951951
load_response_data(json);
@@ -980,8 +980,8 @@ bool KeyAuth::api::checkblack() {
980980
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
981981
}
982982

983-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
984-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
983+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
984+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
985985
}
986986
return json[("success")];
987987
}
@@ -1014,8 +1014,8 @@ void KeyAuth::api::check() {
10141014
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
10151015
}
10161016

1017-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
1018-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
1017+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
1018+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
10191019
}
10201020

10211021
load_response_data(json);
@@ -1049,8 +1049,8 @@ std::string KeyAuth::api::var(std::string varid) {
10491049
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
10501050
}
10511051

1052-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
1053-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
1052+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
1053+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
10541054
}
10551055

10561056
load_response_data(json);
@@ -1139,8 +1139,8 @@ std::string KeyAuth::api::webhook(std::string id, std::string params, std::strin
11391139
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
11401140
}
11411141

1142-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
1143-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
1142+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
1143+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
11441144
}
11451145

11461146
load_response_data(json);
@@ -1172,8 +1172,8 @@ std::string KeyAuth::api::fetchonline()
11721172
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
11731173
}
11741174

1175-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
1176-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
1175+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
1176+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
11771177
}
11781178

11791179
std::string onlineusers;
@@ -1213,8 +1213,8 @@ void KeyAuth::api::fetchstats()
12131213
ss_result << std::hex << std::setfill('0') << std::setw(2) << (int)x;
12141214
}
12151215

1216-
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), sizeof(signature).c_str())) { // check response authenticity, if not authentic program crashes
1217-
error("Signature checksum failed. Request was tampered with or session ended most likely. & echo: & echo Message: " + message);
1216+
if (!constantTimeStringCompare(ss_result.str().c_str(), signature.c_str(), signature.length())) {
1217+
error("Signature checksum failedRequest was tampered with or session ended most likely." + message);
12181218
}
12191219

12201220
load_response_data(json);

x86/main.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,24 @@ int main()
8787
exit(1);
8888
}
8989

90-
KeyAuthApp.chatget("testing");
91-
92-
for (int i = 0; i < KeyAuthApp.response.channeldata.size(); i++)
93-
{
94-
std::cout << "\n Author:" + KeyAuthApp.response.channeldata[i].author + " | Message:" + KeyAuthApp.response.channeldata[i].message + " | Send Time:" + tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.response.channeldata[i].timestamp)));
90+
std::cout << skCrypt("\n User data:");
91+
std::cout << skCrypt("\n Username: ") << KeyAuthApp.user_data.username;
92+
std::cout << skCrypt("\n IP address: ") << KeyAuthApp.user_data.ip;
93+
std::cout << skCrypt("\n Hardware-Id: ") << KeyAuthApp.user_data.hwid;
94+
std::cout << skCrypt("\n Create date: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.user_data.createdate)));
95+
std::cout << skCrypt("\n Last login: ") << tm_to_readable_time(timet_to_tm(string_to_timet(KeyAuthApp.user_data.lastlogin)));
96+
std::cout << skCrypt("\n Subscription(s): ");
97+
98+
for (int i = 0; i < KeyAuthApp.user_data.subscriptions.size(); i++) {
99+
auto sub = KeyAuthApp.user_data.subscriptions.at(i);
100+
std::cout << skCrypt("\n name: ") << sub.name;
101+
std::cout << skCrypt(" : expiry: ") << tm_to_readable_time(timet_to_tm(string_to_timet(sub.expiry)));
95102
}
103+
104+
std::cout << skCrypt("\n\n Closing in five seconds...");
105+
Sleep(5000);
106+
107+
return 0;
96108
}
97109

98110
std::string tm_to_readable_time(tm ctx) {

0 commit comments

Comments
 (0)