about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2017-04-24 17:33:02 +0200
committerAjax <commial@gmail.com>2017-04-25 10:58:14 +0200
commit60d16ff884ebcb84c48833e99936a395bccea3c8 (patch)
tree0baec781811cb424d363f55afe569304d907b712
parent34e22b9f265c5055eca91597ae20fe4ebce37828 (diff)
downloadmiasm-60d16ff884ebcb84c48833e99936a395bccea3c8.tar.gz
miasm-60d16ff884ebcb84c48833e99936a395bccea3c8.zip
IDA: handle generated labels in depgraph
-rw-r--r--example/ida/depgraph.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/example/ida/depgraph.py b/example/ida/depgraph.py
index bfd7cabc..cbd0cf0f 100644
--- a/example/ida/depgraph.py
+++ b/example/ida/depgraph.py
@@ -22,7 +22,13 @@ class depGraphSettingsForm(Form):
         self.stk_unalias_force = False
 
         self.address = ScreenEA()
-        cur_block = list(ira.getby_offset(self.address))[0]
+        cur_block = None
+        for block in ira.getby_offset(self.address):
+            if block.label.offset is not None:
+                # Only one block non-generated
+                assert cur_block is None
+                cur_block = block
+        assert cur_block is not None
         line_nb = None
         for line_nb, assignblk in enumerate(cur_block.irs):
             if assignblk.instr.offset == self.address: