Tahaxan

  • Increase font size
  • Default font size
  • Decrease font size

ARC files

E-mail Print PDF
ARC files are Nintendo ARChive files. This is the same format used internally in every ROM to store files, but with a few differences, at least, no magic stamp nor section size.

Example file: /bg/grd_anm.arc from "Animal Crossing: Wild World".

NARC section
FieldStartEndSizeExampleDescription
Magic stamp0x000000000x000000034 bytes"NARC"Magic stamp. "Nintendo ARChive"
Unknown constant0x000000040x000000074 bytes0x0100FFFEThis always appears with this value 
Section size0x000000080x0000000B4 bytes0x00002FA0Size of this section always matches with file size (includes header)
Header size0x0000000C0x0000000D2 bytes0x0010This is going to be always 0x0010, because size of the header is always the same
Number of sections0x0000000E0x0000000F2 bytes0x0003Number of sections included inside "NARC" section

 

BTAF section
FieldStartEndSizeExampleDescription
Magic stamp0x000000000x000000034 bytes"BTAF"Magic stamp. "File Allocation Table B?" reversed
Section size0x000000040x000000074 bytes0x0000003CSection size, including header
Number of files
0x000000080x0000000B4 bytes0x00000006Number of files in the archive
Start file offset
0x0000000C0x0000000F4 bytes0x00000000Starting offset RELATIVE to starting data offset in GMIF section
End file offset
0x000000100x00000013
4 bytes
0x0000022C
Ending offset RELATIVE to starting data offset in GMIF section
Two previous offsets repeats 'Number of files' times, so we get starting and end offset for each file in the archive

 

BTNF section
FieldStartEndSizeExampleDescription
Magic stamp0x000000000x000000034 bytes"BTNF"Magic stamp. "File Name Table B?" reversed
Section size0x000000040x000000074 bytes0x0000006CSection size, including header
Here starts directory info contents. Each piece of info is 8 bytes wide, and there are one for every directory in the file. We can know beforehand how much of them we have just looking at first offset.
Start directory contents offset
0x000000080x0000000B4 bytes0x00000010Starting offset RELATIVE to this first offset. If you follow this offset, you'll find directories and filenames that come inside this one. This first offset also matches with size of directories info
Position of first file in FAT0x0000000C0x0000000D2 bytes
0x0000This number, multiplied by 4 bytes each offset multiplied by 2 offsets ('Start File Offset' and 'End Offset'), gives the offset to the first entry in the FAT table for first file in this directory
Number of directories / Parent directory
0x0000000E
0x0000000F
2 bytes
0x0002
If this is the first directory entry (root directory), this keeps the number of directories in archive. If's not, this number ANDed with 0x0FFF gives the parent directory number
This 8 bytes repeats for each directory, but we're going to put the next entry just to see differences between root directory and normal ones.
Start directory contents offset
0x000000100x000000134 bytes0x00000015Starting offset RELATIVE to the first offset.
Position of first file in FAT0x000000140x000000152 bytes
0x0000Same example data as previous, because in this example, root directory contents only directories, and FAT offsets are only needed for files
Number of directories / Parent directory
0x000000160x000000172 bytes
0xF000In this case, parent directory is 0 (0xF000 & 0x0FFF = 0x0000)
This is the end of directory info contents. Now comes names of directories and files.
Size of name
0x00000018
0x00000019
1 byte
0x00000081
This size also gives type information. If first bit is set (just like in this case), the following name is a directory one, a filename otherwise. So, length in this example is 0x81 & 0x7F = 0x01
Name string
0x0000001A
0x0000001B
'Size of name' bytes "a"
String containing the name
After a filename, comes another one in this fashion (size plus name) until you find a zero 'Size of name'. But when you find a directory, one more field comes into account.
Directory number
0x0000001C0x0000001D2 bytes
0xF001
Number of named directory. Just AND it with 0x0FFF. So, in this example, 0xF001 & 0x0FFF = 0x0001

  

GMIF section
FieldStartEndSizeExampleDescription
Magic stamp0x000000000x000000034 bytes"GMIF"Magic stamp. Like others, it's likely to be reversed, but don't imagine what this stands for.
Section size0x000000040x000000074 bytes0x00002EE8Section size, including header
After that, you'll find files data.

 

Last Updated on Monday, 02 April 2007 09:32