summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2022-06-23 13:57:56 -0400
committerPeter LaFosse <peter@vector35.com>2022-07-03 08:10:29 -0400
commitce335c283f87297855bd9360e7063f3b8ef34afc (patch)
tree7c7849153875187251d1dee02350fd2ab0b4c150 /python/binaryview.py
parent449595e320957a25e136605e04792d4f1237e7ac (diff)
Add some helper routines for getting the IL of callsites
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index c28e225a..fbbba6f9 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -105,6 +105,25 @@ class ReferenceSource:
return ReferenceSource(func, arch, ref.addr)
+ @property
+ def llil(self) -> Optional[lowlevelil.LowLevelILInstruction]:
+ """Returns the low level il instruction at the current location if one exists"""
+ if self.function is None or self.arch is None:
+ return None
+ return self.function.get_low_level_il_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 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
+
class BinaryDataNotification:
def __init__(self):