From e9a35074bb068e4d71d0f60c520128b245edac48 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 22 Sep 2021 11:30:45 -0400 Subject: Add __contains__ for Function, Section, Segment, BasicBlock and BinaryView Addresses issue binaryninja-api#1113 --- python/basicblock.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python/basicblock.py') diff --git a/python/basicblock.py b/python/basicblock.py index 623cc3ed..872e44b8 100644 --- a/python/basicblock.py +++ b/python/basicblock.py @@ -129,6 +129,9 @@ class BasicBlock: data = self.view.read(start, length) return self.arch.get_instruction_text(data, start) + def __contains__(self, i:int): + return i >= self.start and i < self.end + def _buildStartCache(self) -> None: if self._instStarts is None: # build the instruction start cache -- cgit v1.3.1