Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(handler): add support for non-standard squashfs v2 signature. #639

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions unblob/handlers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
ntfs.NTFSHandler,
romfs.RomFSFSHandler,
squashfs.SquashFSv2Handler,
squashfs.SquashFSv2NonStandardHandler,
squashfs.SquashFSv3Handler,
squashfs.SquashFSv3DDWRTHandler,
squashfs.SquashFSv3BroadcomHandler,
Expand Down
19 changes: 19 additions & 0 deletions unblob/handlers/filesystem/squashfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,25 @@ class SquashFSv2Handler(_SquashFSBase):
HEADER_STRUCT = "squashfs2_super_block_t"


class SquashFSv2NonStandardHandler(SquashFSv2Handler):
NAME = "squashfs_v2_nonstandard"

BIG_ENDIAN_MAGIC = 0x73_71_6C_7A

EXTRACTOR = SquashFSExtractor(0x73_71_6C_7A)

PATTERNS = [
HexString(
"""
// 00000000 73 71 6c 7a 00 00 03 3f 00 21 99 d7 00 21 99 c7 |sqlz...?........|
// 00000010 00 00 00 00 00 21 71 7c 00 21 82 89 00 02 00 01 |.!...!.......!q.|
// squashfs_v2_magic_non_standard_be
73 71 6c 7a [24] 00 02
"""
),
]


class SquashFSv3Handler(_SquashFSBase):
NAME = "squashfs_v3"

Expand Down