Mercurial > codedump
comparison win95kg.cpp @ 3:fcbeb8097ad3
win95kg.cpp - add check for last digit in e()
i don't know how i even forgot to add that
also made the code look prettier on github
committer: GitHub <noreply@github.com>
| author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
|---|---|
| date | Mon, 04 Jan 2021 14:18:39 -0500 |
| parents | 05978f04869b |
| children | 9241ce1e5abe |
comparison
equal
deleted
inserted
replaced
| 2:26b01c33d7ab | 3:fcbeb8097ad3 |
|---|---|
| 1 /* Windows 95 Keygen - 11/24/20 | 1 /* Windows 95 Keygen - 11/24/20 |
| 2 By Paper | 2 By Paper |
| 3 not sure if this will work fully, but from what i've seen it works well enough | 3 not sure if this will work fully, but from what i've seen it works well enough |
| 4 */ | 4 */ |
| 5 #include <ctime> | 5 #include <ctime> |
| 6 | |
| 6 #include <cstdlib> | 7 #include <cstdlib> |
| 8 | |
| 7 #include <cstring> | 9 #include <cstring> |
| 10 | |
| 8 #include <iomanip> | 11 #include <iomanip> |
| 12 | |
| 9 #include <iostream> | 13 #include <iostream> |
| 14 | |
| 10 #include <string> | 15 #include <string> |
| 11 | 16 |
| 12 int a(), b(), c(), d(), e(); | 17 int a(), b(), c(), d(), e(); |
| 13 int main(int argc, char* argv[]){ | 18 int main(int argc, char * argv[]) { |
| 14 int endpoint, startpoint, sadsong; | 19 int endpoint, startpoint, sadsong; |
| 15 srand((unsigned) time(NULL)); | 20 srand((unsigned) time(NULL)); |
| 16 if(argc>=2){ | 21 if (argc >= 2) { |
| 17 if (strcmp(argv[1], "--office") == 0){ | 22 if (strcmp(argv[1], "--office") == 0) { |
| 18 startpoint = c(); | 23 startpoint = c(); |
| 19 sadsong = 4; | 24 sadsong = 4; |
| 20 } | 25 } else if (strcmp(argv[1], "--oem") == 0) { |
| 21 else if (strcmp(argv[1], "--oem") == 0){ | 26 int first = d(), third = e(); |
| 22 int first = d(), third = e(); | 27 std::cout << std::setw(5) << std::setfill('0') << first; |
| 23 std::cout << std::setw(5) << std::setfill('0') << first; | 28 std::cout << "-OEM-"; |
| 24 std::cout << "-OEM-"; | 29 std::cout << std::setw(7) << std::setfill('0') << third << "-"; |
| 25 std::cout << std::setw(7) << std::setfill('0') << third << "-"; | 30 std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); |
| 26 std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); | 31 return 0; |
| 27 return 0; | 32 } else if (strcmp(argv[1], "--normal") == 0) { |
| 28 } | 33 startpoint = a(); |
| 29 else if (strcmp(argv[1], "--normal") == 0){ | 34 sadsong = 3; |
| 30 startpoint = a(); | 35 } else { |
| 31 sadsong = 3; | 36 std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; |
| 32 } | 37 return 0; |
| 33 else { | 38 } |
| 34 std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; | 39 } else { |
| 35 return 0; | 40 std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; |
| 36 } | 41 return 0; |
| 37 } | 42 } |
| 38 else { | 43 endpoint = b(); |
| 39 std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; | 44 std::cout << std::setw(sadsong) << std::setfill('0') << startpoint << "-"; |
| 40 return 0; | 45 std::cout << std::setw(7) << std::setfill('0') << endpoint; |
| 41 } | 46 return 0; |
| 42 endpoint = b(); | |
| 43 std::cout << std::setw(sadsong) << std::setfill('0') << startpoint << "-"; | |
| 44 std::cout << std::setw(7) << std::setfill('0') << endpoint; | |
| 45 return 0; | |
| 46 } | 47 } |
| 47 int a(){ | 48 int a() { |
| 48 int num; | 49 int num; |
| 50 num = rand() % 1000; | |
| 51 while ((num == 333) and(num == 444) and(num == 555) and(num == 666) and(num == 777) and(num == 888) and(num == 999)) { | |
| 49 num = rand() % 1000; | 52 num = rand() % 1000; |
| 50 while ((num == 333) and (num == 444) and (num == 555) and (num == 666) and (num == 777) and (num == 888) and (num == 999)){ | 53 } |
| 51 num = rand() % 1000; | 54 while ((num % 3) != 0) { |
| 52 } | 55 num = num + 1; |
| 53 while ((num % 3) != 0){ | 56 } |
| 54 num=num+1; | 57 return num; |
| 55 } | |
| 56 return num; | |
| 57 } | 58 } |
| 58 int b(){ | 59 int b() { |
| 59 int first_digits = rand() % 10000000; | 60 int first_digits = rand() % 10000000; |
| 60 int last_digit = rand() % 10; | 61 int last_digit = rand() % 10; |
| 61 while ((last_digit == 0) || (last_digit >= 8)){ | 62 while ((last_digit == 0) || (last_digit >= 8)) { |
| 62 last_digit = rand() % 10; | 63 last_digit = rand() % 10; |
| 63 } | 64 } |
| 64 std::string thisis = std::to_string(first_digits); | 65 std::string thisis = std::to_string(first_digits); |
| 65 std::string veryfrustrating = std::to_string(last_digit); | 66 std::string veryfrustrating = std::to_string(last_digit); |
| 67 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
| 68 int second_segment = std::stoi(second_segment_p1); | |
| 69 while (second_segment % 7 != 0) { | |
| 70 first_digits = rand() % 10000000; | |
| 71 last_digit = rand() % 10; | |
| 72 while ((last_digit == 0) || (last_digit >= 8)) { | |
| 73 last_digit = rand() % 10; | |
| 74 } | |
| 75 std::string thisis = std::to_string(first_digits); | |
| 76 std::string veryfrustrating = std::to_string(last_digit); | |
| 66 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | 77 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); |
| 67 int second_segment = std::stoi(second_segment_p1); | 78 second_segment = std::stoi(second_segment_p1); |
| 68 while (second_segment % 7 != 0){ | 79 } |
| 69 first_digits = rand() % 10000000; | 80 return second_segment; |
| 70 last_digit = rand() % 10; | |
| 71 while ((last_digit == 0) || (last_digit >= 8)){ | |
| 72 last_digit = rand() % 10; | |
| 73 } | |
| 74 std::string thisis = std::to_string(first_digits); | |
| 75 std::string veryfrustrating = std::to_string(last_digit); | |
| 76 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
| 77 second_segment = std::stoi(second_segment_p1); | |
| 78 } | |
| 79 return second_segment; | |
| 80 } | 81 } |
| 81 | 82 |
| 82 int c(){ | 83 int c() { |
| 83 int new_site = rand() % 1000; | 84 int new_site = rand() % 1000; |
| 84 int ez_pwned = new_site % 10 + 1; | 85 int ez_pwned = new_site % 10 + 1; |
| 85 while (ez_pwned >= 10){ | 86 while (ez_pwned >= 10) { |
| 86 ez_pwned = ez_pwned - 10; | 87 ez_pwned = ez_pwned - 10; |
| 87 } | 88 } |
| 88 std::string thisisstill = std::to_string(new_site); | 89 std::string thisisstill = std::to_string(new_site); |
| 89 std::string prettyfrustrating = std::to_string(ez_pwned); | 90 std::string prettyfrustrating = std::to_string(ez_pwned); |
| 90 std::string iamsocool = (std::string(thisisstill) + std::string(prettyfrustrating)); | 91 std::string iamsocool = (std::string(thisisstill) + std::string(prettyfrustrating)); |
| 91 int mysinusesareclogged = std::stoi(iamsocool); | 92 int mysinusesareclogged = std::stoi(iamsocool); |
| 92 return mysinusesareclogged; | 93 return mysinusesareclogged; |
| 93 } | 94 } |
| 94 | 95 |
| 95 int d(){ | 96 int d() { |
| 96 int day = (rand() % 366) + 1; | 97 int day = (rand() % 366) + 1; |
| 97 const char* years[] = {"95", "96", "97", "98", "99", "00", "01", "02", "03"}; | 98 const char * years[] = { |
| 98 int index = (rand() % 9); | 99 "95", |
| 99 const char* year = years[index]; | 100 "96", |
| 100 std::string iamsotired = std::to_string(day); | 101 "97", |
| 101 std::string ofdoingthis = year; | 102 "98", |
| 102 std::string pleasehelp = (std::string(iamsotired) + std::string(ofdoingthis)); | 103 "99", |
| 103 int ohmygod = std::stoi(pleasehelp); | 104 "00", |
| 104 return ohmygod; | 105 "01", |
| 106 "02", | |
| 107 "03" | |
| 108 }; | |
| 109 int index = (rand() % 9); | |
| 110 const char * year = years[index]; | |
| 111 std::string iamsotired = std::to_string(day); | |
| 112 std::string ofdoingthis = year; | |
| 113 std::string pleasehelp = (std::string(iamsotired) + std::string(ofdoingthis)); | |
| 114 int ohmygod = std::stoi(pleasehelp); | |
| 115 return ohmygod; | |
| 105 } | 116 } |
| 106 | 117 |
| 107 int e(){ | 118 int e() { |
| 108 int first_digits = rand() % 1000000; | 119 int first_digits = rand() % 1000000; |
| 109 int last_digit = rand() % 10; | 120 int last_digit = rand() % 10; |
| 110 std::string thisis = std::to_string(first_digits); | 121 while ((last_digit == 0) || (last_digit >= 8)) { |
| 111 std::string veryfrustrating = std::to_string(last_digit); | 122 last_digit = rand() % 10; |
| 123 } | |
| 124 std::string thisis = std::to_string(first_digits); | |
| 125 std::string veryfrustrating = std::to_string(last_digit); | |
| 126 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
| 127 int second_segment = std::stoi(second_segment_p1); | |
| 128 while (second_segment % 7 != 0) { | |
| 129 first_digits = rand() % 10000000; | |
| 130 last_digit = rand() % 10; | |
| 131 while ((last_digit == 0) || (last_digit >= 8)) { | |
| 132 last_digit = rand() % 10; | |
| 133 } | |
| 134 std::string thisis = std::to_string(first_digits); | |
| 135 std::string veryfrustrating = std::to_string(last_digit); | |
| 112 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | 136 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); |
| 113 int second_segment = std::stoi(second_segment_p1); | 137 second_segment = std::stoi(second_segment_p1); |
| 114 while (second_segment % 7 != 0){ | 138 } |
| 115 first_digits = rand() % 10000000; | 139 return second_segment; |
| 116 last_digit = rand() % 10; | |
| 117 std::string thisis = std::to_string(first_digits); | |
| 118 std::string veryfrustrating = std::to_string(last_digit); | |
| 119 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
| 120 second_segment = std::stoi(second_segment_p1); | |
| 121 } | |
| 122 return second_segment; | |
| 123 } | 140 } |
