-
Notifications
You must be signed in to change notification settings - Fork 8
Format Overview
This page provides an overview of the structure of the archive format.
The header of an archive is padded to be 64/0x40 bytes long. It contains the following properties:
/*0x00*/ const string MAGIC = "RARC";
/*0x04*/ int FileSize;
// Always 0x20
/*0x08*/ int Unknown1;
/*0x0C*/ int FileDataOffset;
// No idea why these are duplicated. They always appear to be the same
/*0x10*/ int FileDataSize1;
/*0x14*/ int FileDataSize2;
/*0x18*/ int Padding1;
/*0x1C*/ int Padding2;
/*0x20*/ int NodeCount;
//Always 0x20
/*0x24*/ int Unknown2;
/*0x28*/ int IntFileEntryCount;
/*0x2C*/ int FileEntriesOffset;
/*0x30*/ int StringTableLength;
/*0x34*/ int StringTableOffset;
/*0x38*/ short ShortFileEntryCount;
// Always 1. Could be a bool of some sort
/*0x3A*/ byte UnknownByte1;
// Probably padding for the last byte
/*0x3B*/ byte UnknownByte2;
/*0x3C*/ int HeaderPadding;
Nodes are 16/0x10 bytes long. They represent every subdirectory in the archive and have the following properties:
/*0x00*/ char[4] Type;
/*0x04*/ int NameOffset;
/*0x08*/ short NameHash;
/*0x0A*/ short FileEntryCount;
/*0x0C*/ int FirstFileEntryIndex;
#File Entry
File entries are padded out to be 20/0x14 bytes long. They represent the structure of the archive and have the following properties:
// If this entry represents a file, this is its ID, used by the game's engine to identify specific files to load.
// If this entry represents a directory, this is 0xFFFF.
/*0x00*/ short FileID;
/*0x02*/ short NameHash;
/*0x04*/ byte Type;
/*0x05*/ byte TypePadding;
/*0x06*/ short NameOffset;
// If this entry represents a file, this is the offset to the file's data.
// If this entry represents a directory, this is the index of the directory's node.
/*0x08*/ int DataOffset;
// If this entry represents a file, this is the size of the file's data.
// If this entry represents a directory, this is 16/0x10, the size of a node.
/*0x0C*/ int DataSize;
/*0x10*/ int EntryPadding;