Open
Description
Description
Brotli is a general-purpose, lossless compression algorithm developed by Google, widely used for web content compression (e.g., serving compressed static files).
References
How to Craft
- Install Brotli CLI (e.g.,
sudo apt-get install brotli
or vianpm install brotli
). - Run:
brotli --quality=9 --input file_to_compress --output file_to_compress.br
Magic Value / Signature
- No fixed magic number. Brotli’s initial bytes encode parameters (like window size), but it’s not a static signature.
- Detection often relies on partial stream parsing or heuristics.
How to Extract / Decompress
- Tool: Use the
brotli
CLI to decompress:brotli --decompress file_to_compress.br
- Python Library: The
brotli
library supports decompression in Python.
Determining End Offset
- Brotli streams are self-terminating.
- unblob can either:
- Decode the stream until it ends.
- Use the container file size if available.
- Proper detection requires partial decoding or known container boundaries to confirm the stream ends where expected.