RPF archive

From GTAMods Wiki
Revision as of 03:46, 2 March 2009 by Sacky (talk | contribs)
Jump to navigation Jump to search

RPF is a new kind of the game archives introduced in GTA 4. They can be edited with SparkIV or OpenIV.

Header

The RPF Files all contain the same header. The header tells us the version of the archive, how many entries there are and whether or not the archive is encrypted.

4b - INT32 - RPF Version
4b - INT32 - Table of Contents Size
4b - INT32 - Number of Entries
4b - INT32 - Unknown
4b - INT32 - Encrypted

The RPF Version tells us the version of the RPF Archive. Version 2 is identified by 0x32465052 and Version 3 is identified by 0x33465052. The Table of Contents Size tells us the size of the table of contents segment in the file. The Number of Entries tells us the number of files contained in the archive. The Encryption flag tells us if the archive is encrypted, if the archive is unencrypted it is set to 0 (AKA NULL), otherwise it has a numerical value.

Table of Contents

The Table of contents size is determined by the Table of Contents Size integer in the Header of the RPF archive. It starts immediately after the header, and is encrypted depending on the encryption flag in the header. The Table of contents contains both Directories and File Entries. Both are different structures and take up different amounts of space.

Directory Entry

Directory entries follow this structure:

4b - INT32 - Name Offset
4b - INT32 - Flags
4b - INT32 - Content Entry Index
4b - INT32 - Content Entry Count

This section is incomplete. You can help by fixing and expanding it.