summaryrefslogtreecommitdiff
path: root/python/basicblock.py
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2021-08-04 10:48:57 -0400
committerBrian Potchik <brian@vector35.com>2021-08-04 10:48:57 -0400
commit754fb4d12a85cdf8c791725002c9a1e78894d8c0 (patch)
tree39524766019bc6a38e788fa14c68a5643b865e55 /python/basicblock.py
parent55e80204f6b8f804e81c54f2d5188a99ab0afb6f (diff)
Expose some BasicBlock APIs.
Diffstat (limited to 'python/basicblock.py')
-rw-r--r--python/basicblock.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/python/basicblock.py b/python/basicblock.py
index 4b1633a1..2394f25f 100644
--- a/python/basicblock.py
+++ b/python/basicblock.py
@@ -297,9 +297,14 @@ class BasicBlock(object):
@property
def can_exit(self):
- """Whether basic block can return or is tagged as 'No Return' (read-only)"""
+ """Whether basic block can return or is tagged as 'No Return'"""
return core.BNBasicBlockCanExit(self.handle)
+ @can_exit.setter
+ def can_exit(self, value):
+ """Sets whether basic block can return or is tagged as 'No Return'"""
+ BNBasicBlockSetCanExit(self.handle, value)
+
@property
def has_invalid_instructions(self):
"""Whether basic block has any invalid instructions (read-only)"""
@@ -526,3 +531,11 @@ class BasicBlock(object):
start = ctypes.c_uint64()
ret = core.BNGetBasicBlockInstructionContainingAddress(self.handle, addr, start)
return ret, start.value
+
+ @property
+ def source_block(self):
+ """Source of this basic block (read-only)"""
+ result = core.BNGetBasicBlockSourceBlock(self.handle)
+ if not result:
+ return None
+ return self._create_instance(result, self.view)