about summary refs log tree commit diff stats
path: root/test/jitter/jit_options.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 /test/jitter/jit_options.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 'test/jitter/jit_options.py')
-rw-r--r--test/jitter/jit_options.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/jitter/jit_options.py b/test/jitter/jit_options.py
index a0ddbc11..74808330 100644
--- a/test/jitter/jit_options.py
+++ b/test/jitter/jit_options.py
@@ -1,7 +1,10 @@
+from __future__ import print_function
 import os
 import sys
-from miasm2.jitter.csts import PAGE_READ, PAGE_WRITE
-from miasm2.analysis.machine import Machine
+
+from miasm.core.utils import decode_hex
+from miasm.jitter.csts import PAGE_READ, PAGE_WRITE
+from miasm.analysis.machine import Machine
 from pdb import pm
 
 # Shellcode
@@ -16,7 +19,7 @@ from pdb import pm
 #       RET
 
 
-data = "b810000000bb0100000083e8010f44cb75f8c3".decode("hex")
+data = decode_hex("b810000000bb0100000083e8010f44cb75f8c3")
 run_addr = 0x40000000
 
 def code_sentinelle(jitter):
@@ -40,7 +43,7 @@ def init_jitter():
     return myjit
 
 # Test 'max_exec_per_call'
-print "[+] First run, to jit blocks"
+print("[+] First run, to jit blocks")
 myjit = init_jitter()
 myjit.init_run(run_addr)
 myjit.continue_run()
@@ -62,7 +65,7 @@ def cb(jitter):
     return False
 
 ## Second run
-print "[+] Second run"
+print("[+] Second run")
 myjit.push_uint32_t(0x1337beef)
 myjit.cpu.EAX = 0
 myjit.init_run(run_addr)
@@ -74,7 +77,7 @@ assert myjit.run is True
 assert myjit.cpu.EAX >= 0xA
 
 # Test 'jit_maxline'
-print "[+] Run instr one by one"
+print("[+] Run instr one by one")
 myjit = init_jitter()
 myjit.jit.options["jit_maxline"] = 1
 myjit.jit.options["max_exec_per_call"] = 1