diff options
| author | Mason Reed <mason@vector35.com> | 2024-10-25 12:09:57 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2024-10-25 12:10:35 -0400 |
| commit | 3452ee25b9aebdddf694f45b4273ab76ca1bc847 (patch) | |
| tree | f080a5262f3156439d87b9f7981902975804645a /python | |
| parent | f97c60b5f77c4b9b668ff0b5fd292b41521c72fd (diff) | |
Retrieve view from analysis context
Makes it possible to write module workflows in plugins and scripts
Diffstat (limited to 'python')
| -rw-r--r-- | python/workflow.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/python/workflow.py b/python/workflow.py index 98e3118b..7989d6bd 100644 --- a/python/workflow.py +++ b/python/workflow.py @@ -31,6 +31,7 @@ from .log import log_error from . import _binaryninjacore as core from .flowgraph import FlowGraph, CoreFlowGraph +from . import binaryview from . import function as _function from . import lowlevelil from . import mediumlevelil @@ -49,6 +50,16 @@ class AnalysisContext: self.handle = handle @property + def view(self) -> 'binaryview.BinaryView': + """ + BinaryView for the current AnalysisContext (writable) + """ + result = core.BNAnalysisContextGetBinaryView(self.handle) + if not result: + return None + return binaryview.BinaryView(handle=result) + + @property def function(self) -> '_function.Function': """ Function for the current AnalysisContext (read-only) |
