diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-03-10 09:38:58 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2016-03-21 15:09:22 +0100 |
| commit | 752d7fb00c46aefc87f8a1c8f3aab450e7dc1b44 (patch) | |
| tree | f4a975cb33317a5e447e7e2e0270c1f06f560c7b /example/ida/depgraph.py | |
| parent | 28335f53f75f8404d6a5432e3a860531e2903f71 (diff) | |
| download | miasm-752d7fb00c46aefc87f8a1c8f3aab450e7dc1b44.tar.gz miasm-752d7fb00c46aefc87f8a1c8f3aab450e7dc1b44.zip | |
Depgraph: updt api
Diffstat (limited to 'example/ida/depgraph.py')
| -rw-r--r-- | example/ida/depgraph.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py index 406f7200..1784b4e4 100644 --- a/example/ida/depgraph.py +++ b/example/ida/depgraph.py @@ -132,9 +132,11 @@ for bloc in blocs: # Simplify affectations for irb in ir_arch.blocs.values(): - for irs in irb.irs: - for i, expr in enumerate(irs): - irs[i] = m2_expr.ExprAff(expr_simp(expr.dst), expr_simp(expr.src)) + for assignblk in irb.irs: + for dst, src in assignblk.items(): + del(assignblk[dst]) + dst, src = expr_simp(dst), expr_simp(src) + assignblk[dst] = src # Get settings settings = depGraphSettingsForm(ir_arch) @@ -183,7 +185,10 @@ def treat_element(): comments[offset] = comments.get(offset, []) + [node.element] SetColor(offset, CIC_ITEM, settings.color) - print "Possible value: %s" % graph.emul().values()[0] + if graph.has_loop: + print 'Graph has dependency loop: symbolic execution is inexact' + else: + print "Possible value: %s" % graph.emul().values()[0] for offset, elements in comments.iteritems(): MakeComm(offset, ", ".join(map(str, elements))) |