Commit e1f8c0d9 by devttys0

Fixed extraction bug

parent 164bd554
...@@ -400,12 +400,6 @@ class Module(object): ...@@ -400,12 +400,6 @@ class Module(object):
if display_args: if display_args:
self.config.display.format_strings(self.HEADER_FORMAT, self.RESULT_FORMAT) self.config.display.format_strings(self.HEADER_FORMAT, self.RESULT_FORMAT)
self.config.display.result(*display_args) self.config.display.result(*display_args)
else:
# If this specific result has been marked to not be displayed to the user (e.g.,
# it has been excluded via a -x or -y option), then disable extraction as well.
# Note that this does not effect results that are not displayed globally (i.e.,
# if --quiet was specified).
r.extract = False
return r return r
......
...@@ -117,8 +117,10 @@ class Extractor(Module): ...@@ -117,8 +117,10 @@ class Extractor(Module):
if r.valid: if r.valid:
binwalk.core.common.debug("Extractor callback for %s:%d [%s & %s & %s]" % (r.file.name, r.offset, str(r.valid), str(r.display), str(r.extract))) binwalk.core.common.debug("Extractor callback for %s:%d [%s & %s & %s]" % (r.file.name, r.offset, str(r.valid), str(r.display), str(r.extract)))
# Only extract valid results that have been marked for extraction # Only extract valid results that have been marked for extraction and displayed to the user.
if r.valid and r.extract: # Note that r.display is still True even if --quiet has been specified; it is False if the result has been
# explicitly excluded via the -y/-x options.
if r.valid and r.extract and r.display:
# Do the extraction # Do the extraction
binwalk.core.common.debug("Attempting extraction...") binwalk.core.common.debug("Attempting extraction...")
(extraction_directory, dd_file) = self.extract(r.offset, r.description, r.file.name, size, r.name) (extraction_directory, dd_file) = self.extract(r.offset, r.description, r.file.name, size, r.name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment