Skip to content
Cody Brocious edited this page Jul 5, 2018 · 1 revision

All values are little endian.

Header

  • u32 offset -- Absolute file offset to Index
  • byte[4] magic -- "PFS " (50 46 53 20)

Index

  • u32 count -- Number of chunks in archive
  • Chunk[count] chunks -- Contiguous array of chunks

Chunk

  • u32 crc -- Checksum of data in chunk (TODO: document checksum), unless it's a Directory Chunk
  • u32 offset -- Absolute file offset to Compressed Data
  • u32 size -- Total uncompressed size of data

Compressed Data

This structure repeats until the total uncompressed size matches the size field in the Chunk.

Directory Chunk

This chunk has the same format as the others, but its CRC value is always 0x61580AC9. The below fields describe the uncompressed data:

  • u32 fileCount -- This will match the total number of chunks in the archive, minus one (the directory chunk is not counted)
  • FileName[fileCount] fileNames -- List of filenames for chunks

Note: The list of filenames will only match the chunks if the chunk list is sorted by offset ascending. This is not the default order of most (any?) real-world archive files.

File Name

  • u32 length -- Length in bytes of filename, including null terminator
  • byte[length] filename -- Filename, ASCII encoded, includes null terminator

Clone this wiki locally