diff options
| author | Peter LaFosse <peter@vector35.com> | 2017-01-07 16:08:08 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2017-01-07 16:08:08 -0500 |
| commit | 9d1cac8ee55553cdb20c36deb3b15c9219b02d9b (patch) | |
| tree | 1b3297c8ca4d7b58341095567173b2fff89e1ed2 /python/examples/instruction_iterator.py | |
| parent | 27911e9d6625d8f8acf900a4753c1833dd96ffe0 (diff) | |
More fixes for refactor
Diffstat (limited to 'python/examples/instruction_iterator.py')
| -rw-r--r-- | python/examples/instruction_iterator.py | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/python/examples/instruction_iterator.py b/python/examples/instruction_iterator.py index 47717aa0..7ff2d692 100644 --- a/python/examples/instruction_iterator.py +++ b/python/examples/instruction_iterator.py @@ -22,21 +22,10 @@ import sys import binaryninja as binja - -if sys.platform.lower().startswith("linux"): - bintype = "ELF" -elif sys.platform.lower() == "darwin": - bintype = "Mach-O" -else: - raise Exception("%s is not supported on this plugin" % sys.platform) - if len(sys.argv) > 1: target = sys.argv[1] -else: - target = "/bin/ls" -bv = binja.BinaryViewType[bintype].open(target) -bv.update_analysis_and_wait() +bv = binja.BinaryViewType.get_view_of_file(target) binja.log_to_stdout(True) binja.log_info("-------- %s --------" % target) binja.log_info("START: 0x%x" % bv.start) @@ -46,19 +35,19 @@ binja.log_info("\n-------- Function List --------") """ print all the functions, their basic blocks, and their il instructions """ for func in bv.functions: - binja.log_info(repr(func)) - for block in func.low_level_il: - binja.log_info("\t{0}".format(block)) + binja.log_info(repr(func)) + for block in func.low_level_il: + binja.log_info("\t{0}".format(block)) - for insn in block: - binja.log_info("\t\t{0}".format(insn)) + for insn in block: + binja.log_info("\t\t{0}".format(insn)) """ print all the functions, their basic blocks, and their mc instructions """ for func in bv.functions: - binja.log_info(repr(func)) - for block in func: - binja.log_info("\t{0}".format(block)) + binja.log_info(repr(func)) + for block in func: + binja.log_info("\t{0}".format(block)) - for insn in block: - binja.log_info("\t\t{0}".format(insn)) + for insn in block: + binja.log_info("\t\t{0}".format(insn)) |
