-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
136 lines (122 loc) · 4.38 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#include "eauth/eauth.h" // Eauth API
#include <iostream>
#include <thread>
void menu() {
system("cls");
// Ask the user
int option;
std::cout << "1/ Login - 2/ Register" << "\n";
std::cout << "-> ";
std::cin >> option;
std::string username;
std::string password;
std::string key;
switch (option) {
case 1:
system("cls");
std::cout << "1/ Username and Password - 2/ Key" << "\n";
std::cout << "-> ";
std::cin >> option;
switch (option) {
case 1:
system("cls");
std::cout << "Username: ";
std::cin >> username;
std::cout << "Password: ";
std::cin >> password;
if (loginRequest(username, password, ""))
{
// Code to execute if login is successful
system("cls");
std::cout << "You have successfully logged in." << "\n";
std::cout << "Username: " << username << "\n";
std::cout << "Rank: " << rank << "\n";
std::cout << "Joined: " << register_date << "\n";
std::cout << "Expires: " << expire_date << "\n";
std::cout << "Hwid: " << hwid;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
else
{
std::cout << error_message;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
case 2:
system("cls");
std::cout << "Key: ";
std::cin >> key;
if (loginRequest("", "", key))
{
// Code to execute if login is successful
system("cls");
std::cout << "You have successfully logged in." << "\n";
std::cout << "Key: " << key << "\n";
std::cout << "Rank: " << rank << "\n";
std::cout << "Joined: " << register_date << "\n";
std::cout << "Expires: " << expire_date << "\n";
std::cout << "Hwid: " << hwid;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
else
{
std::cout << error_message;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
}
case 2:
system("cls");
std::cout << "Username: ";
std::cin >> username;
std::cout << "Password: ";
std::cin >> password;
std::cout << "Key: ";
std::cin >> key;
if (registerRequest(username, password, key))
{
// Code to execute if register is successful
system("cls");
std::cout << "You have successfully registered.";
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
else
{
std::cout << error_message;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
default:
std::cout << "Wrong input!";
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
menu();
}
}
int main() {
// Initialization request (required)
if (!initRequest("account_key", "application_key", "application_id", "1.0")) {
std::cout << error_message;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
// Exit the program to indicate an error
exit(1);
}
// Ban user HWID and IP (You can use this if you have code to detect if users are trying to crack your application or reverse it)
/*
banUser();
*/
// Download file into a specific path
/*
if (!writeBytesToFile("file_id", "file.format", "./path")) {
std::cout << error_message;
std::this_thread::sleep_for(std::chrono::milliseconds(3500));
// Exit the program to indicate an error
exit(1);
}
*/
// Main menu
menu();
return 0;
}