SARC (File Format)

From MK8
Revision as of 21:36, 9 August 2014 by Celcodioc (Talk | contribs)

Jump to: navigation, search

SARC Files are uncompressed archive files used in Wii U software, including Mario Kart 8. They are similar to the U8 files found in GameCube and Wii games. Common extensions are .arc, .sarc, .pack, and .bars.

File Format

The file begins with a 16 bytes long header, and is followed by a file system and a list of filenames that are included in the archive. All values are big endian.

Header

Offset Size Description
0x00 4 Magic: 0x53415243 ("SARC").
0x04 2 Unknown. Always 0x0014?
0x04 2 Byte order mark (0xFEFF)
0x08 4 File size of the entire archive.
0x0c 4 Beginning of data offset.
0x10 End of SARC header

File Table

Unlike the U8 format, SARC does generally not contain subdirectory nodes (though files may reside inside subfolders). It is currently unknown if it is able to.

Header

Offset Type Description
0x00 4 Magic: 0x53464154 ("SFAT").
0x04 2 Unknown. Always 0x000C?
0x06 2 Node count.
0x08 4 Unknown. Always 0x00000065?
0x0c End of SFAT header

Node

Offset Size Description
0x00 4 Unknown.
0x04 1 Unknown. Always 0x01? Comparable to the file/folder flag from U8?
0x05 3 String table entry offset, relative to the end of the file name table header, divided by 4.
0x08 4 Beginning of node file data, relative to the starting offset specified in the SARC header.
0x0c 4 End of node file data, relative to the starting offset specified in the SARC header.
0x10 End of node

File Name Table

The header is immediately followed by 4-byte aligned null-terminated strings that represent the filenames of the packed files.

Header

Offset Type Description
0x00 4 Magic: 0x53464E54 ("SFNT").
0x04 4 Unknown. Always 0x00080000?
0x08 End of SFNT header

File Data

The data begins at the variable value specified in the SARC header. There is padding between the files for 256-byte (0x100) alignment.

Tools

The following tool can extract SARC files: