From f3e2a872d8cbf45428e750cffb3b1d220b331d5f Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Wed, 9 Jul 2025 20:54:37 -0400 Subject: reimplement llil validation for caller_sites and implement plural IL forms on references --- python/binaryview.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index da2423ac..e2af96a1 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -125,18 +125,42 @@ class ReferenceSource: return None return self.function.get_low_level_il_at(self.address, self.arch) + @property + def llils(self) -> Iterator[lowlevelil.LowLevelILInstruction]: + """Returns the low level il instructions at the current location if any exists""" + if self.function is None or self.arch is None: + return + return self.function.get_low_level_ils_at(self.address, self.arch) + @property def mlil(self) -> Optional[mediumlevelil.MediumLevelILInstruction]: """Returns the medium level il instruction at the current location if one exists""" llil = self.llil return llil.mlil if llil is not None else None + @property + def mlils(self) -> Iterator[mediumlevelil.MediumLevelILInstruction]: + """Returns the medium level il instructions at the current location if any exists""" + if self.function is None or self.arch is None: + return + for llil in self.llils: + for mlil in llil.mlils: + yield mlil + @property def hlil(self) -> Optional[highlevelil.HighLevelILInstruction]: """Returns the high level il instruction at the current location if one exists""" mlil = self.mlil return mlil.hlil if mlil is not None else None + @property + def hlils(self) -> Iterator[highlevelil.HighLevelILInstruction]: + """Returns the high level il instructions at the current location if any exists""" + if self.function is None or self.arch is None: + return + for llil in self.llils: + for hlil in llil.hlils: + yield hlil class NotificationType(IntFlag): NotificationBarrier = 1 << 0 -- cgit v1.3.1