Expand description
Bundle packers following helpers/CompressionHelper.py:158-231.
LZ4 and LZ4HC both use pristine liblz4 1.9.4 HC at level 9.
Structs§
- Block
Info - One UnityFS block-table row, before it is serialized.
- Packed
Blocks - Packed bundle payload and its metered block table.
Functions§
- chunk_
based_ compress - UnityPy 1.25.2’s
chunk_based_compress(helpers/CompressionHelper.py:158-231): 128 KiB for LZ4, at mostu32::MAXfor LZMA. A chunk is stored only when compression strictly increases its size; all other flag bits survive. Stored empty data has one empty row; a compressing packer has no row for empty data. - compress
- Compress one block, including Unity’s five-byte LZMA properties prefix.
Both LZ4 codec IDs select
compress_lz4(helpers/CompressionHelper.py:97-105). - head_
chunk_ based_ compress - HEAD 417d595’s
chunk_based_compress: the bytes already written, with padding, determine whether the next block is stored. From format 9 each compressed-packer block has an offset and trailing 16-byte alignment. - registered_
chunks - Compress through the context’s registered block codecs and chunk policy.
headselects the later bundle layout when explicitly requested. - registered_
compress - Compress a single registered block, such as a bundle’s directory table.