about summary refs log tree commit diff stats
path: root/example/jitter/mips32.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2018-06-19 17:36:58 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2018-06-21 13:36:34 +0200
commitc6462990df3773ed4bdf82f7dc3b30f1c6331a81 (patch)
treee43438e959a5a38d45787753863abb34c5d82ba7 /example/jitter/mips32.py
parentbd80c0876aeecdc027c0c0b0725f0f890d41fa62 (diff)
downloadmiasm-c6462990df3773ed4bdf82f7dc3b30f1c6331a81.tar.gz
miasm-c6462990df3773ed4bdf82f7dc3b30f1c6331a81.zip
Jitter: add simple trace api
Diffstat (limited to 'example/jitter/mips32.py')
-rwxr-xr-xexample/jitter/mips32.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/example/jitter/mips32.py b/example/jitter/mips32.py
index c5b2f7f5..31ab03c8 100755
--- a/example/jitter/mips32.py
+++ b/example/jitter/mips32.py
@@ -5,16 +5,11 @@ from miasm2.analysis import debugging
 from miasm2.jitter.csts import *
 from miasm2.analysis.machine import Machine
 
-from pdb import pm
-
 parser = ArgumentParser(
     description="""Sandbox raw binary with mips32 engine
 (ex: jit_mips32.py example/mips32_sc_l.bin 0)""")
-parser.add_argument("-r", "--log-regs",
-                    help="Log registers value for each instruction",
-                    action="store_true")
-parser.add_argument("-m", "--log-mn",
-                    help="Log desassembly conversion for each instruction",
+parser.add_argument("-t", "--trace",
+                    help="Log instructions/registers values",
                     action="store_true")
 parser.add_argument("-n", "--log-newbloc",
                     help="Log basic blocks processed by the Jitter",
@@ -43,9 +38,11 @@ def jit_mips32_binary(args):
     myjit.init_stack()
 
     # Log level (if available with jitter engine)
-    myjit.jit.log_regs = args.log_regs
-    myjit.jit.log_mn = args.log_mn
-    myjit.jit.log_newbloc = args.log_newbloc
+    myjit.set_trace_log(
+        trace_instr=args.trace,
+        trace_regs=args.trace,
+        trace_new_blocks=args.log_newbloc
+    )
 
     myjit.vm.add_memory_page(0, PAGE_READ | PAGE_WRITE, open(filepath).read())
     myjit.add_breakpoint(0x1337BEEF, code_sentinelle)