Skip to content

Commit 2d60ff1

Browse files
committed
Make it installable: Add comprehensive documentation and Multi-platform Release distribution workflow
1 parent bcf3ff2 commit 2d60ff1

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release Build Distribution
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
name: Compile for ${{ matrix.target }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: windows-latest
21+
target: x86_64-pc-windows-msvc
22+
artifact_name: gpupatch.exe
23+
asset_name: gpupatch-windows-amd64.exe
24+
- os: ubuntu-latest
25+
target: x86_64-unknown-linux-gnu
26+
artifact_name: gpupatch
27+
asset_name: gpupatch-linux-amd64
28+
- os: macos-latest
29+
target: x86_64-apple-darwin
30+
artifact_name: gpupatch
31+
asset_name: gpupatch-macos-amd64
32+
- os: macos-latest
33+
target: aarch64-apple-darwin
34+
artifact_name: gpupatch
35+
asset_name: gpupatch-macos-arm64
36+
37+
steps:
38+
- name: Checkout Source
39+
uses: actions/checkout@v4
40+
41+
- name: Install Rust
42+
uses: actions-rs/toolchain@v1
43+
with:
44+
toolchain: stable
45+
target: ${{ matrix.target }}
46+
override: true
47+
48+
- name: Compile Production Binary
49+
run: cargo build --release --target ${{ matrix.target }}
50+
51+
- name: Stage Assets for Upload
52+
shell: bash
53+
run: |
54+
if [ "${{ matrix.os }}" = "windows-latest" ]; then
55+
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./${{ matrix.asset_name }}
56+
else
57+
cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ./${{ matrix.asset_name }}
58+
chmod +x ./${{ matrix.asset_name }}
59+
fi
60+
61+
- name: Upload to GitHub Release
62+
uses: softprops/action-gh-release@v1
63+
with:
64+
files: |
65+
${{ matrix.asset_name }}
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# gpupatch 🚀
2+
3+
A highly optimized, dependency-free Rust engine for hot-patching Windows Portable Executable (PE) binaries to enforce high-performance discrete GPU utilization.
4+
5+
[![Rust PE Patcher Verification](https://github.com/CynToolkit/gpupatch/actions/workflows/ci.yml/badge.svg)](https://github.com/CynToolkit/gpupatch/actions/workflows/ci.yml)
6+
7+
## Features
8+
-**Blazing Fast**: Native Rust implementation with zero external runtime dependencies.
9+
- 🔬 **Ultra Reliable**: Passes 100% bitwise parity tests against reference C# implementation and performs safely even on heavyweight (100MB+) Chromium/Electron browser shells.
10+
- 📦 **Modern PE Handling**: Complies strictly with official PE specification regarding ordinal sorting and manifest preservation.
11+
- 💉 **Safe Injection**: Seamlessly injects `NvOptimusEnablement` and `AmdPowerXpressRequestHighPerformance` symbols into preexisting massive export tables.
12+
- 🔥 **In-Place Patching**: Intelligently toggles symbols in-place on previously patched binaries instead of expanding executable footprint.
13+
14+
## Installation
15+
16+
### Option 1: Direct Install via Cargo (Recommended)
17+
If you have Rust installed, you can compile and install globally with a single command:
18+
```bash
19+
cargo install --git https://github.com/CynToolkit/gpupatch.git
20+
```
21+
22+
### Option 2: Building from Source
23+
```bash
24+
git clone https://github.com/CynToolkit/gpupatch.git
25+
cd gpupatch
26+
cargo build --release
27+
```
28+
The compiled binary will be available at `./target/release/gpupatch` (or `gpupatch.exe` on Windows).
29+
30+
## Usage
31+
32+
To force an executable to utilize the dedicated high-performance GPU:
33+
```bash
34+
gpupatch <input.exe> [<output.exe>]
35+
```
36+
37+
To undo the patch:
38+
```bash
39+
gpupatch <input.exe> --disable
40+
```
41+
42+
## Testing
43+
The test suite includes unit test verification and deterministic parity simulation:
44+
```bash
45+
cargo test
46+
```

0 commit comments

Comments
 (0)