From cecd7555c67bc9d65ba15ef5e9133bed25efffc0 Mon Sep 17 00:00:00 2001 From: El-Virus Date: Sun, 8 Oct 2023 21:29:51 +0200 Subject: [PATCH] New keys.json format for CIDs, new way to display CIDs, Found actual valid CIDs --- keys.json | 270 +++++++++++++++++++++++++++++++++++++++++----------- src/cli.cpp | 53 +++++++++-- 2 files changed, 258 insertions(+), 65 deletions(-) diff --git a/keys.json b/keys.json index c57c260..1e5f907 100644 --- a/keys.json +++ b/keys.json @@ -1,160 +1,318 @@ { "Products": { "Windows CE Platform Builder 3": { - "BINK": ["00", "01", "0E", "0D", "0F"] + "BINK": { + "00": {}, + "01": {}, + "0E": {}, + "0D": {}, + "0F": {} + } }, "Windows CE .Net Platform Builder 4": { - "BINK": ["00", "01"] + "BINK": { + "00": {}, + "01": {} + } }, "Windows 98 (all)": { - "BINK": ["02","03"] + "BINK": { + "02": {}, + "03": {} + } }, "Office 2000": { - "BINK": ["04", "05"] + "BINK": { + "04": {}, + "05": {} + } }, "Internet Security and Acceleration (ISA) Server 2004": { - "BINK": ["06", "07"] + "BINK": { + "06": {}, + "07": {} + } }, "PLUS! for Windows XP": { - "BINK": ["08", "09"] + "BINK": { + "08": {}, + "09": {} + } }, "Windows 2000 Server (all)": { - "BINK": ["0A", "13"] + "BINK": { + "0A": {}, + "13": {} + } }, "Office Communicator 2007": { - "BINK": ["0C", "0D"] + "BINK": { + "0C": {}, + "0D": {} + } }, "Windows Embedded POSReady 2009": { - "BINK": ["0D", "0D"] + "BINK": { + "0D": {}, + "0D": {} + } }, "Windows CE .Net Platform Builder 5": { - "BINK": ["0D", "0D"] + "BINK": { + "0D": {}, + "0D": {} + } }, "Commerce Server 2002": { - "BINK": ["0E", "0F"] + "BINK": { + "0E": {}, + "0F": {} + } }, "Windows 2000 Professional": { - "BINK": ["12", "13"] + "BINK": { + "12": {}, + "13": {} + } }, "Office for Mac 2004 / 2008": { - "BINK": ["18", "19"] + "BINK": { + "18": {}, + "19": {} + } }, "Windows ME": { - "BINK": ["1C", "1D"] + "BINK": { + "1C": {}, + "1D": {} + } }, "Office XP Applications": { - "BINK": ["20", "21"] + "BINK": { + "20": {}, + "21": {} + } }, "Works Suite 2003 and 2004": { - "BINK": ["20", "21"] + "BINK": { + "20": {}, + "21": {} + } }, "Office XP": { - "BINK": ["22", "23"] + "BINK": { + "22": {}, + "23": {} + } }, "Visual Studio .Net / .Net 2003": { - "BINK": ["24", "25"] + "BINK": { + "24": {}, + "25": {} + } }, "Windows XP Professional Evaluation": { - "BINK": ["28", "29"] + "BINK": { + "28": {}, + "29": {} + } }, "Windows XP Home": { - "BINK": ["2A", "2B"] + "BINK": { + "2A": {}, + "2B": {} + } }, "Windows XP Pro": { - "BINK": ["2C", "2D"], - "CID": { - "OEM": "90, 113, 119", - "Retail": "[5, 90] U [95, 100] U [114, 116] U [120, 269] U [271, 366] U [370 U 385] U [400, 665] U [667, 799] U [803, 979]", - "TablePC": "111, 112, [337, 369]" + "BINK": { + "2C": { + "Retail": [[5, 90], [95, 99], [114, 116], [311, 334], 336, [370, 385], [755, 779], [785, 789]], + "TablePC": [111, 112, [337, 369]] + }, + "2D": { + "OEM": [[100, 110], 114, [120, 269], [271, 336], [370, 665], [667, 754], [780, 799], [803, 979]], + "OEM-SLP": [90, 113, 119] + } } }, "Windows XP Pro IA-64": { - "BINK": ["2C", "2D"] + "BINK": { + "2C": {}, + "2D": {} + } }, "Windows XP Pro VLK": { - "BINK": ["2E", "2F"] + "BINK": { + "2E": {}, + "2F": {} + } }, "Windows XP Fundamentals for Legacy PCs": { - "BINK": ["2E", "2F"] + "BINK": { + "2E": {}, + "2F": {} + } }, "Windows XP Professional K": { - "BINK": ["30", "31"] + "BINK": { + "30": {}, + "31": {} + } }, "Windows XP Starter Edition": { - "BINK": ["32", "33"] + "BINK": { + "32": {}, + "33": {} + } }, "Windows Longhorn (6.0.3683.0 -> 6.0.4029.0)": { - "BINK": ["40", "41"] + "BINK": { + "40": {}, + "41": {} + } }, "Halo: Combat Evolved": { - "BINK": ["50", "51"] + "BINK": { + "50": {}, + "51": {} + } }, "Halo: Custom Edition": { - "BINK": ["50", "51"] + "BINK": { + "50": {}, + "51": {} + } }, "Visual Studio 2005": { - "BINK": ["52", "53"] + "BINK": { + "52": {}, + "53": {} + } }, "Plus! Digital Media Edition for Windows XP": { - "BINK": ["52", "53"] + "BINK": { + "52": {}, + "53": {} + } }, "Windows Longhorn (6.0.4033.0)": { - "BINK": ["54", "55"] + "BINK": { + "54": {}, + "55": {} + } }, "Windows Server 2003": { - "BINK": ["54", "55", "58", "59"] + "BINK": { + "54": {}, + "55": {}, + "58": {}, + "59": {} + } }, "Windows Server 2003 VLK": { - "BINK": ["5A", "5B"] + "BINK": { + "5A": {}, + "5B": {} + } }, "Windows XP Pro 64 Bit Edition VLK": { - "BINK": ["64", "65"] + "BINK": { + "64": {}, + "65": {} + } }, "Windows XP Pro 64 Bit Edition": { - "BINK": ["66", "67"], - "CID": { - "Retail": "[306, 370]", - "TablePC": "[371, 410]" + "BINK": { + "66": { + "Retail": [[306, 370]], + "TablePC": [[371, 410]] + }, + "67": { + "OEM": [[5, 118]] + } } }, "Windows Server 2003 64 Bit": { - "BINK": ["68", "69", "6C", "6D"] + "BINK": { + "68": {}, + "69": {}, + "6C": {}, + "6D": {} + } }, "Windows Server 2003 64 Bit VLK": { - "BINK": ["68", "69", "6C", "6D"] + "BINK": { + "68": {}, + "69": {}, + "6C": {}, + "6D": {} + } }, "Office 2003 Applications": { - "BINK": ["6E", "6F"] + "BINK": { + "6E": {}, + "6F": {} + } }, "Office 2003 Small Business": { - "BINK": ["70", "71"] + "BINK": { + "70": {}, + "71": {} + } }, "Office 2003 Student and Teacher": { - "BINK": ["70", "71"] + "BINK": { + "70": {}, + "71": {} + } }, "Office 2003 Professional": { - "BINK": ["72", "73"] + "BINK": { + "72": {}, + "73": {} + } }, "Windows Longhorn (6.0.4039.0 -> Pre PIDGENX)": { - "BINK": ["74", "75"] + "BINK": { + "74": {}, + "75": {} + } }, "Identity Lifecycle Manager 2007": { - "BINK": ["78", "79"] + "BINK": { + "78": {}, + "79": {} + } }, "Visual Studio 2008": { - "BINK": ["78", "79"] + "BINK": { + "78": {}, + "79": {} + } }, "Office 2007 Applications": { - "BINK": ["7E", "7F"] + "BINK": { + "7E": {}, + "7F": {} + } }, "Office 2007 Basic / Small Business": { - "BINK": ["80", "81"] + "BINK": { + "80": {}, + "81": {} + } }, "Office 2007 Standard / Professional / Ultimate / Enterprise": { - "BINK": ["82", "83"] + "BINK": { + "82": {}, + "83": {} + } }, "Office 2007 Home & Student": { - "BINK": ["88", "89"] + "BINK": { + "88": {}, + "89": {} + } } }, "BINK": { diff --git a/src/cli.cpp b/src/cli.cpp index 883b17a..3e418ec 100644 --- a/src/cli.cpp +++ b/src/cli.cpp @@ -65,7 +65,7 @@ void CLI::showHelp(char *argv[]) { fmt::print("\t-m --mode\tproduct family to activate.\n\t\t\tvalid options are \"WINDOWS\", \"OFFICEXP\", \"OFFICE2K3\", \"OFFICE2K7\" or \"PLUSDME\"\n\t\t\t(defaults to \"WINDOWS\")\n"); fmt::print("\t-p --productid\tthe product ID of the Program to activate. only required for Office 2K3 and Office 2K7 programs\n"); fmt::print("\t-b --binkid\tspecify which BINK identifier to load (defaults to 2E)\n"); - fmt::print("\t-l --list\tshow which products/binks can be loaded\n"); + fmt::print("\t-l --list\tshow which products/binks (and their associated channel ids) can be loaded\n"); fmt::print("\t-c --channelid\tspecify which Channel Identifier to use (defaults to 640)\n"); fmt::print("\t-s --serial\tspecifies a serial to use in the product ID (defaults to random, BINK1998 only)\n"); fmt::print("\t-u --upgrade\tspecifies the Product Key will be an \"Upgrade\" version\n"); @@ -253,17 +253,52 @@ int CLI::validateCommandLine(Options* options, char *argv[], json *keys) { } if (options->list) { + //List each product for (auto el : (*keys)["Products"].items()) { - int id; - sscanf((el.value()["BINK"][0]).get().c_str(), "%x", &id); - std::cout << el.key() << ": " << el.value()["BINK"] << std::endl; - if (!el.value()["CID"].is_null() && !el.value()["CID"].empty()) { - std::cout << "\t" << "Valid Channel IDs:" << std::endl; - for (auto range : el.value()["CID"].items()) { - std::cout << "\t\t" << range.key() << ": " << range.value() << std::endl; + std::cout << el.key() << ": ["; + + //List each bink + bool f = false; + for (auto bink : el.value()["BINK"].items()) { + if (bink.value().empty()) { //If no CIDs are associated + if (f) { std::cout << ", "; } else { f = true; } + std::cout << bink.key(); + } else { //If CIDs are associated + size_t padding = el.key().length() + 2; + if (!f) { std::cout << std::endl; + for (int i = 0; i < padding; i++) { + std::cout << " "; + } + f = true; + } + std::cout << " "; + + std::cout << bink.key() << ":" << std::endl; + + //List each CID + for (auto cids : bink.value().items()) { + for (int i = 0; i < padding + 5; i++) { + std::cout << " "; + } + + std::cout << cids.key() << ": "; + + //List each CID's values + bool ff = false; + for (auto cid : cids.value().items()) { + if (ff) { std::cout << ", "; } else { ff = true; } + std::cout << cid.value(); + } + + std::cout << std::endl; + } + + for (int i = 0; i < padding; i++) { + std::cout << " "; + } } - std::cout << std::endl; } + std::cout << "]" << std::endl; } fmt::print("\n\n");