|Home | Forums — Login|
RARC is an archive format commonly used in Gamecube games. It is also used in some Wii games like SMG 1 and 2, but on the Wii the U8 format is more commonly used.
In SMG games, the RARC archives have .arc extensions. Original archives are compressed using Yaz0, but compression is optional.
Like pretty much any GC/Wii file format, RARC is a big-endian file format.
Typically, all offsets found within a RARC's header, and file data offsets, are aligned to a 32-byte boundary.
1. File header
2. Directory nodes section
3. File entries section
For whatever reason, among file entries are subdirectory entries named . and .. . They don't seem to have a purpose, aside from perhaps being shown in whatever RARC editing software Nintendo used?
The . entry points to the current directory, and the .. entry points to the parent directory.
The .. entries have their directory node index set to 0xFFFFFFFF when they are already in the root directory.
4. String table section
This section contains NULL-terminated ASCII strings representing the file and directory names.
If two or more files/directories have the same name, their name strings will be duplicated.
5. File data section
This section is just a huge blob of data. Use the previous sections to exploit it.
6. How file/directory name hashes are calculated
Start out with a 16-bit value of zero. For each character in the name to hash, multiply your value by 3 and add the character's value to your value.
Here's some C code to calculate hashes:
unsigned short calculateHash(char* name)
int i = 0;
unsigned short hashval = 0;
while (name[i] != '\0')
hashval *= 3;
hashval += name[i];
Page rendered in 0.013 seconds. (2048KB of memory used)|
MySQL - queries: 17, rows: 64/64, time: 0.011 seconds.