تكملة للموضوع
مولد مفاتيح للبرنامج:
مولد مفاتيح للبرنامج:
#include <iostream>
#include <string>
#include <sstream>
#include <random>
std::string generateRandom(size_t length = 0)
{
static const std::string allowed_chars{ "1234567890" };
static thread_local std::default_random_engine randomEngine(std::random_device{}());
static thread_local std::uniform_int_distribution<int> randomDistribution(0, allowed_chars.size() - 1);
std::string str(length ? length : 32, '\0');
for (std::string::value_type& c : str) {
c = allowed_chars[randomDistribution(randomEngine)];
}
return str;
}
int serialsum(std::string bytes) {
int sum = 0;
for (int i = bytes.size() - 1; i >= 0; i--)
sum += bytes[i] * (i + 1);
return sum;
}
void printscreen() {
std::cout << "WinCHM v5.48 Serial Generator\n" <<
"EarthMan123 - AT4RE TEAM\n\n";
std::cout << "1 - Single-user License\n";
std::cout << "2 - 2-user License\n";
std::cout << "3 - 3-user License\n";
std::cout << "4 - 5-user License\n";
std::cout << "5 - 10-user License\n";
std::cout << "6 - 20-user License\n";
std::cout << "7 - 50-user License\n";
std::cout << "8 - Unlimited-user License\n";
std::cout << "Choice: ";
}
int main() {
int choice, check = 0, len = 0, ssum = 0;
std::string serial;
printscreen();
std::cin >> choice;
switch (choice) {
case 1: check = 0x2E6C; len = 15;
break;
case 2: check = 0x322C; len = 15;
break;
case 3: check = 0x3886; len = 17;
break;
case 4: check = 0x2BAC; len = 14;
break;
case 5: check = 0x245B; len = 12;
break;
case 6: check = 0x31D6; len = 15;
break;
case 7: check = 0x2BD6; len = 14;
break;
case 8: check = 0x31A8; len = 15;
break;
default:
std::cout << "Wrong License Type.\n";
}
if (len > 0) {
do {
serial = "AT4RE-" + generateRandom(len);
ssum = serialsum(serial);
} while (ssum != check);
}
std::cout << "Serial = " << serial << std::endl;
system("pause");
}
من طلب العلا ... سهر الليالي