summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-07-13 19:09:58 -0400
committerMason Reed <mason@vector35.com>2025-07-15 12:34:43 -0400
commit41213e0c959b4b11e3059b60ec5248b31024d236 (patch)
treed47fd4caee967233f2f9ae3b5403aba333de29a6 /python
parentbd1b6b8a1a75df296da5c7afa8107ba301c9cd8e (diff)
Expose analysis' system call type and name retrieval
Previously we only really had a way to access the platform system call information, this was missing the system call information found in type libraries Fixes https://github.com/Vector35/binaryninja-api/issues/7089
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index f8eaa088..918fff0e 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -8293,6 +8293,26 @@ class BinaryView:
_new_name = _types.QualifiedName(new_name)._to_core_struct()
core.BNRenameAnalysisType(self.handle, _old_name, _new_name)
+ def get_system_call_type(self, id: int, platform: Optional['_platform.Platform'] = None) -> Optional['_types.Type']:
+ if platform is None:
+ platform = self.platform
+ if platform is None:
+ raise Exception("Unable to retrieve system call type without a platform")
+ handle = core.BNGetAnalysisSystemCallType(self.handle, platform.handle, id)
+ if handle is None:
+ return None
+ return _types.Type.create(handle, platform=platform)
+
+ def get_system_call_name(self, id: int, platform: Optional['_platform.Platform'] = None) -> Optional[str]:
+ if platform is None:
+ platform = self.platform
+ if platform is None:
+ raise Exception("Unable to retrieve system call type without a platform")
+ result = core.BNGetAnalysisSystemCallName(self.handle, platform.handle, id)
+ if result is None:
+ return None
+ return result
+
def import_library_type(self, name: str, lib: Optional[typelibrary.TypeLibrary] = None) -> Optional['_types.Type']:
"""
``import_library_type`` recursively imports a type from the specified type library, or, if