mirror of
https://github.com/Neo-Desktop/WindowsXPKg
synced 2025-09-08 02:40:59 +03:00
Compare commits
10 Commits
972eef88b6
...
change-ico
Author | SHA1 | Date | |
---|---|---|---|
|
11708b6af7 | ||
|
65b54c698c | ||
|
2bcc9d5178 | ||
|
af058711ec | ||
|
793432f07b | ||
|
8cb00c165d | ||
|
070dbe46d0 | ||
|
51248fb5cc | ||
|
bda0ea93c8 | ||
|
843b904639 |
2
.github/workflows/dos-djgpp.yml
vendored
2
.github/workflows/dos-djgpp.yml
vendored
@@ -18,7 +18,7 @@
|
|||||||
# @FileCreated by Neo on 06/19/2023
|
# @FileCreated by Neo on 06/19/2023
|
||||||
# @Maintainer Neo
|
# @Maintainer Neo
|
||||||
|
|
||||||
name: DOS DJGPP
|
name: C/C++ CI (DOS DJGPP)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
2
.github/workflows/freebsd.yml
vendored
2
.github/workflows/freebsd.yml
vendored
@@ -18,7 +18,7 @@
|
|||||||
# @FileCreated by techguy16 on 07/23/2023
|
# @FileCreated by techguy16 on 07/23/2023
|
||||||
# @Maintainer techguy16
|
# @Maintainer techguy16
|
||||||
|
|
||||||
name: FreeBSD
|
name: C/C++ CI (FreeBSD)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
#push:
|
#push:
|
||||||
|
2
.github/workflows/linux.yml
vendored
2
.github/workflows/linux.yml
vendored
@@ -18,7 +18,7 @@
|
|||||||
# @FileCreated by TheTank20 on 06/13/2023
|
# @FileCreated by TheTank20 on 06/13/2023
|
||||||
# @Maintainer Neo
|
# @Maintainer Neo
|
||||||
|
|
||||||
name: Linux
|
name: C/C++ CI (Linux)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
2
.github/workflows/macos.yml
vendored
2
.github/workflows/macos.yml
vendored
@@ -18,7 +18,7 @@
|
|||||||
# @FileCreated by techguy16 on 07/23/2023
|
# @FileCreated by techguy16 on 07/23/2023
|
||||||
# @Maintainer techguy16
|
# @Maintainer techguy16
|
||||||
|
|
||||||
name: macOS
|
name: C/C++ CI (macOS)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
2
.github/workflows/windows-arm.yml
vendored
2
.github/workflows/windows-arm.yml
vendored
@@ -18,7 +18,7 @@
|
|||||||
# @FileCreated by TheTank20 on 07/08/2025
|
# @FileCreated by TheTank20 on 07/08/2025
|
||||||
# @Maintainer Neo
|
# @Maintainer Neo
|
||||||
|
|
||||||
name: Windows ARM
|
name: C/C++ CI (Windows ARM)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
2
.github/workflows/windows-x86-x64.yml
vendored
2
.github/workflows/windows-x86-x64.yml
vendored
@@ -18,7 +18,7 @@
|
|||||||
# @FileCreated by TheTank20 on 07/08/2025
|
# @FileCreated by TheTank20 on 07/08/2025
|
||||||
# @Maintainer Neo
|
# @Maintainer Neo
|
||||||
|
|
||||||
name: Windows x86+64
|
name: C/C++ CI (Windows x86+64)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@@ -27,11 +27,6 @@ if (WIN32 AND NOT MSVC)
|
|||||||
set(CMAKE_CXX_COMPILER "C:/TDM-GCC-64/bin/g++.exe" CACHE FILEPATH "C++ Compiler" FORCE)
|
set(CMAKE_CXX_COMPILER "C:/TDM-GCC-64/bin/g++.exe" CACHE FILEPATH "C++ Compiler" FORCE)
|
||||||
message(STATUS "[UMSKT] Forcing use of TDM-GCC in C:/TDM-GCC-64")
|
message(STATUS "[UMSKT] Forcing use of TDM-GCC in C:/TDM-GCC-64")
|
||||||
|
|
||||||
# Add size optimization flags for GCC
|
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os -s -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-stack-protector")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os -s -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -fno-stack-protector")
|
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections -Wl,--strip-all")
|
|
||||||
|
|
||||||
# Configure windres for resource compilation
|
# Configure windres for resource compilation
|
||||||
set(CMAKE_RC_COMPILER "C:/TDM-GCC-64/bin/windres.exe")
|
set(CMAKE_RC_COMPILER "C:/TDM-GCC-64/bin/windres.exe")
|
||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
set(CMAKE_RC_COMPILER_INIT windres)
|
||||||
@@ -128,13 +123,13 @@ ENDIF()
|
|||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
SET(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
SET(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
IF(NOT BUILD_SHARED_LIBS)
|
IF(NOT BUILD_SHARED_LIBS)
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /Os /GL /GS- /Gy")
|
SET(CMAKE_CXX_FLAGS_RELEASE "/MT")
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd")
|
SET(CMAKE_CXX_FLAGS_DEBUG "/MTd")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /Os /GL /GS- /Gy")
|
SET(CMAKE_CXX_FLAGS_RELEASE "/MD")
|
||||||
SET(CMAKE_CXX_FLAGS_DEBUG "/MDd")
|
SET(CMAKE_CXX_FLAGS_DEBUG "/MDd")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NODEFAULTLIB:MSVCRT /OPT:REF /OPT:ICF")
|
SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NODEFAULTLIB:MSVCRT")
|
||||||
SET(CMAKE_ENABLE_EXPORTS ON)
|
SET(CMAKE_ENABLE_EXPORTS ON)
|
||||||
SET(UMSKT_EXE_WINDOWS_EXTRA src/windows/umskt.rc)
|
SET(UMSKT_EXE_WINDOWS_EXTRA src/windows/umskt.rc)
|
||||||
SET(UMSKT_EXE_WINDOWS_DLL src/windows/dllmain.cpp)
|
SET(UMSKT_EXE_WINDOWS_DLL src/windows/dllmain.cpp)
|
||||||
|
32
README.md
32
README.md
@@ -1,26 +1,24 @@
|
|||||||
<p align="center"><img src="https://avatars.githubusercontent.com/u/135211890?s=128&c=0" alt="umskt logo"/></p>
|
# Universal MS Key Toolkit (UMSKT)
|
||||||
|
|
||||||
<h1 align="center"><b>U</b>niversal <b>MS</b> <b>K</b>ey <b>T</b>oolkit (UMSKT)</h1>
|
|
||||||
|
|
||||||
<p align="center">An open source toolkit designed to generate licence keys for MS products circa 1998 - 2006</p>
|
|
||||||
<hr />
|
|
||||||
|
|
||||||
**Connect with us**
|
**Connect with us**
|
||||||
|
|
||||||
[](https://discord.gg/PpBSpuphWM)
|
|
||||||
[](https://web.libera.chat/gamja/?nick=Guest?#mspid)
|
|
||||||
[](https://umskt.zulipchat.com)
|
[](https://umskt.zulipchat.com)
|
||||||
|
[](https://web.libera.chat/gamja/?nick=Guest?#mspid)
|
||||||
|
[](https://discord.gg/PpBSpuphWM)
|
||||||
|
|
||||||
----
|
**Build status**
|
||||||
|
|
||||||
| CI Build status |
|
[](../../actions/workflows/windows-x86-x64.yml)
|
||||||
| ------------ |
|
|
||||||
| [](../../actions/workflows/windows-x86-x64.yml) |
|
[](../../actions/workflows/windows-arm.yml)
|
||||||
| [](../../actions/workflows/windows-arm.yml) |
|
|
||||||
| [](../../actions/workflows/macos.yml) |
|
[](../../actions/workflows/macos.yml)
|
||||||
| [](../../actions/workflows/linux.yml) |
|
|
||||||
| [](../../actions/workflows/freebsd.yml) |
|
[](../../actions/workflows/linux.yml)
|
||||||
| [](../../actions/workflows/dos-djgpp.yml) |
|
|
||||||
|
[](../../actions/workflows/freebsd.yml)
|
||||||
|
|
||||||
|
[](../../actions/workflows/dos-djgpp.yml)
|
||||||
|
|
||||||
------
|
------
|
||||||
|
|
||||||
|
31
src/cli.cpp
31
src/cli.cpp
@@ -61,7 +61,7 @@ void CLI::showHelp(char *argv[]) {
|
|||||||
fmt::print("\t-v --verbose\tenable verbose output\n");
|
fmt::print("\t-v --verbose\tenable verbose output\n");
|
||||||
fmt::print("\t-n --number\tnumber of keys to generate (defaults to 1)\n");
|
fmt::print("\t-n --number\tnumber of keys to generate (defaults to 1)\n");
|
||||||
fmt::print("\t-f --file\tspecify which keys file to load\n");
|
fmt::print("\t-f --file\tspecify which keys file to load\n");
|
||||||
fmt::print("\t-i --instid\tinstallation ID used to generate confirmation ID (reads from stdin if no argument provided)\n");
|
fmt::print("\t-i --instid\tinstallation ID used to generate confirmation ID\n");
|
||||||
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-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-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-b --binkid\tspecify which BINK identifier to load (defaults to 2E)\n");
|
||||||
@@ -168,14 +168,14 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) {
|
|||||||
options->keysFilename = argv[i+1];
|
options->keysFilename = argv[i+1];
|
||||||
i++;
|
i++;
|
||||||
} else if (arg == "-i" || arg == "--instid") {
|
} else if (arg == "-i" || arg == "--instid") {
|
||||||
options->applicationMode = MODE_CONFIRMATION_ID;
|
if (i == argc - 1) {
|
||||||
if (i == argc - 1 || argv[i+1][0] == '-') {
|
options->error = true;
|
||||||
// No argument provided, will read from stdin later
|
break;
|
||||||
options->instid = "";
|
|
||||||
} else {
|
|
||||||
options->instid = argv[i+1];
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
options->instid = argv[i+1];
|
||||||
|
options->applicationMode = MODE_CONFIRMATION_ID;
|
||||||
|
i++;
|
||||||
} else if (arg == "-m" || arg == "--mode") {
|
} else if (arg == "-m" || arg == "--mode") {
|
||||||
std::string mode = argv[i+1];
|
std::string mode = argv[i+1];
|
||||||
char *p = &mode[0];
|
char *p = &mode[0];
|
||||||
@@ -369,12 +369,6 @@ bool CLI::stripKey(const char *in_key, char out_key[PK_LENGTH]) {
|
|||||||
return (i == PK_LENGTH);
|
return (i == PK_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CLI::readFromStdin() {
|
|
||||||
std::string input;
|
|
||||||
std::getline(std::cin, input);
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
CLI::CLI(Options options, json keys) {
|
CLI::CLI(Options options, json keys) {
|
||||||
this->options = options;
|
this->options = options;
|
||||||
this->keys = keys;
|
this->keys = keys;
|
||||||
@@ -578,14 +572,7 @@ int CLI::BINK2002Validate() {
|
|||||||
|
|
||||||
int CLI::ConfirmationID() {
|
int CLI::ConfirmationID() {
|
||||||
char confirmation_id[49];
|
char confirmation_id[49];
|
||||||
std::string instid = this->options.instid;
|
int err = ConfirmationID::Generate(this->options.instid.c_str(), confirmation_id, options.activationMode, options.productid, options.overrideVersion);
|
||||||
|
|
||||||
// If instid is empty, read from stdin
|
|
||||||
if (instid.empty()) {
|
|
||||||
instid = readFromStdin();
|
|
||||||
}
|
|
||||||
|
|
||||||
int err = ConfirmationID::Generate(instid.c_str(), confirmation_id, options.activationMode, options.productid, options.overrideVersion);
|
|
||||||
|
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case ERR_TOO_SHORT:
|
case ERR_TOO_SHORT:
|
||||||
|
@@ -96,7 +96,6 @@ public:
|
|||||||
static void printID(DWORD *pid);
|
static void printID(DWORD *pid);
|
||||||
void printKey(char *pk);
|
void printKey(char *pk);
|
||||||
static bool stripKey(const char *in_key, char out_key[PK_LENGTH]);
|
static bool stripKey(const char *in_key, char out_key[PK_LENGTH]);
|
||||||
static std::string readFromStdin();
|
|
||||||
|
|
||||||
int BINK1998Generate();
|
int BINK1998Generate();
|
||||||
int BINK2002Generate();
|
int BINK2002Generate();
|
||||||
|
Reference in New Issue
Block a user