File Hosting Not logged in.
Login Register Emblem CTGP-Nitro
243 users
User list
Online users

NARC (File Format)

The NARC file format (Nitro Archive) is an archive format used in some DS games.

File structure

0x0004uint16_tEndianness. 0xFEFF for little endian, 0xFFFE for big endian.
0x0006uint16_tVersion number.
0x0008uint32_tFile size.
0x000Cuint16_tHeader size.
0x000Euint16_tNumber of blocks. (NARC has 3)

The BTAF section is the File Allocation Table section.
0x0004uint32_tSize of section.
0x0008uint32_tNumber of files N.
0x000Cuint32_t[N*2]GIMF start and end index for each file.

The BTNF is the File Name Table section of the NARC. This section also stores the directory tree.
0x0004uint32_tSize of section.

At the beginning of the BTNF section is the root directory entry. It is 8 bytes long.
0x0000uint32_tDirectory start offset
0x0004uint16_tFirst file position?
0x0006uint16_tTotal number of directories in the narc (including the root directory)

Add 8 to the directory start offset to get a pointer to the first entry in the archive. Keep reading file names until a zero-length file name is reached. This signifies the end of the root file list.
Each file/directory name has one byte in the beginning for the name length, followed by that many bytes of the file name. A directory will have the high bit in this byte set, while a file will have the high bit unset (allowing for a length of up to 127 bytes). A directory will also use two bytes after the name, the reference number of the directory.
Each file in the BTNF section (excluding directories) appears in the same order as it is in the BTAF section.
For subdirectories, their structure is similar to that of the root directory entry.
0x0000uint32_tDirectory start offset
0x0004uint16_tFirst file position?
0x0006uint16_tReference ID of the parent directory

The GMIF section holds the content of each file in the NARC.
0x0004uint32_tSize of section N.
0x0008byte[N-8]Section data.

Last edit by Garhoogin on Mon May 18 14:07:51 CDT 2020