Skip to content

Commit aff6a7a

Browse files
committed
feat(handler): add support for non-standard squashfs v2 signature.
1 parent fe1b17c commit aff6a7a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

unblob/handlers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
ntfs.NTFSHandler,
4545
romfs.RomFSFSHandler,
4646
squashfs.SquashFSv2Handler,
47+
squashfs.SquashFSv2NonStandardHandler,
4748
squashfs.SquashFSv3Handler,
4849
squashfs.SquashFSv3DDWRTHandler,
4950
squashfs.SquashFSv3BroadcomHandler,

unblob/handlers/filesystem/squashfs.py

+19
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,25 @@ class SquashFSv2Handler(_SquashFSBase):
115115
HEADER_STRUCT = "squashfs2_super_block_t"
116116

117117

118+
class SquashFSv2NonStandardHandler(SquashFSv2Handler):
119+
NAME = "squashfs_v2_nonstandard"
120+
121+
BIG_ENDIAN_MAGIC = 0x73_71_6C_7A
122+
123+
EXTRACTOR = SquashFSExtractor(0x73_71_6C_7A)
124+
125+
PATTERNS = [
126+
HexString(
127+
"""
128+
// 00000000 73 71 6c 7a 00 00 03 3f 00 21 99 d7 00 21 99 c7 |sqlz...?........|
129+
// 00000010 00 00 00 00 00 21 71 7c 00 21 82 89 00 02 00 01 |.!...!.......!q.|
130+
// squashfs_v2_magic_non_standard_be
131+
73 71 6c 7a [24] 00 02
132+
"""
133+
),
134+
]
135+
136+
118137
class SquashFSv3Handler(_SquashFSBase):
119138
NAME = "squashfs_v3"
120139

0 commit comments

Comments
 (0)