about summary refs log tree commit diff stats
path: root/example/disasm/dis_x86_string.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2019-03-07 14:37:07 +0100
committerGitHub <noreply@github.com>2019-03-07 14:37:07 +0100
commit4c2320b46250a8d6f8774e1218544b72a154cd8e (patch)
treeb67e7b072439f84109bd39dad8ed7f3f135224f8 /example/disasm/dis_x86_string.py
parenteab809932871f91d6f4aa770fc321af9e156e0f5 (diff)
parent26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff)
downloadmiasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz
miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'example/disasm/dis_x86_string.py')
-rw-r--r--example/disasm/dis_x86_string.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/example/disasm/dis_x86_string.py b/example/disasm/dis_x86_string.py
index 8f919e4e..6d4e2c84 100644
--- a/example/disasm/dis_x86_string.py
+++ b/example/disasm/dis_x86_string.py
@@ -1,8 +1,9 @@
-from miasm2.analysis.binary import Container
-from miasm2.analysis.machine import Machine
+from __future__ import print_function
+from miasm.analysis.binary import Container
+from miasm.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())