diff options
| author | Camille Mougey <commial@gmail.com> | 2019-03-07 14:37:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-07 14:37:07 +0100 |
| commit | 4c2320b46250a8d6f8774e1218544b72a154cd8e (patch) | |
| tree | b67e7b072439f84109bd39dad8ed7f3f135224f8 /example/jitter/trace.py | |
| parent | eab809932871f91d6f4aa770fc321af9e156e0f5 (diff) | |
| parent | 26c1075723a02984da6d3bc7423c5c0c43082dc3 (diff) | |
| download | miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.tar.gz miasm-4c2320b46250a8d6f8774e1218544b72a154cd8e.zip | |
Merge pull request #990 from serpilliere/support_python2_python3
Support python2 python3
Diffstat (limited to 'example/jitter/trace.py')
| -rw-r--r-- | example/jitter/trace.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/example/jitter/trace.py b/example/jitter/trace.py index e1683450..46b313c1 100644 --- a/example/jitter/trace.py +++ b/example/jitter/trace.py @@ -6,12 +6,14 @@ This example demonstrates two instrumentation possibility: Note: for better performance, one can also extend Codegen to produce instrumentation at the C / LLVM level """ +from __future__ import print_function + import os import time from pdb import pm -from miasm2.analysis.sandbox import Sandbox_Linux_arml -from miasm2.jitter.emulatedsymbexec import EmulatedSymbExec -from miasm2.jitter.jitcore_python import JitCore_Python +from miasm.analysis.sandbox import Sandbox_Linux_arml +from miasm.jitter.emulatedsymbexec import EmulatedSymbExec +from miasm.jitter.jitcore_python import JitCore_Python # Function called at each instruction instr_count = 0 @@ -26,11 +28,11 @@ class ESETrackMemory(EmulatedSymbExec): def mem_read(self, expr_mem): value = super(ESETrackMemory, self).mem_read(expr_mem) - print "Read %s: %s" % (expr_mem, value) + print("Read %s: %s" % (expr_mem, value)) return value def mem_write(self, dest, data): - print "Write %s: %s" % (dest, data) + print("Write %s: %s" % (dest, data)) return super(ESETrackMemory, self).mem_write(dest, data) # Parse arguments @@ -55,4 +57,4 @@ sb.run() stop_time = time.time() assert sb.jitter.run is False -print "Instr speed: %02.f / sec" % (instr_count / (stop_time - start_time)) +print("Instr speed: %02.f / sec" % (instr_count / (stop_time - start_time))) |