mirror of
https://github.com/Neo-Desktop/WindowsXPKg
synced 2026-11-05 16:23:19 +02:00
To slop SSL away (#191)
* windows 98/nt4, slopped openssl away * one (1) roadblock that it can't figure out * fixed maybe * fix dos? * fix dos? (2) * ts is gonna be slow * No need to compress anymore * No need to compress anymore (2) * deslop The main problem with AI models, even today, is that they're very shortsighted. They're too focused on the thing working now than thinking about how maintainable it will be later. As such, you get duplicated code, as well as comments that are geared towards what it's doing right then and there (as if it's an advertisement of it's services) rather than improving the readability of the code. Always check your diffs. * Update workflows * Update freebsd.yml * Update README.md
This commit is contained in:
1 parent
4a6cb3cd31
commit
f9100e0871
41 files changed
+4758
-1743
No files matched your search
@@ -22,6 +22,18 @@
|
||||
|
||||
#include "PIDGEN2.h"
|
||||
|
||||
static int parse_i(const char *text) {
|
||||
int value = 0;
|
||||
if (!text) {
|
||||
return 0;
|
||||
}
|
||||
while (*text >= '0' && *text <= '9') {
|
||||
value = value * 10 + (*text - '0');
|
||||
text++;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
const char* channelIDBlacklist [7] = {"333", "444", "555", "666", "777", "888", "999"};
|
||||
const char* validYears[8] = { "95", "96", "97", "98", "99", "00", "01", "02"};
|
||||
|
||||
@@ -93,7 +105,7 @@ bool PIDGEN2::isValidDay(char* day) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int iDay = std::stoi(day);
|
||||
int iDay = parse_i(day);
|
||||
if (iDay == 0 || iDay >= 365) {
|
||||
return false;
|
||||
}
|
||||
@@ -117,7 +129,9 @@ int PIDGEN2::GenerateOEM(char* year, char* day, char* oem, char* &keyout) {
|
||||
int mod = addDigits(oem);
|
||||
mod += mod % 21;
|
||||
|
||||
strcpy(oem, fmt::format("{:07d}", mod).c_str());
|
||||
char formatted[16];
|
||||
snprintf(formatted, sizeof(formatted), "%07d", mod);
|
||||
strcpy(oem, formatted);
|
||||
}
|
||||
|
||||
if (!isValidYear(year)) {
|
||||
@@ -125,11 +139,16 @@ int PIDGEN2::GenerateOEM(char* year, char* day, char* oem, char* &keyout) {
|
||||
}
|
||||
|
||||
if (!isValidDay(day)) {
|
||||
int iday = std::stoi(day);
|
||||
int iday = parse_i(day);
|
||||
iday = (iday + 1) % 365;
|
||||
(void)iday;
|
||||
}
|
||||
|
||||
strcpy(keyout, fmt::format("{}{}-OEM-{}-{}", year, day, oem, oem).c_str());
|
||||
{
|
||||
char formatted[64];
|
||||
snprintf(formatted, sizeof(formatted), "%s%s-OEM-%s-%s", year, day, oem, oem);
|
||||
strcpy(keyout, formatted);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user