MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / AnalysisContext

Class AnalysisContext

python/workflow.py:43–140  ·  view source on GitHub ↗

:class:`AnalysisContext` is a proxy object that provides access to the current analysis context, including the associated :class:`BinaryView`, :class:`Function`, and intermediate language (IL) representations. It provides APIs to retrieve and modify the in-progress analysis state and allows use

Source from the content-addressed store, hash-verified

41
42
43class AnalysisContext:
44 """
45 :class:`AnalysisContext` is a proxy object that provides access to the current analysis context,
46 including the associated :class:`BinaryView`, :class:`Function`, and intermediate language (IL)
47 representations. It provides APIs to retrieve and modify the in-progress analysis state and allows
48 users to notify the analysis system of any changes or updates.
49 """
50
51 def __init__(self, handle: core.BNAnalysisContextHandle):
52 assert handle is not None
53 self.handle = handle
54
55 @property
56 def view(self) -> 'binaryview.BinaryView':
57 """
58 BinaryView for the current AnalysisContext (writable)
59 """
60 result = core.BNAnalysisContextGetBinaryView(self.handle)
61 if not result:
62 return None
63 return binaryview.BinaryView(handle=result)
64
65 @property
66 def function(self) -> '_function.Function':
67 """
68 Function for the current AnalysisContext (read-only)
69 """
70 result = core.BNAnalysisContextGetFunction(self.handle)
71 if not result:
72 return None
73 return _function.Function(handle=result)
74
75 @property
76 def lifted_il(self) -> lowlevelil.LowLevelILFunction:
77 """
78 LowLevelILFunction used to represent lifted IL (writable)
79 """
80 return self.function.lifted_il
81
82 @lifted_il.setter
83 def lifted_il(self, lifted_il: lowlevelil.LowLevelILFunction) -> None:
84 core.BNSetLiftedILFunction(self.handle, lifted_il.handle)
85
86 @property
87 def llil(self) -> lowlevelil.LowLevelILFunction:
88 """
89 LowLevelILFunction used to represent Low Level IL (writable)
90 """
91 result = core.BNAnalysisContextGetLowLevelILFunction(self.handle)
92 if not result:
93 return None
94 return lowlevelil.LowLevelILFunction(handle=result)
95
96 @llil.setter
97 def llil(self, value: lowlevelil.LowLevelILFunction) -> None:
98 core.BNSetLowLevelILFunction(self.handle, value.handle)
99
100 @property

Callers 1

_actionMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected