The ZAR format (Zelda Archive) is an archive format used in OoT 3D.
This section documents the structure of the file format.
|0004||u32||Size of archive|
|000C||u32||Offset to filetypes section|
|0010||u32||Offset to file-metadata section|
|0014||u32||Offset to data section|
Consists of a number of filetype entries. Each filetype is associated with a number of compressed files. Contains a table of 16-byte entries as detailed below, one entry for each of the [#types] filetypes (see main header).
|0004||u32||Offset to files list|
|0008||u32||Offset to type name|
|000C||u32||Unknown (always -1?)|
At [offset to files list] is a list of [#files] u32's, each corresponding to a file index (0 refers to the first file, etc). These lists and the type names are stored immediately afterwards within the section.
The number of filetypes vary between 2 and 8 in known files, and "unknown" is always the first type (even if it contains no files). Known filetype names are "anb", "ccb", "cmab", "cmb", "csab", "ctxb", "faceb", "qdb", "tbd", "unknown", "zsi". The only archive containing an "unknown" file is actor/zelda_magic_wind.zar, which contains Anim/new_magic_wind.cskla.
File metadata section
Consists of one entry for each file in the archive ([#files] in the main header).
|0004||u32||Offset to filename|
The filenames are stored immediately afterwards within the section.
Consists of one u32 for each file in the archive, representing the offset to the file's data. The length of the file's data is taken from the metadata section above.
The offsets are immediately followed by the actual data, within the section.