diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-10-30 14:56:05 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2020-10-30 14:56:05 +0100 |
| commit | eba583bfb85978d7eadd2eb53095e4100e095f60 (patch) | |
| tree | e89b30eac8dee961a9e442d6d0a3425f41b6f314 /example/ida/symbol_exec.py | |
| parent | b8af43b26480b65d25f6fc3832884fa1df4db4d0 (diff) | |
| download | miasm-eba583bfb85978d7eadd2eb53095e4100e095f60.tar.gz miasm-eba583bfb85978d7eadd2eb53095e4100e095f60.zip | |
Fix ida examples
Diffstat (limited to 'example/ida/symbol_exec.py')
| -rw-r--r-- | example/ida/symbol_exec.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/example/ida/symbol_exec.py b/example/ida/symbol_exec.py index d1141119..b51ef9ee 100644 --- a/example/ida/symbol_exec.py +++ b/example/ida/symbol_exec.py @@ -9,6 +9,7 @@ import idc from miasm.expression.expression_helper import Variables_Identifier from miasm.expression.expression import ExprAssign +from miasm.core.locationdb import LocationDB from utils import expr2colorstr, translatorForm @@ -136,11 +137,12 @@ def symbolic_exec(): from utils import guess_machine start, end = idc.read_selection_start(), idc.read_selection_end() + loc_db = LocationDB() bs = bin_stream_ida() machine = guess_machine(addr=start) - mdis = machine.dis_engine(bs) + mdis = machine.dis_engine(bs, loc_db=loc_db) if start == idc.BADADDR and end == idc.BADADDR: start = idc.get_screen_ea() @@ -148,7 +150,7 @@ def symbolic_exec(): mdis.dont_dis = [end] asmcfg = mdis.dis_multiblock(start) - ira = machine.ira(loc_db=mdis.loc_db) + ira = machine.ira(loc_db=loc_db) ircfg = ira.new_ircfg_from_asmcfg(asmcfg) print("Run symbolic execution...") @@ -161,7 +163,7 @@ def symbolic_exec(): view = symbolicexec_t() all_views.append(view) - if not view.Create(modified, machine, mdis.loc_db, + if not view.Create(modified, machine, loc_db, "Symbolic Execution - 0x%x to 0x%x" % (start, idc.prev_head(end))): return |