mirror of
https://github.com/Neo-Desktop/WindowsXPKg
synced 2025-06-19 03:54:16 +03:00
Compare commits
1 Commits
7a0faa42e8
...
neo-refact
Author | SHA1 | Date | |
---|---|---|---|
1cedbff4ef |
@ -244,13 +244,19 @@ BOOL CLI::processOptions()
|
|||||||
flavour = product;
|
flavour = product;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto pidtype = product["meta"]["type"];
|
||||||
|
if (flavour["meta"].contains("type"))
|
||||||
|
{
|
||||||
|
pidtype = flavour["meta"]["type"];
|
||||||
|
}
|
||||||
|
|
||||||
if (options.state != Options::STATE_PIDGEN_GENERATE && options.state != Options::STATE_PIDGEN_VALIDATE)
|
if (options.state != Options::STATE_PIDGEN_GENERATE && options.state != Options::STATE_PIDGEN_VALIDATE)
|
||||||
{
|
{
|
||||||
// exit early if we're not doing PIDGEN
|
// exit early if we're not doing PIDGEN
|
||||||
goto processOptionsExitEarly;
|
goto processOptionsExitEarly;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flavour["meta"]["type"] == "PIDGEN3")
|
if (pidtype == "PIDGEN3")
|
||||||
{
|
{
|
||||||
options.pidgenversion = Options::PIDGEN_VERSION::PIDGEN_3;
|
options.pidgenversion = Options::PIDGEN_VERSION::PIDGEN_3;
|
||||||
if (options.verbose)
|
if (options.verbose)
|
||||||
@ -272,7 +278,7 @@ BOOL CLI::processOptions()
|
|||||||
fmt::print("Selected BINK: {}\n", options.binkID);
|
fmt::print("Selected BINK: {}\n", options.binkID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (flavour["meta"]["type"] == "PIDGEN2")
|
else if (pidtype == "PIDGEN2")
|
||||||
{
|
{
|
||||||
options.pidgenversion = Options::PIDGEN_VERSION::PIDGEN_2;
|
options.pidgenversion = Options::PIDGEN_VERSION::PIDGEN_2;
|
||||||
if (options.verbose)
|
if (options.verbose)
|
||||||
@ -544,7 +550,7 @@ BOOL CLI::SetChannelIDOption(const std::string &channum)
|
|||||||
Integer channelID = UMSKT::IntegerS(channum);
|
Integer channelID = UMSKT::IntegerS(channum);
|
||||||
|
|
||||||
// channel ids must be between 000 and 999
|
// channel ids must be between 000 and 999
|
||||||
if (channelID > PIDGEN::MaxChannelID)
|
if (channelID >= PIDGEN::MaxChannelID)
|
||||||
{
|
{
|
||||||
fmt::print("ERROR: refusing to create a key with a Channel ID greater than 999\n");
|
fmt::print("ERROR: refusing to create a key with a Channel ID greater than 999\n");
|
||||||
return false;
|
return false;
|
||||||
@ -588,7 +594,7 @@ BOOL CLI::SetSerialOption(const std::string &arg)
|
|||||||
Integer Serial = UMSKT::IntegerS(arg);
|
Integer Serial = UMSKT::IntegerS(arg);
|
||||||
|
|
||||||
// serials must be between 000000 and 999999
|
// serials must be between 000000 and 999999
|
||||||
if (Serial > PIDGEN::MaxSerial)
|
if (Serial >= PIDGEN::MaxSerial)
|
||||||
{
|
{
|
||||||
fmt::print("ERROR: refusing to create a key with a Serial not between 000000 and 999999\n");
|
fmt::print("ERROR: refusing to create a key with a Serial not between 000000 and 999999\n");
|
||||||
return false;
|
return false;
|
||||||
|
@ -59,7 +59,7 @@ BOOL CLI::InitPIDGEN3(PIDGEN3 *p3)
|
|||||||
options.channelID.Randomize(UMSKT::rng, sizeof(DWORD32) * 8);
|
options.channelID.Randomize(UMSKT::rng, sizeof(DWORD32) * 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
options.channelID %= 999;
|
options.channelID %= 1000;
|
||||||
p3->info.ChannelID = options.channelID;
|
p3->info.ChannelID = options.channelID;
|
||||||
if (options.verbose)
|
if (options.verbose)
|
||||||
{
|
{
|
||||||
@ -162,7 +162,7 @@ BOOL CLI::PIDGEN3Generate(PIDGEN3 *p3)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make sure it's less than 999999
|
// make sure it's less than 999999
|
||||||
serialRnd %= 999999;
|
serialRnd %= 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
p3->info.isOEM = options.oem;
|
p3->info.isOEM = options.oem;
|
||||||
@ -316,4 +316,4 @@ BOOL CLI::PIDValidate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user