Changelog: bv.write and bv.insert require a bytes object in python3 Architecture.assemble outputs a bytes object in python3, a str in python2 Architecture.assemble will throw a value error if it cannot assemble the given instruction API install script should be run in the version of python you want it installed in Fundamental python changes to be aware of: Unicode-type strings are now just str, consequently anything that came out as a unicode string before (annotations) are now just str. Longs no longer exist. They're just ints.
| -rwxr-xr-x | python/examples/export_svg.py | 6 |
diff --git a/python/examples/export_svg.py b/python/examples/export_svg.py index 7814c9fd..5bb27824 100755 --- a/python/examples/export_svg.py +++ b/python/examples/export_svg.py @@ -48,15 +48,15 @@ def save_svg(bv, function): def instruction_data_flow(function, address): ''' TODO: Extract data flow information ''' - length = function.view.get_instruction_length(address) - bytes = function.view.read(address, length) + length = binaryninja.function.view.get_instruction_length(address) + bytes = binaryninja.function.view.read(address, length) hex = bytes.encode('hex') padded = ' '.join([hex[i:i + 2] for i in range(0, len(hex), 2)]) return 'Opcode: {bytes}'.format(bytes=padded) def render_svg(function, origname): - graph = function.create_graph() + graph = binaryninja.function.create_graph() graph.layout_and_wait() heightconst = 15 ratio = 0.48 |