diff options
Diffstat (limited to 'python/mediumlevelil.py')
| -rw-r--r-- | python/mediumlevelil.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 3ee5fc99..86927b0a 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -450,6 +450,10 @@ class MediumLevelILInstruction(ILInstruction): return result @property + def instruction_operands(self) -> List['MediumLevelILInstruction']: + return [i for i in self.operands if isinstance(i, MediumLevelILInstruction)] + + @property def operands(self) -> List[MediumLevelILOperandType]: """Operands for the instruction""" return [] @@ -471,6 +475,14 @@ class MediumLevelILInstruction(ILInstruction): return result @property + def vars_address_taken(self) -> List[Union[variable.Variable, SSAVariable]]: + """Non-unique list of variables whose address is taken by instruction""" + result = [] + for operand in self.instruction_operands: + result.extend(operand.vars_address_taken) + return result + + @property def expr_type(self) -> Optional['types.Type']: """Type of expression""" result = core.BNGetMediumLevelILExprType(self.function.handle, self.expr_index) @@ -909,6 +921,10 @@ class MediumLevelILAddress_of(MediumLevelILInstruction): def operands(self) -> List[variable.Variable]: return [self.src] + @property + def vars_address_taken(self) -> List[variable.Variable]: + return [self.src] + @dataclass(frozen=True, repr=False) class MediumLevelILConst(MediumLevelILConstBase): |
