U8 (File Format)
Overview
An U8 file (also known as ARC) is an archive containing a hierarchical file system. In Mario Kart Wii, almost all U8 files are compressed using the YAZ0 compression and stored as SZS files. Uncompressed U8 files can be found with the .arc extension.
File Header
The file begins with the header. It is a 0x20 structure as follows:
Offset | Type | Description |
---|---|---|
0x00 | UInt32 | File magic. Always 0x55AA382D. |
0x04 | Int32 | Offset to the first node. |
0x08 | Int32 | Size of all nodes including the string table. |
0x0c | Int32 | File offset of data. |
0x10 | Int32[4] | Reserved. |
File System
The file system consists on a list of nodes (0xC byte each) followed by a string pool for the file names. This file system part is identical to the file system of every Wii disc. The first node is always a root node. Each node has the following data structure:
Each Wii disc uses the same directory and file structure.
Offset | Type | Description |
---|---|---|
0x00 | Byte | Node type: 0x00=File, 0x01=Directory |
0x01 | UInt24 | Offset into the string pool for the file name |
0x04 | UInt32 | File: Offset of begin of data Directory: Index of the parent directory. |
0x08 | UInt32 | File: Size of data Directory: Index of the first node that is not part of this directory (skip to node). |
- The size value of the root node is equal to the total number of nodes. The string pool start with the first byte behind the last node.
- The string pool is null-terminated and coded ASCII.
- The string pool offsets are relative to the start of the string pool.
- The string pool contains only the last part of the filename.
- The file name of the root node is always empty.
- In Mario Kart the node at index #1 is nearly always a directory with name ".". If this file exists all other files are part of this directory. It is not really needed and never seen for file systems of Wii disc partitions.
- The natural sort order (that one used by Nintendo) is:
- Files are ordered by ASCII byte value (case-insensitive).
- For each directory: Files are inserted before sub directories.
File Data
The file data is dependent of the related file type. See the other file formats descriptions for more details.
Tools
The following tools can handle U8 files:
- CTools Pack, by Chadderz
- Every File Explorer, by Gericom
- RANWr, by Gabriela_
- RiiStudio, by Riidefi
- SZS Modifier, by MrBean35000vr and Chadderz
- Wexos's Toolbox, by Wexos
- Wiimms SZS Tools, by Wiimm