Mercurial > codedump
diff win95kg.cpp @ 41:37f231f85a67
add tabs to some c++ files and fix win95kg.cpp
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Wed, 30 Jun 2021 02:38:59 -0400 |
parents | 9241ce1e5abe |
children | 1c81c5106b59 |
line wrap: on
line diff
--- a/win95kg.cpp Mon Jun 21 15:16:15 2021 -0400 +++ b/win95kg.cpp Wed Jun 30 02:38:59 2021 -0400 @@ -1,6 +1,9 @@ /* Windows 95 Keygen - 11/24/20 By Paper not sure if this will work fully, but from what i've seen it works well enough + + going back on this a few months later, wew this code sucks ass + managed to fix the OEM key generation, apparently the medium article i read was wrong */ #include <ctime> #include <cstdlib> @@ -18,10 +21,9 @@ startpoint = c(); sadsong = 4; } else if (strcmp(argv[1], "--oem") == 0) { - int first = d(), third = e(); - std::cout << std::setw(5) << std::setfill('0') << first; + std::cout << std::setw(5) << std::setfill('0') << d(); std::cout << "-OEM-"; - std::cout << std::setw(7) << std::setfill('0') << third << "-"; + std::cout << std::setw(7) << std::setfill('0') << e() << "-"; std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); return 0; } else if (strcmp(argv[1], "--normal") == 0) { @@ -40,10 +42,10 @@ std::cout << std::setw(7) << std::setfill('0') << endpoint; return 0; } + int a() { - int num; - num = rand() % 1000; - while ((num == 333) and(num == 444) and(num == 555) and(num == 666) and(num == 777) and(num == 888) and(num == 999)) { + int num = rand() % 1000; + while ((num == 333) || (num == 444) || (num == 555) || (num == 666) || (num == 777) || (num == 888) || (num == 999)) { num = rand() % 1000; } while ((num % 3) != 0) { @@ -51,26 +53,18 @@ } return num; } + int b() { - int first_digits = rand() % 10000000; - int last_digit = rand() % 10; - while ((last_digit == 0) || (last_digit >= 8)) { - last_digit = rand() % 10; - } - std::string thisis = std::to_string(first_digits); - std::string veryfrustrating = std::to_string(last_digit); - std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - int second_segment = std::stoi(second_segment_p1); + int first_digits; + int last_digit; + int second_segment = 5; while (second_segment % 7 != 0) { - first_digits = rand() % 10000000; + first_digits = rand() % 1000000; last_digit = rand() % 10; while ((last_digit == 0) || (last_digit >= 8)) { last_digit = rand() % 10; } - std::string thisis = std::to_string(first_digits); - std::string veryfrustrating = std::to_string(last_digit); - std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - second_segment = std::stoi(second_segment_p1); + second_segment = std::stoi(std::to_string(first_digits) + std::to_string(last_digit)); } return second_segment; } @@ -81,15 +75,10 @@ while (ez_pwned >= 10) { ez_pwned = ez_pwned - 10; } - std::string thisisstill = std::to_string(new_site); - std::string prettyfrustrating = std::to_string(ez_pwned); - std::string iamsocool = (std::string(thisisstill) + std::string(prettyfrustrating)); - int mysinusesareclogged = std::stoi(iamsocool); - return mysinusesareclogged; + return std::stoi(std::to_string(new_site) + std::to_string(ez_pwned)); } int d() { - int day = (rand() % 366) + 1; const char * years[] = { "95", "96", @@ -103,33 +92,26 @@ }; int index = (rand() % 9); const char * year = years[index]; - std::string iamsotired = std::to_string(day); - std::string ofdoingthis = year; - std::string pleasehelp = (std::string(iamsotired) + std::string(ofdoingthis)); - int ohmygod = std::stoi(pleasehelp); - return ohmygod; + return std::stoi(std::to_string((rand() % 366) + 1) + year); } int e() { - int first_digits = rand() % 1000000; - int last_digit = rand() % 10; - while ((last_digit == 0) || (last_digit >= 8)) { - last_digit = rand() % 10; - } - std::string thisis = std::to_string(first_digits); - std::string veryfrustrating = std::to_string(last_digit); - std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - int second_segment = std::stoi(second_segment_p1); - while (second_segment % 7 != 0) { - first_digits = rand() % 10000000; + int first_digits; + int last_digit; + int second_segment = 5; + int sum = 1; + while (sum % 7 != 0) { + sum = 0; + first_digits = rand() % 10000; last_digit = rand() % 10; while ((last_digit == 0) || (last_digit >= 8)) { last_digit = rand() % 10; } - std::string thisis = std::to_string(first_digits); - std::string veryfrustrating = std::to_string(last_digit); - std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); + std::string second_segment_p1 = (std::to_string(first_digits) + std::to_string(last_digit)); second_segment = std::stoi(second_segment_p1); + for(char &c :second_segment_p1) { + sum += c - '0'; + } } return second_segment; }