diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-07-26 16:02:26 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-07-26 16:18:02 -0400 |
| commit | 6eb3234d924d870641ee30c4263437f1d8a8d5c7 (patch) | |
| tree | b64815c5e0a2c3b1a10a3e3dcab4c786fdd85c34 /python/examples/bin_info.py | |
| parent | c5c93fc82b8929d04f62d241ca50228de60fa5f4 (diff) | |
| parent | 1f986c2698ff9df6d42429b1b7699842223634e5 (diff) | |
Merge branch 'dev' into test_stack_adjust
Diffstat (limited to 'python/examples/bin_info.py')
| -rw-r--r-- | python/examples/bin_info.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/examples/bin_info.py b/python/examples/bin_info.py index 17a96685..05a72ed0 100644 --- a/python/examples/bin_info.py +++ b/python/examples/bin_info.py @@ -20,11 +20,15 @@ # IN THE SOFTWARE. import sys + import binaryninja.log as log from binaryninja.binaryview import BinaryViewType import binaryninja.interaction as interaction from binaryninja.plugin import PluginCommand +# 2-3 compatibility +from binaryninja import range + def get_bininfo(bv): if bv is None: @@ -48,13 +52,13 @@ def get_bininfo(bv): contents += "| Start | Name |\n" contents += "|------:|:-------|\n" - for i in xrange(min(10, len(bv.functions))): + for i in range(min(10, len(bv.functions))): contents += "| 0x%x | %s |\n" % (bv.functions[i].start, bv.functions[i].symbol.full_name) contents += "### First 10 Strings ###\n" contents += "| Start | Length | String |\n" contents += "|------:|-------:|:-------|\n" - for i in xrange(min(10, len(bv.strings))): + for i in range(min(10, len(bv.strings))): start = bv.strings[i].start length = bv.strings[i].length string = bv.read(start, length) @@ -67,6 +71,6 @@ def display_bininfo(bv): if __name__ == "__main__": - print get_bininfo(None) + print(get_bininfo(None)) else: PluginCommand.register("Binary Info", "Display basic info about the binary", display_bininfo) |
