Commit 94c1a966 by devttys0

Updated API documentation

parent bc88ac00
...@@ -76,7 +76,7 @@ Thus, scan results and errors can be programatically accessed rather easily: ...@@ -76,7 +76,7 @@ Thus, scan results and errors can be programatically accessed rather easily:
for module in binwalk.scan('firmware1.bin', 'firmware2.bin', signature=True, quiet=True): for module in binwalk.scan('firmware1.bin', 'firmware2.bin', signature=True, quiet=True):
print ("%s Results:" % module.name) print ("%s Results:" % module.name)
for result in module.results: for result in module.results:
print ("\t%s 0x%.8X %s" % (result.file.name, result.offset, result.description)) print ("\t%s 0x%.8X %s" % (result.file.path, result.offset, result.description))
``` ```
Note the above use of the `--quiet` option which prevents the binwalk module from printing its normal output to screen. Note the above use of the `--quiet` option which prevents the binwalk module from printing its normal output to screen.
...@@ -87,7 +87,7 @@ Each module object will also have an additional `extractor` attribute, which is ...@@ -87,7 +87,7 @@ Each module object will also have an additional `extractor` attribute, which is
for module in binwalk.scan('firmware1.bin', 'firmware2.bin', signature=True, quiet=True, extract=True): for module in binwalk.scan('firmware1.bin', 'firmware2.bin', signature=True, quiet=True, extract=True):
print ("%s Results:" % module.name) print ("%s Results:" % module.name)
for result in module.results: for result in module.results:
print ("\t%s 0x%.8X %s" % (result.file.name, result.offset, result.description)) print ("\t%s 0x%.8X %s" % (result.file.path, result.offset, result.description))
for (file_path, output_dir) in module.extractor.output: for (file_path, output_dir) in module.extractor.output:
print ("%s data was extracted to: %s" % (file_path, output_dir)) print ("%s data was extracted to: %s" % (file_path, output_dir))
``` ```
......
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