Skip to content
Szymon Zak edited this page Jun 26, 2018 · 2 revisions

VDF File Format

VDF archives are similar in principle to TAR and QPAK (Quake 1/2) archives, in that they are linear collections of non-compressed files. Every file inside a VDF archive can have a name up to 64 bytes long (which is generally an uppercase 7bit ASCII encoded string), and a size up to 4GB (2^32 bytes).

Header

Size Description
256 bytes Comment on the archive
16 bytes Signature of the archive
4 bytes Number of entries
4 bytes Number of files
4 bytes Timestamp
4 bytes Archive size
4 bytes Catalog root offset
4 bytes Archive version

Signature

The signature is always "PSVDSC_V2.00\r\n\r\n" in case of G1 archives, or "PSVDSC_V2.00\n\r\n\r" in case of G2 archives.

Timestamp

The timestamp is given in DOS date format

Archive version

It's always 0x00000050

Entries

Size Description
64 bytes Name of the entry
4 bytes Jump address
4 bytes Entry size
4 bytes Entry type
4 bytes Entry attributes

Jump address

If the entry is a directory, it stores an index of the first entry inside it, otherwise it stores the offset at which the first byte of the file is found

Entry size

Size in bytes of the entry

Entry type

It's a bitmask: if 0x80000000 is present, then the entry is a directory and all the following entries should be considered inside of it, until an entry of with bit 0x40000000 set is found, which signals the last entry in a directory.

If the field is zero, the entry is a file.

Attributes

Unused