Skip to content

Commit

Permalink
fix(handler): extend valid states to 0, 1, and 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
qkaiser committed Jan 12, 2024
1 parent ab5436d commit a8f24d3
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 2 deletions.
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
Git LFS file not shown
4 changes: 2 additions & 2 deletions unblob/handlers/filesystem/extfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class EXTHandler(StructHandler):
NAME = "extfs"

PATTERNS = [HexString("53 ef ( 01 | 02 ) 00 ( 00 | 01 | 02 | 03 | 04 ) 00")]
PATTERNS = [HexString("53 ef ( 00 | 01 | 02 ) 00 ( 00 | 01 | 02 | 03 | 04 ) 00")]

C_DEFINITIONS = r"""
typedef struct ext4_superblock {
Expand Down Expand Up @@ -67,7 +67,7 @@ class EXTHandler(StructHandler):
EXTRACTOR = Command("debugfs", "-R", 'rdump / "{outdir}"', "{inpath}")

def valid_header(self, header) -> bool:
if header.s_state not in [0x1, 0x2]:
if header.s_state not in [0x0, 0x1, 0x2]:
logger.debug("ExtFS header state not valid", state=header.s_state)
return False
if header.s_errors not in [0x0, 0x1, 0x2, 0x3]:
Expand Down

0 comments on commit a8f24d3

Please sign in to comment.