Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:WBFS disc container

From ReverseEngineering.wiki
Format
Platforms Platform:Nintendo Wii
Magic 57 42 46 53 ("WBFS")
Extensions .wbfs, .wbf1-.wbf9
Endianness big (the cluster table and sector count are byte-swapped by Dolphin)
On this wiki Facts · Code · Notes · Topics

Wii Backup File System container (.wbfs, magic WBFS): a 0x200-byte header with sector-size shifts and a disc table, followed per disc by a 256-byte disc header copy and a table of 16-bit cluster numbers; split files end in .wbf1 to .wbf9.

Overview

WBFS holds the raw image of one Wii disc (Format:GCM disc image (GameCube and Wii)) in clusters, leaving unused clusters out. Everything here is from Dolphin's reader (dolphin-emu/dolphin, GPL-2.0-or-later, Source/Core/DiscIO/WbfsBlob.h and WbfsBlob.cpp at commit 41460454e9).

Layout

  • Header at file offset 0 (WbfsBlob.h, struct WbfsHeader): u32 magic WBFS, u32 hd_sector_count (big endian), u8 hd_sector_shift, u8 wbfs_sector_shift, 2 bytes padding, then a 500-byte disc_table; the first disc slot must be non-zero.
  • The sector size of the host disk is 1 << hd_sector_shift; the cluster (wbfs sector) size is 1 << wbfs_sector_shift and must be at least 0x8000, the Wii sector size. Dolphin requires file size == hd_sector_count * hd sector size.
  • Disc slot 0 starts one host sector after the file start: 256 bytes (the first 0x100 bytes of the disc header) and then one big-endian u16 per cluster of the disc, the cluster number inside the file. Dolphin does not treat cluster number 0 as absent: SeekToCluster computes the file address as entry * cluster size, so an entry of 0 reads from the start of the file (WbfsBlob.cpp lines 150-155). Unverified: whether other WBFS tools use 0 for an unallocated cluster.
  • A disc is assumed to be 143432 * 2 Wii sectors of 0x8000 bytes (about 8.75 GiB, the dual-layer size); clusters per disc = that size / cluster size, rounded up.
  • A read at disc offset X goes to cluster table entry X >> wbfs_sector_shift, at file address entry * cluster size + (X mod cluster size).

Split files

Dolphin opens the files .wbfs, .wbf1 ... .wbf9 by replacing the last character of the path with the digit of the next index (at most 10 files) and treats them as one concatenated file.

Identification

First four bytes WBFS. The disc inside starts with the usual game id at the 0x100 header copy. Dolphin only reads slot 0 (WbfsBlob.cpp lines 38-40, the comment says slot 0 is checked in ReadHeader, which tests only disc_table[0] != 0, line 119). The reported data size is always 143432 * 2 * 0x8000 bytes (lines 24, 57-60), whatever the real disc size. Unverified: that some tools write several discs into one WBFS partition on a hard disk.

Related

Format:WIA and RVZ, Platform:Nintendo Wii.

Code & repositories

  • https://github.com/dolphin-emu/dolphin @ 41460454e9600f909950fddf0abd13a138430162 · license: GPL-2.0-or-later (declared by the contributor; GitHub's detector did not recognize COPYING)
    Source/Core/DiscIO/WbfsBlob.h and WbfsBlob.cpp: the WBFS header, cluster table and split-file reader
    Tested on: source read, not run · checked 2026-10-19; last activity 2026-10-18