Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gzinject #164

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions tools/gzinject/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build

on:
push:
pull_request:

jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
include:
- platform: ubuntu-latest
name: linux-x86_64
extension: ""
- platform: windows-latest
name: windows-x86_64
extension: ".exe"
- platform: macos-latest
name: macos-universal
extension: ""
defaults:
run:
shell: bash

steps:
# Checkout the repository (shallow clone)
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

# Set Git config
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

# Build the project
- name: Build
run: ./configure && make

# Upload the binary if we're on the master branch
- name: Upload artifact
if: ${{ github.ref == 'refs/heads/master' }}
uses: actions/upload-artifact@v4
with:
name: gzinject-${{ matrix.name }}
path: ./gzinject${{ matrix.extension }}
2 changes: 1 addition & 1 deletion tools/gzinject/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ wadextract/
isoextract/
*.o
Makefile
config.*
config.status
gzinject
*.zip
autom4te.cache/
47 changes: 29 additions & 18 deletions tools/gzinject/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## About

gzinject is a wad editing utility, primarily used for patching N64 VC Emulators, and replacing the rom inside. gzinject uses patch files to patch content files within the wad. A description of the patch file format can be seen in the [Patch](#Patch) section.
gzinject is a Wii .wad and GameCube .iso editing utility, primarily used for patching N64 VC Emulators, and replacing the rom inside. gzinject uses patch files to patch content files within the wad or iso. A description of the patch file format can be seen in the [Patch](#Patch) section.

## Executable

Expand All @@ -12,33 +12,43 @@ Prebuilt Windows executable is contained under releases (https://github.com/krim
```
Usage:
gzinject -a extract -w SOURCEWAD [options]
gzinject -a extract -s SOURCEISO [options]
gzinject -a pack -w DESTWAD [options]
gzinject -a pack -s DESTISO [options]
gzinject -a inject -w SOURCEWAD -m ROM [options]
gzinject -a inject -s SOURCEISO -m ROM [options]
gzinject -a romc -m INROM -o OUTROM [options]
gzinject -a genkey [options]
gzinject --help
gzinject --version

Actions:
extract extracts SOURCEWAD to directory
pack packs directory into DESTWAD
inject injects rom into SOURCEWAD
extract extracts SOURCEWAD or SOURCEISO to directory
pack packs directory into DESTWAD or DESTISO
inject injects rom into SOURCEWAD or SOURCEISO
romc decompresses a romc compressed rom
genkey generates wii common-key

Options:
-i, --channelid=ID New Channel ID For Pack and Inject actions (default: none)
-t, --title=title New Channel name for pack and inject actions (default: none)
-i, --channelid=ID, --gameid=ID
New channel ID for game ID For pack and inject actions (default: none)
-t, --channeltitle=title, --gamename=title
New channel name or game name for pack and inject actions (default: none)
-h, --help Prints this help message
-k, --key=keyfile Location of the common-key file (default: common-key.bin)
-r, --region=1-3 Region to use (default: 3)
-k, --key=keyfile Location of the wii common-key file (default: ./common-key.bin)
-r, --region=1-3 Wii region to use (default: 3)
--verbose Print out verbose program execution information
-d, --directory=directory Directory to extract contents to, or directory to read contents from (default: wadextract)
-d, --directory=directory Directory to extract contents to, or directory to read contents from (default: ./wadextract or ./isoextract)
--cleanup Remove files before performing actions
--version Prints the current version
-m, --rom=rom Rom to inject for inject action (default: none)
-o, --outputwad=outwad The output wad for inject actions (default: SOURCEWAD-inject.wad)
-m, --rom=rom Rom to inject for inject action (default: none), also rom to romc decompress
--iso-rom-path For gamecube isos, path to the rom file inside the iso
-o, --outputwad=outwad, --outputiso=outiso
The output wad or iso for inject actions (default: SOURCEWAD-inject.wad or SOURCEISO-inject.iso), also output for romc decompression
-p, --patch-file=patchfile gzi file to use for applying patches (default: none)
-c, --content=contentfile the primary content file (default: 5)
-c, --content=contentfile the primary wii content file (default: 5)
--dol-inject Binary data to inject into the emulator program, requires --dol-loading
--dol-iso-path For gamecube isos, path to the dol file inside the iso
--dol-loading The loading address for the binary specified by --dol-inject
--dol-after After which patch file to inject the dol, default: after all patches
```
Expand Down Expand Up @@ -66,9 +76,10 @@ Sizes:

## Thanks/Authors

gzinject was primarily written by me.\n
Thanks to glankk (https://github.com/glankk) for providing memory/controller fixes for OOT as well as debugging, testing, and providing fixes for various errors\
The general workflow of extracting/packing the wad was taken from showmiiwads (https://github.com/dnasdw/showmiiwads/)\
AES encryption/decryption was taken from kokke (https://github.com/kokke/tiny-AES-c)\
SHA1 taken from clibs (https://github.com/clibs/sha1)\
MD5 taken from Alexander Peslyak http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
gzinject was primarily written by KrimtonZ (https://github.com/krimtonz/gzinject) \
Thanks to glankk (https://github.com/glankk) for providing memory/controller fixes for OOT as well as debugging, testing, and providing fixes for various errors \
The general workflow of extracting/packing the wad was taken from showmiiwads (https://github.com/dnasdw/showmiiwads/) \
AES encryption/decryption was taken from kokke (https://github.com/kokke/tiny-AES-c) \
SHA1 taken from clibs (https://github.com/clibs/sha1) \
MD5 taken from Alexander Peslyak http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 \
GameCube ISO support by cadmic (https://github.com/cadmic)
Loading
Loading