parse_unityfs
Decompress and parse the directory from UnityFS/Addressables bundles using LZ4/LZMA decompression.
Instructions
Parse a UnityFS / Addressables bundle, LZ4/LZMA-decompress the first block, and re-parse the directory from the decompressed stream.
The on-disk KSY parse covers the file header + bundle header
per-block size records; the directory actually lives inside the decompressed first block (the on-disk format stores compressed block payloads after the per-block size records, and the directory + asset bodies are in those compressed bytes). This helper LZ4 / LZMA-decompresses the requested block and re-parses the
Directorysub-type from the decompressed stream.
Args:
path: file to parse.
ksy_path: optional path to a .ksy to compile on the
fly. Defaults to the bundled
data/ksy/unity_addressables.ksy (the v0.3
corrected layout). Pass
data/ksy/unityfs.ksy for the older
bundle_header-wrappered variant.
decompress_block: index of the block to re-parse the
directory from (default 0, the canonical directory
block). Pass -1 to skip the directory re-parse.
Returns:
A dict with file_header, bundle_header,
decompressed_blocks[] (each with
uncompressed_size / compressed_size /
decompressed_size / data_b64), and
directory (or None if
decompress_block=-1).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| ksy_path | No | ||
| decompress_block | No |