summaryrefslogtreecommitdiff
path: root/python/lowlevelil.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-02-23 18:34:03 -0500
committerRusty Wagner <rusty@vector35.com>2017-02-23 18:34:03 -0500
commitdbe5606575f6b59b82eff2f9ab7b41990b57147e (patch)
treec940da5574655aaa9e792f0db256374eb17d7d32 /python/lowlevelil.py
parentc687ea8692ee553476280ee5b621e861b627fa80 (diff)
Instruction starts and SSA form are a property of IL functions
Diffstat (limited to 'python/lowlevelil.py')
-rw-r--r--python/lowlevelil.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 3ce55793..390e4210 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -314,7 +314,12 @@ class LowLevelILFunction(object):
@current_address.setter
def current_address(self, value):
- core.BNLowLevelILSetCurrentAddress(self.handle, value)
+ core.BNLowLevelILSetCurrentAddress(self.handle, self.arch.handle, value)
+
+ def set_current_address(self, value, arch = None):
+ if arch is None:
+ arch = self.arch
+ core.BNLowLevelILSetCurrentAddress(self.handle, arch.handle, value)
@property
def temp_reg_count(self):
@@ -340,6 +345,14 @@ class LowLevelILFunction(object):
core.BNFreeBasicBlockList(blocks, count.value)
return result
+ @property
+ def ssa_form(self):
+ """Low level IL in SSA form (read-only)"""
+ result = core.BNGetLowLevelILSSAForm(self.handle)
+ if not result:
+ return None
+ return LowLevelILFunction(self.arch, result, self.source_function)
+
def __setattr__(self, name, value):
try:
object.__setattr__(self, name, value)
@@ -373,6 +386,14 @@ class LowLevelILFunction(object):
finally:
core.BNFreeBasicBlockList(blocks, count.value)
+ def get_instruction_start(self, addr, arch = None):
+ if arch is None:
+ arch = self.arch
+ result = core.BNLowLevelILGetInstructionStart(self.handle, arch.handle, addr)
+ if result >= core.BNGetLowLevelILInstructionCount(self.handle):
+ return None
+ return result
+
def clear_indirect_branches(self):
core.BNLowLevelILClearIndirectBranches(self.handle)