1- #include < includes.hpp>
2- #include < xorstr.hpp>
3- #include < random>
4-
5- #define CURL_STATICLIB
1+ #include < Windows.h>
2+ #include < iostream>
3+ #include < vector>
4+ #include < fstream>
65
76struct channel_struct
87{
@@ -15,7 +14,7 @@ namespace KeyAuth {
1514 class api {
1615 public:
1716
18- std::string name, ownerid, version, url, path;
17+ std::string name, ownerid, version, url, path;
1918
2019 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) {}
2120
@@ -42,8 +41,6 @@ namespace KeyAuth {
4241 void fetchstats ();
4342 void forgot (std::string username, std::string email);
4443 void logout ();
45- void enable2fa (std::string code = " " );
46- void disable2fa (std::string code);
4744
4845 class subscriptions_class {
4946 public:
@@ -83,70 +80,24 @@ namespace KeyAuth {
8380 bool isPaid{};
8481 };
8582
83+ bool activate = false ;
84+ class Tfa {
85+ public:
86+ std::string secret;
87+ std::string link;
88+ Tfa& handleInput (KeyAuth::api& apiInstance);
89+ private:
90+ void QrCode ();
91+ };
92+
93+ Tfa& enable2fa (std::string code = " " );
94+ Tfa& disable2fa (std::string code = " " );
95+
8696 userdata user_data;
8797 appdata app_data;
8898 responsedata response;
99+
89100 private:
90101 std::string sessionid, enckey;
91-
92- static std::string req (std::string data, std::string url);
93-
94-
95- void load_user_data (nlohmann::json data) {
96- api::user_data.username = data[XorStr (" username" )];
97- api::user_data.ip = data[XorStr (" ip" )];
98- if (data[XorStr (" hwid" )].is_null ()) {
99- api::user_data.hwid = XorStr (" none" );
100- }
101- else {
102- api::user_data.hwid = data[XorStr (" hwid" )];
103- }
104- api::user_data.createdate = data[XorStr (" createdate" )];
105- api::user_data.lastlogin = data[XorStr (" lastlogin" )];
106-
107- for (int i = 0 ; i < data[XorStr (" subscriptions" )].size (); i++) { // Prompto#7895 & stars#2297 was here
108- subscriptions_class subscriptions;
109- subscriptions.name = data[XorStr (" subscriptions" )][i][XorStr (" subscription" )];
110- subscriptions.expiry = data[XorStr (" subscriptions" )][i][XorStr (" expiry" )];
111- api::user_data.subscriptions .emplace_back (subscriptions);
112- }
113- }
114-
115- void load_app_data (nlohmann::json data) {
116- api::app_data.numUsers = data[XorStr (" numUsers" )];
117- api::app_data.numOnlineUsers = data[XorStr (" numOnlineUsers" )];
118- api::app_data.numKeys = data[XorStr (" numKeys" )];
119- api::app_data.version = data[XorStr (" version" )];
120- api::app_data.customerPanelLink = data[XorStr (" customerPanelLink" )];
121- }
122-
123- void load_response_data (nlohmann::json data) {
124- api::response.success = data[XorStr (" success" )];
125- api::response.message = data[" message" ];
126-
127- if (data.contains (XorStr (" role" ).c_str ()) && data[XorStr (" role" )] != XorStr (" tester" ).c_str () && data[XorStr (" role" )] != XorStr (" not_checked" ).c_str ()) {
128- api::response.isPaid = true ;
129- }
130- }
131-
132- void load_channel_data (nlohmann::json data) {
133- api::response.success = data[" success" ]; // intentional. Possibly trick a reverse engineer into thinking this string is for login function
134- api::response.message = data[" message" ];
135- api::response.channeldata .clear (); // If you do not delete the data before pushing it, the data will be repeated. github.com/TTakaTit
136- for (const auto sub : data[" messages" ]) {
137-
138- std::string authoroutput = sub[XorStr (" author" )];
139- std::string messageoutput = sub[" message" ];
140- int timestamp = sub[XorStr (" timestamp" )]; std::string timestampoutput = std::to_string (timestamp);
141- authoroutput.erase (remove (authoroutput.begin (), authoroutput.end (), ' "' ), authoroutput.end ());
142- messageoutput.erase (remove (messageoutput.begin (), messageoutput.end (), ' "' ), messageoutput.end ());
143- timestampoutput.erase (remove (timestampoutput.begin (), timestampoutput.end (), ' "' ), timestampoutput.end ());
144- channel_struct output = { authoroutput , messageoutput, timestampoutput };
145- api::response.channeldata .push_back (output);
146- }
147- }
148-
149- nlohmann::json response_decoder;
150-
151102 };
152103}
0 commit comments