diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2020-08-31 09:27:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-31 09:27:56 +0200 |
| commit | 06239dde95cd984548deb40e9945d8bd85d83425 (patch) | |
| tree | 2fb59bca2aada9280fb1aecd2ebdd633a23cdc4b /example/symbol_exec/dse_strategies.py | |
| parent | 5d8beb271d9890241a6d61dd476fab26ca37ebbf (diff) | |
| parent | 24ce193b8bad352853a9c5589f6fdcf5177d5466 (diff) | |
| download | miasm-06239dde95cd984548deb40e9945d8bd85d83425.tar.gz miasm-06239dde95cd984548deb40e9945d8bd85d83425.zip | |
Merge pull request #1274 from serpilliere/dont_gen_locationdb
Avoid generate default locationdb
Diffstat (limited to 'example/symbol_exec/dse_strategies.py')
| -rw-r--r-- | example/symbol_exec/dse_strategies.py | 7 |
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() |