UE4资源格式
UE4 PAK资源格式
Record
Offset Size Type Description
0 8 uint64_t offset
8 8 uint64_t size (N)
16 8 uint64_t uncompressed size
24 4 uint32_t compression method:
0x00 ... none
0x01 ... zlib
0x10 ... bias memory
0x20 ... bias speed
if version <= 1
28 8 uint64_t timestamp
end
? 20 uint8_t[20] data sha1 hash
if version >= 3
if compression method != 0x00
?+20 4 uint32_t block count (M)
?+24 M*16 CB[M] compression blocks
end
? 1 uint8_t is encrypted
?+1 4 uint32_t compression block size
end
Compression Block (CB)
Size: 16 bytes
Offset Size Type Description
0 8 uint64_t start offset:
Absolute offset of the start of the compression block.
8 8 uint64_t end offset:
Absolute offset of the end of the compression block.
This may not align completely with the start of the
next block.
Data Record
Offset Size Type Description
0 ? Record file metadata (offset field is 0, N = compressed_size)
? N uint8_t[N] file data
Index Record
Offset Size Type Description
0 4 uint32_t file name size (S)
4 S char[S] file name
4+S ? Record file metadata
Index
Offset Size Type Description
0 4 uint32_t mount point size (S)
4 S char[S] mount point
S+4 4 uint32_t record count (N)
S+8 ? IndexRecord[N] records
Header
Size: 44 bytes
Offset Size Type Description
0 4 uint32_t magic: 0x5A6F12E1
4 4 uint32_t version: 1, 2, or 3
8 8 uint64_t index offset
16 8 uint64_t index size
24 20 uint8_t[20] index sha1 hash