diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-11-05 13:18:09 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-11-05 15:35:12 -0400 |
| commit | e7d9bb894f35b4f80d4f626d0f8348a800f3fe51 (patch) | |
| tree | e38639b595d7ba9fa2106b4b0bf674daba1db8f6 /python/mediumlevelil.py | |
| parent | b825e52d23eca180bbd2602643d4e2d9bc3b2e28 (diff) | |
Fix vars_written/vars_read/vars_address_taken
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): |
