Mercurial > codedump
comparison 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 |
comparison
equal
deleted
inserted
replaced
40:2aa9614cb39a | 41:37f231f85a67 |
---|---|
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 | |
5 going back on this a few months later, wew this code sucks ass | |
6 managed to fix the OEM key generation, apparently the medium article i read was wrong | |
4 */ | 7 */ |
5 #include <ctime> | 8 #include <ctime> |
6 #include <cstdlib> | 9 #include <cstdlib> |
7 #include <cstring> | 10 #include <cstring> |
8 #include <iomanip> | 11 #include <iomanip> |
16 if (argc >= 2) { | 19 if (argc >= 2) { |
17 if (strcmp(argv[1], "--office") == 0) { | 20 if (strcmp(argv[1], "--office") == 0) { |
18 startpoint = c(); | 21 startpoint = c(); |
19 sadsong = 4; | 22 sadsong = 4; |
20 } else if (strcmp(argv[1], "--oem") == 0) { | 23 } else if (strcmp(argv[1], "--oem") == 0) { |
21 int first = d(), third = e(); | 24 std::cout << std::setw(5) << std::setfill('0') << d(); |
22 std::cout << std::setw(5) << std::setfill('0') << first; | |
23 std::cout << "-OEM-"; | 25 std::cout << "-OEM-"; |
24 std::cout << std::setw(7) << std::setfill('0') << third << "-"; | 26 std::cout << std::setw(7) << std::setfill('0') << e() << "-"; |
25 std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); | 27 std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); |
26 return 0; | 28 return 0; |
27 } else if (strcmp(argv[1], "--normal") == 0) { | 29 } else if (strcmp(argv[1], "--normal") == 0) { |
28 startpoint = a(); | 30 startpoint = a(); |
29 sadsong = 3; | 31 sadsong = 3; |
38 endpoint = b(); | 40 endpoint = b(); |
39 std::cout << std::setw(sadsong) << std::setfill('0') << startpoint << "-"; | 41 std::cout << std::setw(sadsong) << std::setfill('0') << startpoint << "-"; |
40 std::cout << std::setw(7) << std::setfill('0') << endpoint; | 42 std::cout << std::setw(7) << std::setfill('0') << endpoint; |
41 return 0; | 43 return 0; |
42 } | 44 } |
45 | |
43 int a() { | 46 int a() { |
44 int num; | 47 int num = rand() % 1000; |
45 num = rand() % 1000; | 48 while ((num == 333) || (num == 444) || (num == 555) || (num == 666) || (num == 777) || (num == 888) || (num == 999)) { |
46 while ((num == 333) and(num == 444) and(num == 555) and(num == 666) and(num == 777) and(num == 888) and(num == 999)) { | |
47 num = rand() % 1000; | 49 num = rand() % 1000; |
48 } | 50 } |
49 while ((num % 3) != 0) { | 51 while ((num % 3) != 0) { |
50 num = num + 1; | 52 num = num + 1; |
51 } | 53 } |
52 return num; | 54 return num; |
53 } | 55 } |
56 | |
54 int b() { | 57 int b() { |
55 int first_digits = rand() % 10000000; | 58 int first_digits; |
56 int last_digit = rand() % 10; | 59 int last_digit; |
57 while ((last_digit == 0) || (last_digit >= 8)) { | 60 int second_segment = 5; |
58 last_digit = rand() % 10; | |
59 } | |
60 std::string thisis = std::to_string(first_digits); | |
61 std::string veryfrustrating = std::to_string(last_digit); | |
62 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
63 int second_segment = std::stoi(second_segment_p1); | |
64 while (second_segment % 7 != 0) { | 61 while (second_segment % 7 != 0) { |
65 first_digits = rand() % 10000000; | 62 first_digits = rand() % 1000000; |
66 last_digit = rand() % 10; | 63 last_digit = rand() % 10; |
67 while ((last_digit == 0) || (last_digit >= 8)) { | 64 while ((last_digit == 0) || (last_digit >= 8)) { |
68 last_digit = rand() % 10; | 65 last_digit = rand() % 10; |
69 } | 66 } |
70 std::string thisis = std::to_string(first_digits); | 67 second_segment = std::stoi(std::to_string(first_digits) + std::to_string(last_digit)); |
71 std::string veryfrustrating = std::to_string(last_digit); | |
72 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
73 second_segment = std::stoi(second_segment_p1); | |
74 } | 68 } |
75 return second_segment; | 69 return second_segment; |
76 } | 70 } |
77 | 71 |
78 int c() { | 72 int c() { |
79 int new_site = rand() % 1000; | 73 int new_site = rand() % 1000; |
80 int ez_pwned = new_site % 10 + 1; | 74 int ez_pwned = new_site % 10 + 1; |
81 while (ez_pwned >= 10) { | 75 while (ez_pwned >= 10) { |
82 ez_pwned = ez_pwned - 10; | 76 ez_pwned = ez_pwned - 10; |
83 } | 77 } |
84 std::string thisisstill = std::to_string(new_site); | 78 return std::stoi(std::to_string(new_site) + std::to_string(ez_pwned)); |
85 std::string prettyfrustrating = std::to_string(ez_pwned); | |
86 std::string iamsocool = (std::string(thisisstill) + std::string(prettyfrustrating)); | |
87 int mysinusesareclogged = std::stoi(iamsocool); | |
88 return mysinusesareclogged; | |
89 } | 79 } |
90 | 80 |
91 int d() { | 81 int d() { |
92 int day = (rand() % 366) + 1; | |
93 const char * years[] = { | 82 const char * years[] = { |
94 "95", | 83 "95", |
95 "96", | 84 "96", |
96 "97", | 85 "97", |
97 "98", | 86 "98", |
101 "02", | 90 "02", |
102 "03" | 91 "03" |
103 }; | 92 }; |
104 int index = (rand() % 9); | 93 int index = (rand() % 9); |
105 const char * year = years[index]; | 94 const char * year = years[index]; |
106 std::string iamsotired = std::to_string(day); | 95 return std::stoi(std::to_string((rand() % 366) + 1) + year); |
107 std::string ofdoingthis = year; | |
108 std::string pleasehelp = (std::string(iamsotired) + std::string(ofdoingthis)); | |
109 int ohmygod = std::stoi(pleasehelp); | |
110 return ohmygod; | |
111 } | 96 } |
112 | 97 |
113 int e() { | 98 int e() { |
114 int first_digits = rand() % 1000000; | 99 int first_digits; |
115 int last_digit = rand() % 10; | 100 int last_digit; |
116 while ((last_digit == 0) || (last_digit >= 8)) { | 101 int second_segment = 5; |
117 last_digit = rand() % 10; | 102 int sum = 1; |
118 } | 103 while (sum % 7 != 0) { |
119 std::string thisis = std::to_string(first_digits); | 104 sum = 0; |
120 std::string veryfrustrating = std::to_string(last_digit); | 105 first_digits = rand() % 10000; |
121 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
122 int second_segment = std::stoi(second_segment_p1); | |
123 while (second_segment % 7 != 0) { | |
124 first_digits = rand() % 10000000; | |
125 last_digit = rand() % 10; | 106 last_digit = rand() % 10; |
126 while ((last_digit == 0) || (last_digit >= 8)) { | 107 while ((last_digit == 0) || (last_digit >= 8)) { |
127 last_digit = rand() % 10; | 108 last_digit = rand() % 10; |
128 } | 109 } |
129 std::string thisis = std::to_string(first_digits); | 110 std::string second_segment_p1 = (std::to_string(first_digits) + std::to_string(last_digit)); |
130 std::string veryfrustrating = std::to_string(last_digit); | |
131 std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); | |
132 second_segment = std::stoi(second_segment_p1); | 111 second_segment = std::stoi(second_segment_p1); |
112 for(char &c :second_segment_p1) { | |
113 sum += c - '0'; | |
114 } | |
133 } | 115 } |
134 return second_segment; | 116 return second_segment; |
135 } | 117 } |