diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2019-07-01 22:02:05 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2019-07-01 22:02:05 -0400 |
| commit | c9faafcc0c0b0beeb6cde0ee1359b3e3f27b05a0 (patch) | |
| tree | 10b96f481e41c510ea1cfd81df6333e8f57ade52 /python/mediumlevelil.py | |
| parent | ef6cddbcef4184d1d41f80ac16c56c173e5d38f6 (diff) | |
add contains for LLIL and MLIL basic blocks
Diffstat (limited to 'python/mediumlevelil.py')
| -rw-r--r-- | python/mediumlevelil.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 624f77a2..8d9768ec 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -1167,6 +1167,14 @@ class MediumLevelILBasicBlock(basicblock.BasicBlock): def __hash__(self): return hash((self.start, self.end, self.il_function)) + def __contains__(self, instruction): + if type(instruction) != MediumLevelILInstruction or instruction.il_basic_block != self: + return False + if instruction.instr_index >= self.start and instruction.instr_index <= self.end: + return True + else: + return False + @property def il_function(self): """ """ |
