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/depgraph.py | |
| parent | b8af43b26480b65d25f6fc3832884fa1df4db4d0 (diff) | |
| download | miasm-eba583bfb85978d7eadd2eb53095e4100e095f60.tar.gz miasm-eba583bfb85978d7eadd2eb53095e4100e095f60.zip | |
Fix ida examples
Diffstat (limited to 'example/ida/depgraph.py')
| -rw-r--r-- | example/ida/depgraph.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py index 65b57e89..e98d64c5 100644 --- a/example/ida/depgraph.py +++ b/example/ida/depgraph.py @@ -15,6 +15,7 @@ import ida_kernwin from miasm.core.bin_stream_ida import bin_stream_ida from miasm.core.asmblock import * from miasm.expression import expression as m2_expr +from miasm.core.locationdb import LocationDB from miasm.expression.simplifications import expr_simp from miasm.analysis.depgraph import DependencyGraph @@ -216,14 +217,16 @@ def launch_depgraph(): mn, dis_engine, ira = machine.mn, machine.dis_engine, machine.ira bs = bin_stream_ida() - mdis = dis_engine(bs, dont_dis_nulstart_bloc=True) - ir_arch = ira(mdis.loc_db) + loc_db = LocationDB() + + mdis = dis_engine(bs, loc_db=loc_db, dont_dis_nulstart_bloc=True) + ir_arch = ira(loc_db) # Populate symbols with ida names for ad, name in idautils.Names(): if name is None: continue - mdis.loc_db.add_location(name, ad) + loc_db.add_location(name, ad) asmcfg = mdis.dis_multiblock(func.start_ea) @@ -238,7 +241,7 @@ def launch_depgraph(): # Simplify assignments for irb in list(viewvalues(ircfg.blocks)): irs = [] - offset = ir_arch.loc_db.get_location_offset(irb.loc_key) + offset = loc_db.get_location_offset(irb.loc_key) fix_stack = offset is not None and settings.unalias_stack for assignblk in irb: if fix_stack: @@ -259,7 +262,7 @@ def launch_depgraph(): # Get dependency graphs dg = settings.depgraph graphs = dg.get(loc_key, elements, line_nb, - set([ir_arch.loc_db.get_offset_location(func.start_ea)])) + set([loc_db.get_offset_location(func.start_ea)])) # Display the result comments = {} |