From 02bbb30efea4980c9d133947cbbf69fb599071ad Mon Sep 17 00:00:00 2001 From: Fabrice Desclaux Date: Mon, 25 Feb 2019 11:09:54 +0100 Subject: Support python2/python3 --- example/disasm/dis_x86_string.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'example/disasm/dis_x86_string.py') diff --git a/example/disasm/dis_x86_string.py b/example/disasm/dis_x86_string.py index 8f919e4e..175e9264 100644 --- a/example/disasm/dis_x86_string.py +++ b/example/disasm/dis_x86_string.py @@ -1,8 +1,9 @@ +from __future__ import print_function from miasm2.analysis.binary import Container from miasm2.analysis.machine import Machine # The Container will provide a *bin_stream*, bytes source for the disasm engine -cont = Container.from_string("\x83\xf8\x10\x74\x07\x89\xc6\x0f\x47\xc3\xeb\x08\x89\xc8\xe8\x31\x33\x22\x11\x40\xc3") +cont = Container.from_string(b"\x83\xf8\x10\x74\x07\x89\xc6\x0f\x47\xc3\xeb\x08\x89\xc8\xe8\x31\x33\x22\x11\x40\xc3") # Instantiate a x86 32 bit architecture machine = Machine("x86_32") @@ -16,7 +17,7 @@ asmcfg = mdis.dis_multiblock(0) # Display each basic blocks for block in asmcfg.blocks: - print block + print(block) # Output control flow graph in a dot file open('str_cfg.dot', 'w').write(asmcfg.dot()) -- cgit 1.4.1