19 Commits

Author SHA1 Message Date
TheTank20
6b85771db1 Static OpenSSL for macOS (#127) 2025-07-03 13:03:11 -05:00
TheTank20
8db1fe25d7 Make UMSKT (mostly) static on macOS (#126) 2025-07-03 12:11:00 -05:00
TheTank20
0db5d7f982 Universal binary compilation for macOS (#124) 2025-07-03 10:31:15 -05:00
TheTank20
25ed8d4f43 Merge pull request #120 from UMSKT/nodashes-cmd
Command line argument to remove dashes from product key
2025-06-18 21:50:16 -05:00
TheTank20
324688e9ef Update cli.cpp 2025-06-18 21:33:07 -05:00
TheTank20
6ae46d6aa2 duh 2025-06-18 21:24:37 -05:00
TheTank20
e07c080ee8 Update cli.h 2025-06-18 21:18:11 -05:00
TheTank20
ce9ff7e624 Revert "Update cli.h"
This reverts commit 714895c61b.
2025-06-18 21:17:08 -05:00
TheTank20
714895c61b Update cli.h 2025-06-18 21:13:50 -05:00
TheTank20
6ecf9c5309 Update cli.h 2025-06-18 21:09:15 -05:00
TheTank20
9f7d53dab3 Update cli.cpp 2025-06-18 21:08:02 -05:00
TheTank20
a66e579377 remove everything in a 2 mile radius 2025-06-10 23:43:31 -05:00
TheTank20
e30a4713b6 Update CMakeLists.txt 2025-06-10 23:34:14 -05:00
TheTank20
e9228045d3 Update dos-djgpp.yml 2025-06-10 22:38:03 -05:00
TheTank20
36de07ecdf Update dos-djgpp.yml 2025-06-10 22:33:18 -05:00
TheTank20
a28f4b5ca3 Update dos-djgpp.yml 2025-06-10 22:28:02 -05:00
TheTank20
a0cb9e9869 Update dos-djgpp.yml 2025-06-10 22:26:20 -05:00
TheTank20
6d30abba98 Update dos-djgpp.yml 2025-06-10 22:23:14 -05:00
TheTank20
8b6c3b252b Update dos-djgpp.yml 2025-06-10 22:20:39 -05:00
7 changed files with 112 additions and 16 deletions

View File

@@ -64,7 +64,7 @@ jobs:
git clone https://github.com/UMSKT/openssl.git openssl
pushd openssl
source ${{ github.workspace }}/djgpp/setenv
./Configure no-threads no-tests -DOPENSSL_DEV_NO_ATOMICS --prefix=${{ github.workspace }}/djgpp DJGPP
./Configure 386 no-threads no-tests no-sse2 no-asm -DOPENSSL_DEV_NO_ATOMICS -mno-mmx -mno-sse -mno-sse2 -march=i386 --prefix=${{ github.workspace }}/djgpp DJGPP
make && make install_sw
popd

View File

@@ -27,24 +27,58 @@ on:
workflow_dispatch:
jobs:
build-x86:
build:
runs-on: macos-latest
strategy:
matrix:
include:
- arch: x86_64
- arch: arm64
steps:
- name: Checkout Source Tree
uses: actions/checkout@v4
- name: Install Rosetta
if: matrix.arch == 'x86_64'
run: |
sudo softwareupdate --install-rosetta --agree-to-license || true
- name: Install Homebrew for x86_64
if: matrix.arch == 'x86_64'
env: { NONINTERACTIVE: 1 }
run: |
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Install x86_64 OpenSSL
if: matrix.arch == 'x86_64'
run: |
arch -x86_64 /usr/local/bin/brew install openssl@3
echo "OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@3/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/openssl@3/lib/pkgconfig" >> $GITHUB_ENV
- name: Install arm64 OpenSSL
if: matrix.arch == 'arm64'
run: |
brew install openssl@3
echo "OPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@3/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@3/lib/pkgconfig" >> $GITHUB_ENV
- name: Configure and build UMSKT
run: |
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake -DCMAKE_BUILD_TYPE=Release .. \
-DCMAKE_OSX_ARCHITECTURES=${{matrix.arch}} \
-DOPENSSL_ROOT_DIR=$OPENSSL_ROOT_DIR \
-DOPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \
-DOPENSSL_USE_STATIC_LIBS=TRUE \
-DBUILD_SHARED_LIBS=OFF
make
- name: Move files to correct directory
run: |
ls -a build
mkdir -p build/actions_upload
mv build/umskt build/actions_upload/umskt
@@ -53,8 +87,34 @@ jobs:
cd build/actions_upload
./umskt
- name: Upload build artifact
- name: Upload platform-specific build
uses: actions/upload-artifact@v4.6.2
with:
name: UMSKT-macOS-${{ matrix.arch }}
path: build/actions_upload
universal:
needs: build
runs-on: macos-latest
steps:
- name: Download x86_64 slice
uses: actions/download-artifact@v4
with:
name: UMSKT-macOS-x86_64
path: x86
- name: Download arm64 slice
uses: actions/download-artifact@v4
with:
name: UMSKT-macOS-arm64
path: arm
- name: Create universal binary
shell: bash
run: |
mkdir fat
lipo -create x86/umskt arm/umskt -output fat/umskt
lipo -info fat/umskt
- name: Upload universal build
uses: actions/upload-artifact@v4
with:
name: UMSKT-macOS-universal
path: fat

10
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,10 @@
# Stub so pre-commit can shut up until the refactor
repos:
- repo: local
hooks:
- id: no-op
name: Noop hook (always passes)
entry: "true" # `/usr/bin/true` returns 0 and does nothing
language: system
pass_filenames: false # dont bother passing any file paths

View File

@@ -40,9 +40,9 @@ OPTION(MSVC_MSDOS_STUB "Specify a custom MS-DOS stub for a 32-bit MSVC compilati
SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS})
SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS})
# macOS does not support static build
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(UMSKT_USE_SHARED_OPENSSL ON)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
endif()
# neither does dos idk i'm trying random stuff
@@ -70,12 +70,17 @@ IF(DJGPP_WATT32)
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
SET(UMSKT_LINK_LIBS ${UMSKT_LINK_LIBS} ${DJGPP_WATT32})
SET(UMSKT_LINK_DIRS ${UMSKT_LINK_DIRS} ${WATT_ROOT}/lib)
# Maximum compatibility flags for DOS/NTVDM
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i386 -mtune=i386 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -mno-ssse3 -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-avx -mno-avx2 -mno-fma -mno-fma4")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i386 -mtune=i386 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -mno-ssse3 -mno-sse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2 -mno-avx -mno-avx2 -mno-fma -mno-fma4")
MESSAGE(STATUS "[UMSKT] Using i386 target for DOS DGJPP")
ENDIF()
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(BUILD_SHARED_LIBS ON)
MESSAGE(STATUS "[UMSKT] macOS has no static library - Shared library forced on")
endif()
##if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
## SET(BUILD_SHARED_LIBS ON)
## MESSAGE(STATUS "[UMSKT] macOS has no static library - Shared library forced on")
##endif()
# if we're compiling with MSVC, respect the DEBUG compile option
IF(MSVC)
@@ -162,6 +167,7 @@ CPMAddPackage(
GITHUB_REPOSITORY fmtlib/fmt
GIT_TAG 10.0.0
VERSION 10.0.0
#OPTIONS "FMT_INSTALL YES" "BUILD_SHARED_LIBS OFF"
)
# Include cmrc resource compiler

View File

@@ -61,7 +61,7 @@ For Windows, click [here](https://slproweb.com/products/Win32OpenSSL.html) and c
*Note: This only applies if the build you download has OpenSSL embedded (static library) or not. You can usually tell if the download size is measured in KB or MB. If it's MB, you don't need this.*
#### 3. Run `umskt` to generate a key, or add `--help` or `-h` to see more options.
*Note: on macOS, like all unsigned executables, you'll need to hold Ctrl while right clicking and selecting Open to actually open it.*
#### 4. *(Activation step for `Retail` and `OEM` only)*
* After installation, you will be prompted to activate Windows.

View File

@@ -71,7 +71,8 @@ void CLI::showHelp(char *argv[]) {
fmt::print("\t-u --upgrade\tspecifies the Product Key will be an \"Upgrade\" version\n");
fmt::print("\t-V --validate\tproduct key to validate signature\n");
fmt::print("\t-N --nonewlines\tdisables newlines (for easier embedding in other apps)\n");
fmt::print("\t-o --override\tDisables version check for confirmation ID's, if you need this send an issue on GitHub");
fmt::print("\t-o --override\tDisables version check for confirmation IDs, if you need this send an issue on GitHub\n");
fmt::print("\t-D --nodashes\tDisables dashes in product keys and confirmation IDs (for easier copy-pasting)");
fmt::print("\n");
}
@@ -94,6 +95,7 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) {
false,
false,
false,
false,
MODE_BINK1998_GENERATE,
WINDOWS
};
@@ -214,6 +216,8 @@ int CLI::parseCommandLine(int argc, char* argv[], Options* options) {
options->nonewlines = true;
} else if (arg == "-o" || arg == "--override") {
options->overrideVersion = true;
} else if (arg == "-D" || arg == "--nodashes") {
options->nodashes = true;
} else {
options->error = true;
}
@@ -327,9 +331,14 @@ void CLI::printID(DWORD *pid) {
void CLI::printKey(char *pk) {
assert(strlen(pk) >= PK_LENGTH);
std::string keyFormat = "{}-{}-{}-{}-{}";
if (this->options.nodashes == true) {
keyFormat = "{}{}{}{}{}";
}
std::string spk = pk;
fmt::print("{}-{}-{}-{}-{}",
fmt::print(keyFormat,
spk.substr(0,5),
spk.substr(5,5),
spk.substr(10,5),
@@ -591,7 +600,17 @@ int CLI::ConfirmationID() {
return 1;
case SUCCESS:
if (this->options.nodashes == true) {
int j = 0;
for (int i = 0; confirmation_id[i] != '\0'; ++i) {
if (confirmation_id[i] != '-') {
confirmation_id[j++] = confirmation_id[i];
}
}
confirmation_id[j] = '\0';
}
fmt::print(confirmation_id);
if (this->options.nonewlines == false) {
fmt::print("\n");
}

View File

@@ -69,6 +69,7 @@ struct Options {
bool list;
bool nonewlines;
bool overrideVersion;
bool nodashes;
MODE applicationMode;
ACTIVATION_ALGORITHM activationMode;
@@ -93,7 +94,7 @@ public:
static int parseCommandLine(int argc, char* argv[], Options *options);
static int validateCommandLine(Options* options, char *argv[], json *keys);
static void printID(DWORD *pid);
static void printKey(char *pk);
void printKey(char *pk);
static bool stripKey(const char *in_key, char out_key[PK_LENGTH]);
int BINK1998Generate();