Skip to content

Instantly share code, notes, and snippets.

@SmolAlli
Last active October 13, 2025 09:03
Show Gist options
  • Select an option

  • Save SmolAlli/0d6701fce5cddea7acc356426a90ca4c to your computer and use it in GitHub Desktop.

Select an option

Save SmolAlli/0d6701fce5cddea7acc356426a90ca4c to your computer and use it in GitHub Desktop.
Patching SM64 Romhacks onto a Wii WAD file

Decided to see if this was possible out of curiousity. Credits to https://www.youtube.com/watch?v=NwsYhupF374 for creating the batch file and a tutorial related to doing this for the Usamune WAD.

Requirements:

Downloads for the project: https://github.com/krimtonz/gzinject .bat file

@ECHO OFF
setlocal

set PATH=%CD%/bin;%PATH%
echo 45e | gzinject -a genkey -k common-key.bin > nul
gzinject -a extract -w *.wad
copy /y %1 ".\wadextract\content5\rom"
gzinject -a pack -w [].wad -t "[]" -i NXXE -p [].gzi --cleanup
del common-key.bin

Optional (unsure what happens when not used) - .gzi file

0000 00000000 00000001
0304 00005AD4 60000000
# GCN Controller Z -> N64 L, Comment these lines if
# you wish to use GCN Controller L -> N64 L 
0302 001685E0 00000020
0302 00168630 00000020
0302 00168680 00000020

# GCN Controller L -> N64 L, unomment these lines if
# you wish to use GCN Controller L -> N64 L
# and comment the 3 previous lines
#0302 001685D8 00000020
#0302 00168628 00000020
#0302 00168678 00000020

Steps:

  1. Create a folder and add the gzinject and bat file to it. You may add the gzi file if you would like to change the mappings (unsure of default, most likely L->Z like vanilla).
  2. Add the vanilla SM64 .wad file and the romhack file (preferably .z64). For information on where to get romhacks and how to get the files -> https://romhacking.com/
  3. Edit the bat file to edit the [] into what should be filled in there. Remove the -p .gzi if not using a gzi file, and change the NXXE if you have more than one file you have patched with this method.
  4. Drag the .z64 file onto the bat file
  5. (Optional) Create a screen for the WAD using the guide here - https://docs.google.com/document/u/0/d/1ZiALxUWFQUm1c598xOqpLqMzRoaWjaXuFDclq7cQb7k/mobilebasic under "WAD Decoration"
  6. Move the newly created .wad file onto your SD card for your Wii
  7. Use YAWM or another wad installer to install
  8. Profit!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment