Debian Codegraph @

src/scripts/examples/extract_data.py

raw symbols SCIP
1 #!/usr/bin/env python
2
3 import sys
4 import binwalk
5
6 # Extracts and logs
7 for module in binwalk.scan(*sys.argv[1:], signature=True, quiet=True, extract=True):
8 print ("%s Results:" % module.name)
9 for result in module.results:
10 if module.extractor.output.has_key(result.file.path):
11 if module.extractor.output[result.file.path].extracted.has_key(result.offset):
12 print ("Extracted '%s' at offset 0x%X from '%s' to '%s'" % (result.description.split(',')[0],
13 result.offset,
14 result.file.path,
15 str(module.extractor.output[result.file.path].extracted[result.offset])))