From 57a3ea491d2d819ab5415d8d7bdf7e9e505808fc Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Sat, 25 Feb 2017 00:25:36 -0500 Subject: Add APIs to access SSA-based data flow --- python/lowlevelil.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'python') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 564fef34..6c664cb4 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -1386,6 +1386,28 @@ class LowLevelILFunction(object): core.BNFreeLowLevelILInstructionList(instrs) return result + def get_ssa_reg_value(self, reg, index): + if isinstance(reg, str): + reg = self.arch.regs[reg].index + value = core.BNGetLowLevelILSSARegisterValue(self.handle, reg, index) + result = function.RegisterValue(self.arch, value) + core.BNFreeRegisterValue(value) + return result + + def get_ssa_flag_value(self, flag, index): + if isinstance(flag, str): + flag = self.arch.get_flag_by_name(flag) + value = core.BNGetLowLevelILSSAFlagValue(self.handle, flag, index) + result = function.RegisterValue(self.arch, value) + core.BNFreeRegisterValue(value) + return result + + def get_ssa_stack_contents(self, memory_index, offset, size): + value = core.BNGetLowLevelILSSAStackContents(self.handle, memory_index, offset, size) + result = function.RegisterValue(self.arch, value) + core.BNFreeRegisterValue(value) + return result + class LowLevelILBasicBlock(basicblock.BasicBlock): def __init__(self, view, handle, owner): -- cgit v1.3.1