summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2025-05-06 16:47:15 -0400
committerGlenn Smith <glenn@vector35.com>2025-06-11 17:37:26 -0400
commit6091002460609793463078951047220893747923 (patch)
tree4378eb62ee87b27365b44813413b2c2d839e445b /python
parent3a1a81c3ddd8340432ecd2687d3a25195cc97d40 (diff)
Expose AnalysisContext::GetLiftedILFunction properly
It was already grabbing the Lifted IL through the function object, which may not be the most up to date
Diffstat (limited to 'python')
-rw-r--r--python/workflow.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/python/workflow.py b/python/workflow.py
index ba20591f..c63c20b9 100644
--- a/python/workflow.py
+++ b/python/workflow.py
@@ -53,7 +53,7 @@ class AnalysisContext:
self.handle = handle
@property
- def view(self) -> 'binaryview.BinaryView':
+ def view(self) -> Optional['binaryview.BinaryView']:
"""
BinaryView for the current AnalysisContext (writable)
"""
@@ -63,7 +63,7 @@ class AnalysisContext:
return binaryview.BinaryView(handle=result)
@property
- def function(self) -> '_function.Function':
+ def function(self) -> Optional['_function.Function']:
"""
Function for the current AnalysisContext (read-only)
"""
@@ -73,18 +73,21 @@ class AnalysisContext:
return _function.Function(handle=result)
@property
- def lifted_il(self) -> lowlevelil.LowLevelILFunction:
+ def lifted_il(self) -> Optional[lowlevelil.LowLevelILFunction]:
"""
LowLevelILFunction used to represent lifted IL (writable)
"""
- return self.function.lifted_il
+ result = core.BNAnalysisContextGetLiftedILFunction(self.handle)
+ if not result:
+ return None
+ return lowlevelil.LowLevelILFunction(handle=result)
@lifted_il.setter
def lifted_il(self, lifted_il: lowlevelil.LowLevelILFunction) -> None:
core.BNSetLiftedILFunction(self.handle, lifted_il.handle)
@property
- def llil(self) -> lowlevelil.LowLevelILFunction:
+ def llil(self) -> Optional[lowlevelil.LowLevelILFunction]:
"""
LowLevelILFunction used to represent Low Level IL (writable)
"""
@@ -98,7 +101,7 @@ class AnalysisContext:
core.BNSetLowLevelILFunction(self.handle, value.handle)
@property
- def mlil(self) -> mediumlevelil.MediumLevelILFunction:
+ def mlil(self) -> Optional[mediumlevelil.MediumLevelILFunction]:
"""
MediumLevelILFunction used to represent Medium Level IL (writable)
"""
@@ -112,7 +115,7 @@ class AnalysisContext:
core.BNSetMediumLevelILFunction(self.handle, value.handle)
@property
- def hlil(self) -> highlevelil.HighLevelILFunction:
+ def hlil(self) -> Optional[highlevelil.HighLevelILFunction]:
"""
HighLevelILFunction used to represent High Level IL (writable)
"""