Difference between revisions of "U8 archive"

m (Added links and small tidying)
(Add tools section for U8 archives (I'm sure there are more out there but adding link to a perl script I found to be useful))
 
(14 intermediate revisions by 12 users not shown)
Line 1: Line 1:
The U8 archive is an archive format used in [[content.bin]] and [[opening.bnr]]. It contains no compression or encryption by itself; it is just a way to attach files in a directory structure together.  
+
The '''U8 archive''' (file extension can be as .arc, .carc or .szs) is an archive format used in various content files such as [[opening.bnr]]. It contains no compression or encryption by itself; it is just a way to attach files in a directory structure together.  
  
(The name U8 is not official, but what I call it, from the pronounceable letters of the tag viewed as ASCII. [[User:Magicus|Magicus]] 15:55, 1 March 2008 (PST))
+
The name U8 is not official, but what the homebrew scene calls it, based on the pronounceable letters of the tag viewed as ASCII.
  
==Description==
+
__TOC__
 +
 
 +
== Description ==
  
 
First comes a header:
 
First comes a header:
Line 20: Line 22:
 
  struct U8_node  
 
  struct U8_node  
 
  {
 
  {
   u16 type;
+
   u16 type; //this is really a u8
   u16 name_offset;
+
   u16 name_offset; //really a "u24"
 
   u32 data_offset;
 
   u32 data_offset;
 
   u32 size;
 
   u32 size;
 
  };
 
  };
  
The name_offset gives the offset from the start of the string table to the start of this file's name. This is used for both files and directories.
+
After the file nodes is the string table, which extends to the rest of the header. The name_offset gives the offset from the start of the string table to the start of this file's name. This is used for both files and directories.
  
 
For normal files, type is '''0x0000'''. In this case the data_offset gives the address to where the data for this file is. This is given as an absolute offset from the start of the U8 header. The size is the size of the file.
 
For normal files, type is '''0x0000'''. In this case the data_offset gives the address to where the data for this file is. This is given as an absolute offset from the start of the U8 header. The size is the size of the file.
  
For directories, type is '''0x1000'''. In this case, the data_offset has no meaning. (It seems to be 0 or 1; it might signify the level of recursion even though this is redundant.) The size field is used to indicate which files are included in this directory. The value given is the node number of the last file included, counting the root node as node number 1.  
+
For directories, type is '''0x0100'''. In this case, the data_offset has no meaning. (It seems to be 0 or 1; it might signify the level of recursion even though this is redundant. In Mario Kart Wii U8 Files, it specifies the parent directory of the current directory, with the root directory specifying itself) The size field is used to indicate which files are included in this directory. The value given is the node number of the last file included, counting the root node as node number 1.  
  
 
An example: In opening.bnr, there are five nodes:
 
An example: In opening.bnr, there are five nodes:
Line 40: Line 42:
  
 
The root and "meta" are directories. Both of them have 5 as their size, which means that sound.bin is the last file included in the root directory, and it also is the last file included in the meta directory.
 
The root and "meta" are directories. Both of them have 5 as their size, which means that sound.bin is the last file included in the root directory, and it also is the last file included in the meta directory.
 +
 +
== Tools ==
 +
 +
{| class="wikitable"
 +
|-
 +
! Name
 +
! Language
 +
! Author
 +
! Description
 +
|-
 +
| [[User:Magicus/Magicus's Tools/Parse-u8.c|parse-u8.c]]
 +
| C
 +
| [[User:magicus|magicus]]
 +
| Extracts the contents of an U8 archive to a file structure.
 +
|-
 +
| [https://www.fybertech.com/forums/index.php?topic=837.0 Wii U8 Archive Extractor]
 +
| Perl
 +
| Fybertech
 +
| Simple Perl script to extract an U8 archive.
 +
|}
 +
 +
[[Category:File formats]]

Latest revision as of 16:38, 7 October 2023

The U8 archive (file extension can be as .arc, .carc or .szs) is an archive format used in various content files such as opening.bnr. It contains no compression or encryption by itself; it is just a way to attach files in a directory structure together.

The name U8 is not official, but what the homebrew scene calls it, based on the pronounceable letters of the tag viewed as ASCII.

Description

First comes a header:

struct U8_archive_header
{
 u32 tag; // 0x55AA382D "U.8-"
 u32 rootnode_offset; // offset to root_node, always 0x20.
 u32 header_size; // size of header from root_node to end of string table.
 u32 data_offset; // offset to data -- this is rootnode_offset + header_size, aligned to 0x40.
 u8 zeroes[16];
};

Then comes a series of file nodes. The first one is the root node; it determines how many nodes there are in total.

struct U8_node 
{
 u16 type; //this is really a u8
 u16 name_offset; //really a "u24"
 u32 data_offset;
 u32 size;
};

After the file nodes is the string table, which extends to the rest of the header. The name_offset gives the offset from the start of the string table to the start of this file's name. This is used for both files and directories.

For normal files, type is 0x0000. In this case the data_offset gives the address to where the data for this file is. This is given as an absolute offset from the start of the U8 header. The size is the size of the file.

For directories, type is 0x0100. In this case, the data_offset has no meaning. (It seems to be 0 or 1; it might signify the level of recursion even though this is redundant. In Mario Kart Wii U8 Files, it specifies the parent directory of the current directory, with the root directory specifying itself) The size field is used to indicate which files are included in this directory. The value given is the node number of the last file included, counting the root node as node number 1.

An example: In opening.bnr, there are five nodes:

1: root
2: "meta"
3: "banner.bin"
4: "icon.bin"
5: "sound.bin"

The root and "meta" are directories. Both of them have 5 as their size, which means that sound.bin is the last file included in the root directory, and it also is the last file included in the meta directory.

Tools

Name Language Author Description
parse-u8.c C magicus Extracts the contents of an U8 archive to a file structure.
Wii U8 Archive Extractor Perl Fybertech Simple Perl script to extract an U8 archive.