-
Notifications
You must be signed in to change notification settings - Fork 23
S3D
Cody Brocious edited this page Jul 5, 2018
·
1 revision
All values are little endian.
- u32 offset -- Absolute file offset to Index
- byte[4] magic --
"PFS "(50 46 53 20)
- u32 count -- Number of chunks in archive
- Chunk[count] chunks -- Contiguous array of chunks
- 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
This structure repeats until the total uncompressed size matches the size field in the Chunk.
- u32 deflateLength -- Length of compressed data
- u32 inflateLength -- Length of uncompressed data
- byte[deflateLength] -- Data compressed with zlib
compressmethod (Note: This differs fromdeflate. See https://stackoverflow.com/questions/10166122/zlib-differences-between-the-deflate-and-compress-functions)
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.
- u32 length -- Length in bytes of filename, including null terminator
- byte[length] filename -- Filename, ASCII encoded, includes null terminator