Skip to content

Instantly share code, notes, and snippets.

View snorey's full-sized avatar

Sam Henderson snorey

View GitHub Profile
@snorey
snorey / mozlz4.py
Last active January 7, 2024 02:04
Simple tool to decode Firefox jsonlz4, baklz4 files
#!/usr/bin/python
# Command-line tool to decompress mozLz4 files used for example by Firefox to store various kinds of session backup information.
# Works in both Python 2.7.15 and 3.6.7, as of version 2.1.6 of the LZ4 Python bindings at pypi.org/project/lz4.
# To use in another script, simply cut and paste the import statement and the mozlz4_to_text() function (lines 8 to 17).
import lz4.block # pip install lz4 --user
def mozlz4_to_text(filepath):
# Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file,