Skip to content
Snippets Groups Projects
Commit 9e1786fa authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

If we fail to scan using binwalk, return 'False' from BinwalkFile.recognizes.

parent dd7bace5
No related branches found
No related tags found
No related merge requests found
Pipeline #344737 failed
......@@ -34,7 +34,7 @@ except ImportError:
try:
import binwalk
except ImportError:
except Exception:
python_module_missing("binwalk")
binwalk = None
else:
......@@ -89,14 +89,17 @@ class BinwalkFile(File):
unpacked = get_temporary_directory(prefix="binwalk")
logger.debug("Extracting %s to %s", file.path, unpacked.name)
binwalk.scan(
file.path,
dd="cpio:cpio",
carve=True,
quiet=True,
signature=True,
directory=unpacked.name,
)
try:
binwalk.scan(
file.path,
dd="cpio:cpio",
carve=True,
quiet=True,
signature=True,
directory=unpacked.name,
)
except binwalk.core.exceptions.ModuleException:
return False
members = {
"{} file embedded at offset {}".format(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment