Difference between revisions of "Assets manifest"
Imathrowback (Talk | contribs) (→Table 1 - Entry Table) |
Imathrowback (Talk | contribs) (→Table 2 - Unknown) |
||
Line 149: | Line 149: | ||
===== Table 2 - Unknown ===== | ===== Table 2 - Unknown ===== | ||
− | + | This table contains a smaller table up to the number of entries in the main table definition. | |
+ | |||
+ | {|class="wikitable" | ||
+ | |||
+ | ! Bytes/Offset | ||
+ | ! Content | ||
+ | ! Comment | ||
+ | |- | ||
+ | |4 bytes | ||
+ | |integer | ||
+ | |unknown | ||
+ | |- | ||
+ | |4 bytes | ||
+ | |integer | ||
+ | |count of items | ||
+ | |- | ||
+ | |4 bytes | ||
+ | |integer | ||
+ | |offset from the start of the file. | ||
+ | |- | ||
+ | |} | ||
+ | |||
+ | Each entry offset points to a collection of integers up to count. | ||
== Asset files == | == Asset files == |
Revision as of 18:59, 24 April 2017
RIFT assets consist of 2 main parts, the manifest, and the asset files.
RIFT uses a FNV1 hash to hash all filenames. This hash is used in many places when referring to files.
Contents
Manifest
assets.manifest - 32 bit
assets64.manifest - 64 bit
The main identified use of the manifest is to map asset hashes with filename hashes.
However, the manifest contains much more data than that, but it is currently unknown what else it contains.
It is likely that some the other data pertains to the streaming download functionality of RIFT where assets can be streamed while playing.
Binary Format
File should be interpreted as LITTLE ENDIAN.
Header
Bytes/Offset | Content | Comment |
---|---|---|
4 bytes | TWAM | File signature |
2 bytes | 0x0200 - integer | Major version |
2 bytes | 0x0100 - integer | Minor version |
4 bytes | integer | 256 Block Table offset |
4 bytes | integer | 256 Block Table size |
48 bytes | varies | 3 Data Table Reference as per below, each 16 bytes long. The second table is the Entry Table as per below. |
Data Table Reference
Bytes/Offset | Content | Comment |
---|---|---|
4 bytes | integer | offset from start of file |
4 bytes | integer | size of the entire table in bytes |
4 bytes | integer | count of entries in the table |
4 bytes | integer | stride - size of each entry in the table |
Note that the table itself may consist of more data than the header indicates. For example if you multiply the stride by the count and it is less than the size of the table in bytes, then extra data is appended.
Tables
256 Block Table
This table consists of 256 bytes. It is not yet known what these are but it one possibility is some kind of RC4 substitution table.
Table 0
Unknown.
After the normal table data, there are "count" number of null terminated strings that appear to be references to "pak" files.
eg:
assets/audio/audio_0.pak
Table 1 - Entry Table
FNV hash and asset names. No extra data
Bytes/Offset | Content | Comment |
---|---|---|
8 bytes | varies | ID of the entry - corresponds to the first 8 bytes of a 16byte SHA hash of the contents of the data the entry relates to. |
4 bytes | integer | The FNV1 hash of the filename |
4 bytes | integer | Unknown |
4 bytes | integer | Unknown |
4 bytes | integer | size of the asset in bytes |
2 bytes | short | Unknown |
2 bytes | short | Unknown |
4 bytes | integer | Unknown |
20 bytes | Sometimes is the SHA1 of the asset but otherwise unknown hash. |
Table 2 - Unknown
This table contains a smaller table up to the number of entries in the main table definition.
Bytes/Offset | Content | Comment |
---|---|---|
4 bytes | integer | unknown |
4 bytes | integer | count of items |
4 bytes | integer | offset from the start of the file. |
Each entry offset points to a collection of integers up to count.
Asset files
Asset files are in the assets directory of the RIFT installation and are labelled like so:
assets.001 assets.002 assets64.001 etc
The assets with 64 indicate the file should be preferred if using the 64bit manifest.
Asset files are packed files, sometimes compressed.
Header
Bytes/Offset | Content | Comment |
---|---|---|
4 bytes | TWAD | File signature |
4 bytes | integer | version |
4 bytes | integer | size of header block |
4 bytes | integer | maximum files allowed in this file? |
4 bytes | integer | number of entries in this file |
Entry Table
Directly after the header is the entry table.
Bytes/Offset | Content | Comment |
---|---|---|
8 bytes | ID of the entry - corresponds to the first 8 bytes of a 20byte SHA hash of the contents of the data the entry relates to. | |
4 bytes | offset in bytes in the file the entry is at | |
4 bytes | size in bytes of the entry | |
4 bytes | unsure. possibly decompressed size of the entry | |
2 bytes | unsure. Possible an identifier of some sort | |
2 bytes | Entry flag. If non-zero, indicates the entry is compressed with ZLIB | |
20 bytes | SHA hash of the entry |