diff options
| author | Ryan Snyder <ryan@vector35.com> | 2019-03-11 21:01:47 -0400 |
|---|---|---|
| committer | Ryan Snyder <ryan@vector35.com> | 2019-03-12 12:44:29 -0400 |
| commit | 902750648579d32cc83fbd91181ecea2c9e0c9e5 (patch) | |
| tree | f8ef77532522fd8a47d64d249bff0322522bd757 /python | |
| parent | 1188d02f0f5aed4a681eeb68c0e33803d5c06155 (diff) | |
api: update to support getting source blocks from IL blocks
Diffstat (limited to 'python')
| -rw-r--r-- | python/basicblock.py | 8 | ||||
| -rw-r--r-- | python/lowlevelil.py | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/python/basicblock.py b/python/basicblock.py index 849d529f..661eefd5 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -176,6 +176,14 @@ class BasicBlock(object): return self._arch @property + def source_block(self): + """Basic block source block (read-only)""" + block = core.BNGetBasicBlockSource(self.handle) + if block is None: + return None + return BasicBlock(block, self._view) + + @property def start(self): """Basic block start (read-only)""" return core.BNGetBasicBlockStart(self.handle) diff --git a/python/lowlevelil.py b/python/lowlevelil.py index a88182a7..430e5934 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -780,6 +780,9 @@ class LowLevelILFunction(object): arch = self.arch core.BNLowLevelILSetCurrentAddress(self.handle, arch.handle, value) + def set_current_source_block(self, block): + core.BNLowLevelILSetCurrentSourceBlock(self.handle, block.handle) + @property def temp_reg_count(self): """Number of temporary registers (read-only)""" |
