<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wexosmk.xyz/index.php?action=history&amp;feed=atom&amp;title=RARC_%28File_Format%29</id>
	<title>RARC (File Format) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wexosmk.xyz/index.php?action=history&amp;feed=atom&amp;title=RARC_%28File_Format%29"/>
	<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=RARC_(File_Format)&amp;action=history"/>
	<updated>2026-04-07T18:45:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wiki.wexosmk.xyz/index.php?title=RARC_(File_Format)&amp;diff=304&amp;oldid=prev</id>
		<title>Wexos: Imported from avsys wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.wexosmk.xyz/index.php?title=RARC_(File_Format)&amp;diff=304&amp;oldid=prev"/>
		<updated>2024-05-01T17:59:18Z</updated>

		<summary type="html">&lt;p&gt;Imported from avsys wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;RARC&amp;#039;&amp;#039;&amp;#039; files are archive files used in some [[Wii]] and [[GameCube]] games, such as [[Super Mario Galaxy]] and [[Super Mario Galaxy 2]]. The directories are always stored inside a root directory.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
== Header ==&lt;br /&gt;
The file starts with a header that is 0x20 bytes long:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Char[4] || &amp;#039;&amp;#039;&amp;#039;File magic&amp;#039;&amp;#039;&amp;#039;. Always &amp;#039;&amp;#039;RARC&amp;#039;&amp;#039; in ASCII.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Length of this file&amp;#039;&amp;#039;&amp;#039; in bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Length of this header&amp;#039;&amp;#039;&amp;#039; in bytes. Always 0x20.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt32 || &amp;#039;&amp;#039;&amp;#039;Offset to file data&amp;#039;&amp;#039;&amp;#039;. Relative to the end of this header.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt32 || Total size of all &amp;#039;&amp;#039;&amp;#039;file data&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || UInt32 || Size of &amp;#039;&amp;#039;&amp;#039;file data&amp;#039;&amp;#039;&amp;#039; which is preloaded into &amp;#039;&amp;#039;&amp;#039;MRAM&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || UInt32 || Size of &amp;#039;&amp;#039;&amp;#039;file data&amp;#039;&amp;#039;&amp;#039; which is preloaded into &amp;#039;&amp;#039;&amp;#039;ARAM&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Byte[4] || &amp;#039;&amp;#039;&amp;#039;Padding&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Info Block ==&lt;br /&gt;
Directly after the header comes the info block. It is a 0x20 bytes structure as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Number of [[#Directory|directories]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Offset&amp;#039;&amp;#039;&amp;#039; to the first [[#Directory|directory]]. Relative to the start of this block.&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Total number of [[#Node|nodes]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt32 || &amp;#039;&amp;#039;&amp;#039;Offset&amp;#039;&amp;#039;&amp;#039; to the first [[#Node|node]]. Relative to the start of this block.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt32 || Length of the whole &amp;#039;&amp;#039;&amp;#039;[[#String Table|string table]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x14 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Offset to [[#String Table|string table]]&amp;#039;&amp;#039;&amp;#039;. Relative to the start of this block.&lt;br /&gt;
|-&lt;br /&gt;
| 0x18 || UInt16 || Next available &amp;#039;&amp;#039;&amp;#039;[[#Node|node ID]]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x1A || UInt16 || 1 indicates that the &amp;#039;&amp;#039;&amp;#039;node ID&amp;#039;&amp;#039;&amp;#039; of each [[#Node|node]] equals the index of the [[#Node|node]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x1C || Byte[4] || &amp;#039;&amp;#039;&amp;#039;Padding&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Directory ==&lt;br /&gt;
A directory represents a folder. All files contains a root directory which links to all other files and folders. Each directory is a 0x10 bytes structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || Char[4] || &amp;#039;&amp;#039;&amp;#039;Some kind of identifier&amp;#039;&amp;#039;&amp;#039;. The root has &amp;#039;&amp;#039;ROOT&amp;#039;&amp;#039;, other nodes have their first 4 characters of the name in upper case. If the length of the node&amp;#039;s name is less than 4, then the rest of this string is padded with spaces.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || UInt32 || &amp;#039;&amp;#039;&amp;#039;Name offset&amp;#039;&amp;#039;&amp;#039;. Relative to the start of the [[#String Table|string table]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt16 || &amp;#039;&amp;#039;&amp;#039;[[#Hash|Hash]]&amp;#039;&amp;#039;&amp;#039; of the directory name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0A || UInt16 || &amp;#039;&amp;#039;&amp;#039;Number of [[#Node|nodes]]&amp;#039;&amp;#039;&amp;#039; in this folder.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt32 || &amp;#039;&amp;#039;&amp;#039;First [[#Node|node]] index&amp;#039;&amp;#039;&amp;#039;. This is the index of the first [[#Node|node]] that is part of this folder.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Node ==&lt;br /&gt;
A node can either be a file or a folder. If it&amp;#039;s a folder, then it refers to a [[#Directory|directory]]. Otherwise it links to file data. Each entry is a 0x14 bytes structure.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Offset !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || UInt16 || &amp;#039;&amp;#039;&amp;#039;Node ID&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || UInt16 || &amp;#039;&amp;#039;&amp;#039;[[#Hash|Hash]]&amp;#039;&amp;#039;&amp;#039; of the node name.&lt;br /&gt;
|-&lt;br /&gt;
| 0x04 || Byte || &amp;#039;&amp;#039;&amp;#039;Bit flag&amp;#039;&amp;#039;&amp;#039; that specifies the node type and what this node contains. This is usually 0x02 for folders and 0x11 for files.&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;ABCD&amp;#039;&amp;#039;&amp;#039; x&amp;#039;&amp;#039;&amp;#039;EFG&amp;#039;&amp;#039;&amp;#039;:&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;A&amp;#039;&amp;#039;&amp;#039;: Sets the compression type, if the file is compressed. 0 = [[Yay0]], 1 = [[Yaz0]].&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;B&amp;#039;&amp;#039;&amp;#039;: 1 indicates that the file data should be loaded from the DVD whenever it&amp;#039;s needed.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;C&amp;#039;&amp;#039;&amp;#039;: 1 indicates that the file data should be preloaded into ARAM.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;D&amp;#039;&amp;#039;&amp;#039;: 1 indicates that the file data should be preloaded into MRAM.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;E&amp;#039;&amp;#039;&amp;#039;: 1 indicates that the file is compressed.&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;F&amp;#039;&amp;#039;&amp;#039;: 1 indicates that this node is a &amp;#039;&amp;#039;&amp;#039;folder&amp;#039;&amp;#039;&amp;#039;. If it is a folder, node index and all compression flags are ignored.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;G&amp;#039;&amp;#039;&amp;#039;: 1 indicates that this node is a &amp;#039;&amp;#039;&amp;#039;file&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
|-&lt;br /&gt;
| 0x05 || UInt24 || &amp;#039;&amp;#039;&amp;#039;Offset to a string&amp;#039;&amp;#039;&amp;#039; into the [[#String Table|string table]]. Relative to the start of the [[#String Table|string table]].&lt;br /&gt;
|-&lt;br /&gt;
| 0x08 || UInt32 || &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039;: Offset to file data, relative to the start of the file data.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Folder&amp;#039;&amp;#039;&amp;#039;: Index of the [[#Directory|directory]] that represents this folder.&lt;br /&gt;
|-&lt;br /&gt;
| 0x0C || UInt32 || &amp;#039;&amp;#039;&amp;#039;File&amp;#039;&amp;#039;&amp;#039;: Length of the file data in bytes.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Folder&amp;#039;&amp;#039;&amp;#039;: Unknown, always 0x10.&lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || UInt32 || {{Unknown-left|&amp;#039;&amp;#039;&amp;#039;Unknown&amp;#039;&amp;#039;&amp;#039;.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Special Nodes ===&lt;br /&gt;
There are two special folder nodes presented at the end of each folder, included in the count in the [[#Directory|directory]] owner. The first one is &amp;quot;.&amp;quot;, and it links to current [[#Directory|directory]]. The second one is &amp;quot;..&amp;quot; and links to the parent directory.&lt;br /&gt;
&lt;br /&gt;
== String Table ==&lt;br /&gt;
The string table consist of null-terminated strings. The offset and length of this string table is stored in the [[#Info Block|info block]].&lt;br /&gt;
&lt;br /&gt;
== Hash ==&lt;br /&gt;
In all [[#Directory|directory]] and [[#Node|node]]. there is a hash of the name stored. To calculate the hash you need to loop through each character. Start with the hash as 0. For each character you multiply the hash by 3 and then add the character&amp;#039;s value to the hash. The algorithm is demonstrated using the following C# code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
public static ushort CalculateHash(string Name)&lt;br /&gt;
{&lt;br /&gt;
  ushort Hash = 0;&lt;br /&gt;
&lt;br /&gt;
  for (int i = 0; i &amp;lt; Name.Length; i++)&lt;br /&gt;
  {&lt;br /&gt;
    Hash *= 3;&lt;br /&gt;
    Hash += Name[i];&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  return Hash;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
The following tools can handle RARC files:&amp;lt;br&amp;gt;&lt;br /&gt;
* [http://www.wiibrew.org/wiki/ARCTool ARCTool], by [http://www.wiibrew.org/wiki/User:Tpw_rules Tpw_rules]&lt;br /&gt;
* [[Wexos&amp;#039;s Toolbox]], by [[Wexos]]&lt;br /&gt;
&lt;br /&gt;
[[Category:GameCube File Formats]]&lt;br /&gt;
[[Category:Wii File Formats]]&lt;/div&gt;</summary>
		<author><name>Wexos</name></author>
	</entry>
</feed>