Skip to content

Commit

Permalink
fix(handlers): fix extfs handler for samples with spaces in their names.
Browse files Browse the repository at this point in the history
The Command extractor definition for our extfs handler was defined so
that a sample with space in its name would make debugfs go haywire since
the path was not properly quoted.

debugfs -R 'rdump / a_sample_with_no_space.ext4_extract' sample.ext4 -> works

debugfs -R 'rdump / a sample with space.ext4_extract' sample.ext4 -> does not work

Fixed by quoting the output dir :)
  • Loading branch information
qkaiser committed Sep 28, 2023
1 parent b2a1268 commit f9fa0ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unblob/handlers/filesystem/extfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class EXTHandler(StructHandler):

PATTERN_MATCH_OFFSET = -MAGIC_OFFSET

EXTRACTOR = Command("debugfs", "-R", "rdump / {outdir}", "{inpath}")
EXTRACTOR = Command("debugfs", "-R", 'rdump / "{outdir}"', "{inpath}")

def valid_header(self, header) -> bool:
if header.s_state not in [0x1, 0x2]:
Expand Down

0 comments on commit f9fa0ee

Please sign in to comment.