Difference between revisions of "U8 (File Format)"
m (Add small disclaimer of string pool offsets.) |
(DARCH is just app/lib to create ARC files whoops) |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | An '''U8''' file is an archive containing a hierarchical file system. In [[Mario Kart Wii]] all U8 files are compressed using the [[YAZ0]] | + | == 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: | |
− | |||
− | |||
− | == | ||
− | The header | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 14: | Line 11: | ||
! Description | ! Description | ||
|- | |- | ||
− | | 0x00 || | + | | 0x00 || UInt32 || File magic. Always 0x55AA382D. |
|- | |- | ||
− | | 0x04 || | + | | 0x04 || Int32 || Offset to the first node. |
|- | |- | ||
− | | 0x08 || | + | | 0x08 || Int32 || Size of all nodes including the string table. |
|- | |- | ||
− | | 0x0c || | + | | 0x0c || Int32 || File offset of data. |
|- | |- | ||
− | | 0x10 || | + | | 0x10 || Int32[4] || Reserved. |
|} | |} | ||
== File System == | == File System == | ||
− | The | + | 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. | This file system part is identical to the file system of every Wii disc. | ||
− | The first node | + | The first node is always a root node. |
Each node has the following data structure: | Each node has the following data structure: | ||
Line 38: | Line 35: | ||
! Description | ! Description | ||
|- | |- | ||
− | | 0x00 || | + | | 0x00 || Byte || '''Node type:''' 0x00=File, 0x01=Directory |
|- | |- | ||
− | | 0x01 || | + | | 0x01 || UInt24 || Offset into the string pool for the file name |
|- | |- | ||
− | | 0x04 || | + | | 0x04 || UInt32 || '''File:''' Offset of begin of data<br/>'''Directory:''' Index of the parent directory. |
|- | |- | ||
− | | 0x08 || | + | | 0x08 || UInt32 || '''File:''' Size of data<br/>'''Directory:''' Index of the first node that is not part of this directory (skip to node). |
|} | |} | ||
− | * The size value of the root 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 coded ASCII | + | * 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 offsets are relative to the start of the string pool. | ||
− | * The string pool contains only the last part of the filename | + | * The string pool contains only the last part of the filename. |
* The file name of the root node is always empty. | * 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 <tt>"."</tt>. 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. | * In Mario Kart the node at index #1 is nearly always a directory with name <tt>"."</tt>. 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: | * 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. | |
− | |||
− | ** For each directory: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== File Data == | == File Data == | ||
Line 114: | Line 58: | ||
== Tools == | == Tools == | ||
− | The following tools can handle U8 files | + | The following tools can handle U8 files: |
− | + | * [[CTools Pack]], by [[Chadderz]] | |
− | * [[CTools Pack]], by | + | * [https://github.com/Gericom/EveryFileExplorer Every File Explorer], by Gericom |
− | * [https:// | + | * [[RANWr]], by [[Gabriela_]] |
− | * [[SZS Modifier]], by [[MrBean35000vr]] and | + | * [https://github.com/riidefi/RiiStudio RiiStudio], by [[Riidefi]] |
+ | * [[SZS Modifier]], by [[MrBean35000vr]] and Chadderz | ||
* [[Wexos's Toolbox]], by [[Wexos]] | * [[Wexos's Toolbox]], by [[Wexos]] | ||
* [[Wiimms SZS Tools]], by [[Wiimm]] | * [[Wiimms SZS Tools]], by [[Wiimm]] | ||
[[Category:File Format/Wii]] | [[Category:File Format/Wii]] |
Latest revision as of 19:11, 14 May 2023
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