Skip to main content

Wiithon

A Python library for reading, extracting, and rebuilding Nintendo Wii ISO files.

Features

  • Parse and extract files from standard Wii ISOs.
  • Read the Wii File System Table (FST) and reconstruct the directory tree.
  • On-the-fly decryption and encryption of Wii data clusters.
  • Rebuild and master new Wii ISOs from extracted or modified files.
  • Hash calculation and Merkle tree generation for partition integrity. (doesn't work great atm)

Documentation

For comprehensive guides, internal architecture details, and references, please refer to the docs/ directory.

Examples

For some examples, you can refer to the examples/ directory.

Overview

The library is divided into two main components: reading existing ISOs and building new ones.

Reading and Extracting

To read an ISO, initialize the WiiIsoReader with a binary stream. You can iterate through the partitions and access the decrypted file data using the FST offsets. (currently just copied/paste the examples in the above directory)

from wiithon.disc.WiiIsoReader import WiiIsoReader

# Opening the ISO
with WiiIsoReader("your_iso_file.iso") as reader:
    print(f"Game: {reader.disc_header.game_title}")

    data = reader.get_data_partition()
    partition = reader.open_partition(data)

    for path in partition.list_files():
        print(path)

    print(f"Number of files: {len(partition.list_files())}")

Building

To build an ISO, you can use some interfaces. Each interface has their specificities like copying an ISO, patching an ISO or building from a folder from your explorer. Currently, only the copy one exists.

from wiithon.builder.CopyBuilder import CopyBuilder
from wiithon.disc.WiiIsoReader import WiiIsoReader
from wiithon.builder.WiiDiscBuilder import WiiDiscBuilder

SOURCE_PATH = "your_iso_file.iso"
DEST_PATH = "output_iso.iso"

print(f"Source : {SOURCE_PATH}")
print(f"Dest   : {DEST_PATH}")

# Open the original ISO
with WiiIsoReader(SOURCE_PATH) as reader:
    print(f"Game   : {reader.disc_header.game_title.strip()}")
    print(f"ID     : {reader.disc_header.game_id.decode()}")

    # The main builder
    builder = WiiDiscBuilder(reader.disc_header, reader.region)

    with open(DEST_PATH, 'w+b') as dest:
        # For each partition from the original ISO
        for entry in reader.partitions:
            # Copying and build into the new one
            copy_builder = CopyBuilder(reader, entry, None)
            builder.add_partition(dest, copy_builder, None)

        # To write the header and partitions datas 
        builder.finish(dest)

TODO

Done

  • Fixing the H3 table (Dolphin says that is not correct :( )
  • Fixing a thing that dolphin says: some block are incorrect but unused
  • Adding more WiiPartitionInterface from dir
  • Some docs about building and so on
  • Adding some tools like Yaz0, RARC
  • Writing asm easily
  • Patching DOL
  • Adding, modifying, removing files
  • Wrapper for modifying rarc file

Next to do

  • Searching empty addresses in dol to add instructions and adding text/data sections
  • Refactor/adding constants to avoid magic numbers
  • Comment all functions (and inside of it)
  • BCSV editor
  • BMD - BDL editor

Next after next (not ordered)

  • Patcher !! (will be available with tools maybe ?)
  • Some refactorization (like big break big function into smaller ones)
  • Add more unit tests (and change some)
  • Improve exception handling for invalid or corrupted ISO headers
  • Add a CLI for standard extraction and building
  • Adding everything we need to proper have a PyPi page

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wiithon-0.1.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wiithon-0.1.0-py3-none-any.whl (77.1 kB view details)

Uploaded Python 3

File details

Details for the file wiithon-0.1.0.tar.gz.

File metadata

  • Download URL: wiithon-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wiithon-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32541d5dace34e9e82e328c469213a8e6341d41e88cb01bb322bd67ab8a4dcf4
MD5 310125edab6dc651dd011d21f44ef8ad
BLAKE2b-256 865dffac34d01d501c9a5eec8c6804cb3549fcebc78e3a1c705335f90298e7f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for wiithon-0.1.0.tar.gz:

Publisher: python-publish.yml on Demorck/wiithon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wiithon-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wiithon-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 77.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wiithon-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1384b94c10d804c216172ec83b2e40aa6fd90bae192b354ba4388cd028b95d73
MD5 6165b07402f9c500780e77c44a3aeb2e
BLAKE2b-256 9595fe3b6485991f5d2dc445636f97e8d64b212dba72de63ef23dc921aa2ad10

See more details on using hashes here.

Provenance

The following attestation bundles were made for wiithon-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on Demorck/wiithon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page