ISO Patcher

From Custom Mario Kart
Jump to navigation Jump to search


An ISO Patcher is a tool that changes the content of an ISO image (a copy of a DVD). There are two different kinds of ISO patchers:

  • Sector or RAW Patcher
  • File Level Patcher

A Sector Patcher patches a disc on the sector level without any knowledge of the content. It simply replaces bytes at predefined offsets. A File Level Patcher analyzes the image directory structure and replaces singular files.

Wiimms ISO Patcher

Wiimm has written a generic Wii Image Patcher based on his Wiimms ISO Tools. It also uses Wiimms SZS Tools to patch singular files of Mario Kart Wii. It was written for his Mario Kart distributions, but it can also be used to patch any other game. The patcher works on a file-level in the following general steps:

  1. Extract all files of the original game image.
  2. Replace files (like Riivolution does in real-time).
  3. Call post-processing scripts if available.
  4. Create a new image.

Wiimms ISO Patcher uses GNU-Tools and runs under Linux, Mac and Windows. For Windows, some Cygwin tools are used.

The great advantage is that the user has a complete independent image and that the game can be loaded by any USB loader. The disadvantage is that a Wii must be hacked and the trucha bug (fake sign bug) must be enabled, or a cIOS must be installed.

How does the MKW patcher work?

The Mario Kart Wii Patcher uses different SZS tools to optimize the patching procedure:

  1. First, it extracts a copy of an original Mario Kart Wii DVD (=image). For time optimization, some unneeded files are not extracted.
  2. The patch file patch.tar is extracted. For space reduction, the archive contains hard links for identical files. It replaces files in the image file structure and extracts additional files for post-processing.
  3. The post-processing is started:
    • All files in /Scene/UI with messages in it are patched. For the PAL version, these are 50 files for five languages. The advantage is that only the track names and some messages are replaced and the basic messages are not touched. The second advantage is that this works for all four original Mario Kart Wii images.
    • The image files for the very first start screens are patched by some PNG files.
    • The title screens (profile selection) are patched by other PNG files.
    • To reduce the size from 2.8 to 1.4 GB, some THP videos (such as the title screen trailer and others) are removed and replaced by hard links to a smaller video.
    • Some sound files are copied or swapped.
  4. The new image is created with hard link support for duplicate files to reduce the image size while creating the new game title and the new IDs are set.

If creating a Riivolution template, the steps are nearly the same with two differences.

  • Step 1: Fewer files are extracted.
  • Step 4: Instead of creating an image, only files needed for Riivolution are used. Files with identical content are only copied once. The XML file is generated with respect to identical files.