PAK Format

User avatar
Site Admin
Posts: 34
Joined: Sat Sep 24, 2016 8:48 am

PAK Format

Postby Neo_Kesha » Sat Jul 07, 2018 10:01 pm

Int32 - ASCII Signature
Int32 - Version
Int32 - Table size
Int32 - Files count
Int32 - Chunk size
Int32 - ????
Int32 - ????
Int32 - Zero
Int32 - Table1 size (LZMA related for files bigger than 0x8000 bytes, so they have more than one LZMA chunks)
Int32 - Table2 size (How many chunks held by compressed LZMA chunk for files not bigger than 0x8000 bytes)
Int32 - Name's offset
Int32 - zero
Int32 - ????
Int32 - One
Array of Files count UInt32 - IDs
Array of Files count File record - File Table
File record
Int32 - offset
Int32 - ordinal
Int32 - size
Int32 - compression - other bits points to offsfet in table1 or table2

Array of Table1 Int16
num & (~0x0800) is chunk offset. If 0x0800 is not set, end of the part OR chunk is not compressed and is 0x8000 bytes length

Table2 bytes array
Array of Int16 of format 80XX, where XX - how many blocks taken by compressed chunk.

Aligned by 4 FF FF FF FF 00 80 00 00 FF FF FF FF FF FF FF FF FF FF FF FF
... Data ...
Offset of names offset:
Array of Files count Int32 - relative offsets of file names
Array of Files count File name
File name
Null terminated string - name
Int32 - zero

Ordinals starts with -256, then 0, 1, 2, 3 ...
Compression: LZMA if has 0x20000000 bit, None if if FFFFFFFF
Name offsets are relative to names table offset. So, first name offset will be files count multiplied by 4 - that is size of table.

Return to “N.Sane Tech”

Who is online

Users browsing this forum: No registered users and 1 guest