Commit 42055874 by Craig Heffner

Updated API documentation

parent 53a1253a
......@@ -84,7 +84,7 @@ Note the above use of the `--quiet` option which prevents the binwalk module fro
Each module object will also have an additional `extractor` attribute, which is an instance of the `binwalk.modules.extractor.Extractor` class. Of particular use is `binwalk.modules.extractor.Extractor.output`, a dictionary containing information about carved/extracted data:
```python
for module in binwalk.scan('firmware1.bin', 'firmware2.bin', signature=True, quiet=True, extract=True):
for module in binwalk.scan(sys.argv[1], signature=True, quiet=True, extract=True):
for result in module.results:
if module.extractor.output.has_key(result.file.path):
# These are files that binwalk carved out of the original firmware image, a la dd
......@@ -92,9 +92,13 @@ for module in binwalk.scan('firmware1.bin', 'firmware2.bin', signature=True, qui
print "Carved data from offset 0x%X to %s" % (result.offset, module.extractor.output[result.file.path].carved[result.offset])
# These are files/directories created by extraction utilities (gunzip, tar, unsquashfs, etc)
if module.extractor.output[result.file.path].extracted.has_key(result.offset):
print "Extracted data from offset 0x%X to %s" % (result.offset, module.extractor.output[result.file.path].extracted[result.offset][0])
print "Extracted %d files from offset 0x%X to '%s' using '%s'" % (len(module.extractor.output[result.file.path].extracted[result.offset].files),
result.offset,
module.extractor.output[result.file.path].extracted[result.offset].files[0],
module.extractor.output[result.file.path].extracted[result.offset].command)
```
Module Exceptions
=================
......
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