about summary refs log tree commit diff stats
path: root/example/symbol_exec/dse_strategies.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2020-08-22 12:47:01 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2020-08-31 07:50:01 +0200
commit80e40a3d2ca735db955807ad0605b43ca22e4e35 (patch)
tree4d41d7b53565f833444d3520eb22eed3e8bf26f1 /example/symbol_exec/dse_strategies.py
parent5d8beb271d9890241a6d61dd476fab26ca37ebbf (diff)
downloadmiasm-80e40a3d2ca735db955807ad0605b43ca22e4e35.tar.gz
miasm-80e40a3d2ca735db955807ad0605b43ca22e4e35.zip
Avoid generate default locationdb
Diffstat (limited to 'example/symbol_exec/dse_strategies.py')
-rw-r--r--example/symbol_exec/dse_strategies.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/example/symbol_exec/dse_strategies.py b/example/symbol_exec/dse_strategies.py
index 3f968215..bcea2329 100644
--- a/example/symbol_exec/dse_strategies.py
+++ b/example/symbol_exec/dse_strategies.py
@@ -26,6 +26,7 @@ from miasm.analysis.machine import Machine
 from miasm.jitter.csts import PAGE_READ, PAGE_WRITE
 from miasm.analysis.dse import DSEPathConstraint
 from miasm.expression.expression import ExprMem, ExprId, ExprInt, ExprAssign
+from miasm.core.locationdb import LocationDB
 
 # Argument handling
 parser = ArgumentParser("DSE Example")
@@ -41,10 +42,12 @@ strategy = {
     "path-cov": DSEPathConstraint.PRODUCE_SOLUTION_PATH_COV,
 }[args.strategy]
 
+loc_db = LocationDB()
+
 # Map the shellcode
 run_addr = 0x40000
 machine = Machine("x86_32")
-jitter = machine.jitter("python")
+jitter = machine.jitter(loc_db, "python")
 with open(args.filename, "rb") as fdesc:
     jitter.vm.add_memory_page(
         run_addr,
@@ -72,7 +75,7 @@ jitter.push_uint32_t(ret_addr)
 jitter.init_run(run_addr)
 
 # Init a DSE instance with a given strategy
-dse = DSEPathConstraint(machine, produce_solution=strategy)
+dse = DSEPathConstraint(machine, loc_db, produce_solution=strategy)
 dse.attach(jitter)
 # Concretize everything except the argument
 dse.update_state_from_concrete()