$ show Xpl0itU/WiiUDownloader
WiiUDownloader is a cross-platform desktop application written in Go that downloads Wii U games, updates, DLC, and demos directly from Nintendo's CDN servers. It is the primary open-source replacement for the abandoned Wii U USB Helper. The application provides a GTK3-based GUI (via gotk3) on all three major platforms, with a command-line core library. Key features include automatic decryption using embedded common keys and title keys derived from PBKDF2, resume-capable downloads with SHA-256 segment verification via a journal file, hash-tree validation for hashed content, FST/U8 archive extraction, and a queue-based batch download system. The architecture cleanly separates the core download/decryption logic (root package) from the GUI (cmd/WiiUDownloader), with reusable internal format parsers for TMD, FST, and U8. No title keys are required; the system generates tickets and certificates on the fly. The project is actively maintained, with recent commits and CI/CD pipelines producing Windows, macOS, and Linux builds.
The LLM identified 5 files worth highlighting for reuse:
A safe, bounds-checked parser for the Wii U FST (File System Table) format. It reads a binary blob, validates entry counts, factor, and name offsets, and produces a typed Entry slice. The code is fully self-contained and can be extracted for any project that needs to parse similar hierarchical file tables (e.g., game archives, firmware images). It demonstrates careful validation against buffer overflows and unreasonable entry counts.
A robust parser for the Wii and Wii U TMD (Title Metadata) binary format. Handles both Wii (v0) and WiiU (v1) versions with different content record sizes and hash sizes. Parses the header, content records, and certificates. The code is cleanly organized with constants in a separate spec file and can be reused in any project that needs to parse TMD files from Nintendo consoles.
A simple but essential safe binary cursor that wraps a byte slice with bounds-checked read operations. Provides ReadU8, ReadU16BE, ReadU32BE, ReadU64BE, ReadBytes, Seek, and Slice methods, all returning a ParseError with detailed context on failure. This is a reusable building block for any binary format parsing and is already used by all internal format parsers in the project.
Implements a sophisticated download resume mechanism using a journal file (append-only JSON lines with SHA-256 segment hashes) and a .part file. Supports verifying previously downloaded segments by hash, trimming corrupted data, and resuming from the last verified offset. The journal format allows crash-safe updates and rollback. This component is reusable for any HTTP download client that needs robust resume with data integrity checks, independent of the specific download source.
Performs AES-128-CBC decryption of Wii U content files, supporting both hashed (hash-tree/H3 protected) and non-hashed content. For hashed content, it implements the full hash tree verification: decrypting the H3 block, verifying H2/H1/H0 hashes, and then decrypting data blocks using CBC with IVs derived from content ID and block number. The code uses a reusable CBC decrypter wrapper and object pools for buffers. This demonstrates a non-trivial cryptographic pattern that could be adapted for other systems using Merkle-tree-protected encrypted content.