forked from ReFirmLabs/binwalk
-
Notifications
You must be signed in to change notification settings - Fork 19
Scripting With the Python API
David Roman edited this page Feb 29, 2024
·
1 revision
import binwalk
# Equivalent to: 'binwalk --signature firmware1.bin firmware2.bin'.
# Note the use of 'quiet=True' to suppress normal binwalk output.
for module in binwalk.scan('firmware1.bin',
'firmware2.bin',
signature=True,
quiet=True):
# binwalk.scan returns a module object for every executed
# module; in this case, there should be only one, which is
# the signature module.
print ("%s Results:" % module.name)
# Each module has a list of result objects, describing
# the results returned from the executed module.
for result in module.results:
print ("\t%s 0x%.8X %s" % (result.file.name,
result.offset,
result.description))
See the API documentation for more details.
sudo python setup.py install