diff options
| author | Camille Mougey <commial@gmail.com> | 2018-07-06 14:20:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-06 14:20:20 +0200 |
| commit | 89cb925f74a29f1ab6dc2dc2b2d68c4f6a9d4158 (patch) | |
| tree | f0a524f4d7d6e5f2ffe211271606275c03ddb822 | |
| parent | 396d2d74e8a4593550955d549579456dfbf6e74a (diff) | |
| parent | 814b0dff0d6a257f0d8fb55239e1bea5a7c6b94f (diff) | |
| download | miasm-89cb925f74a29f1ab6dc2dc2b2d68c4f6a9d4158.tar.gz miasm-89cb925f74a29f1ab6dc2dc2b2d68c4f6a9d4158.zip | |
Merge pull request #790 from serpilliere/fix_ida_dg_example
Example/ida: fix dg
| -rw-r--r-- | example/ida/depgraph.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py index 297877a1..13c37eee 100644 --- a/example/ida/depgraph.py +++ b/example/ida/depgraph.py @@ -159,7 +159,7 @@ def clean_lines(): def treat_element(): "Display an element" - global graphs, comments, sol_nb, settings, addr, ir_arch + global graphs, comments, sol_nb, settings, addr, ir_arch, ircfg try: graph = graphs.next() @@ -176,7 +176,7 @@ def treat_element(): for node in graph.relevant_nodes: try: - offset = ir_arch.blocks[node.loc_key][node.line_nb].instr.offset + offset = ircfg.blocks[node.loc_key][node.line_nb].instr.offset except IndexError: print "Unable to highlight %s" % node continue @@ -186,7 +186,7 @@ def treat_element(): if graph.has_loop: print 'Graph has dependency loop: symbolic execution is inexact' else: - print "Possible value: %s" % graph.emul(self.ira).values()[0] + print "Possible value: %s" % graph.emul(ir_arch).values()[0] for offset, elements in comments.iteritems(): idc.MakeComm(offset, ", ".join(map(str, elements))) @@ -198,7 +198,7 @@ def next_element(): def launch_depgraph(): - global graphs, comments, sol_nb, settings, addr, ir_arch + global graphs, comments, sol_nb, settings, addr, ir_arch, ircfg # Get the current function addr = idc.ScreenEA() func = ida_funcs.get_func(addr) @@ -228,7 +228,7 @@ def launch_depgraph(): loc_key, elements, line_nb = settings.loc_key, settings.elements, settings.line_nb # Simplify affectations - for irb in ir_arch.blocks.values(): + for irb in ircfg.blocks.values(): irs = [] offset = ir_arch.loc_db.get_location_offset(irb.loc_key) fix_stack = offset is not None and settings.unalias_stack @@ -246,7 +246,7 @@ def launch_depgraph(): dst, src = expr_simp(dst), expr_simp(src) new_assignblk[dst] = src irs.append(AssignBlock(new_assignblk, instr=assignblk.instr)) - ir_arch.blocks[irb.loc_key] = IRBlock(irb.loc_key, irs) + ircfg.blocks[irb.loc_key] = IRBlock(irb.loc_key, irs) # Get dependency graphs dg = settings.depgraph |