summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2020-08-13 13:37:21 -0400
committerPeter LaFosse <peter@vector35.com>2020-08-13 13:37:21 -0400
commit165c1052c72895a73440cbead9eb8842f5921b81 (patch)
tree0db60bef8aae4c9544998e46b6e019ecf6feafd2 /python/binaryview.py
parentd3349f3f14d6e32dc1c1e21a05f3bd0d045c6b4d (diff)
Add BV level generators for hlil instructions and basic blocks
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index da51062d..c778f211 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -1583,6 +1583,13 @@ class BinaryView(object):
yield il_block
@property
+ def hlil_basic_blocks(self):
+ """A generator of all HighLevelILBasicBlock objects in the BinaryView"""
+ for func in self:
+ for il_block in func.hlil.basic_blocks:
+ yield il_block
+
+ @property
def instructions(self):
"""A generator of instruction tokens and their start addresses"""
for block in self.basic_blocks:
@@ -1606,6 +1613,13 @@ class BinaryView(object):
yield i
@property
+ def hlil_instructions(self):
+ """A generator of mlil instructions"""
+ for block in self.hlil_basic_blocks:
+ for i in block:
+ yield i
+
+ @property
def parent_view(self):
"""View that contains the raw data used by this view (read-only)"""
result = core.BNGetParentView(self.handle)