summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/function.py8
-rw-r--r--python/lowlevelil.py7
2 files changed, 15 insertions, 0 deletions
diff --git a/python/function.py b/python/function.py
index e909ed0a..9a0f099a 100644
--- a/python/function.py
+++ b/python/function.py
@@ -567,6 +567,14 @@ class Function:
return BasicBlockList(self)
@property
+ def is_thunk(self) -> bool:
+ """Returns True if the function starts with a Tailcall (read-only)"""
+ if self.llil_if_available is not None:
+ return self.llil_if_available.is_thunk
+ else:
+ return False
+
+ @property
def comments(self) -> Dict[int, str]:
"""Dict of comments (read-only)"""
count = ctypes.c_ulonglong()
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 137a2d77..74b9e104 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -2877,6 +2877,13 @@ class LowLevelILFunction:
core.BNFreeLLILVariablesList(registers)
@property
+ def is_thunk(self) -> bool:
+ """Returns True if the function starts with a Tailcall (read-only)"""
+ if len(self.basic_blocks) == 1:
+ return isinstance(self.basic_blocks[0][-1], Tailcall)
+ return False
+
+ @property
def register_stacks(self) -> List[ILRegisterStack]:
""" List of register stacks used in this IL """
count = ctypes.c_ulonglong()