From 41213e0c959b4b11e3059b60ec5248b31024d236 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 13 Jul 2025 19:09:58 -0400 Subject: 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 --- python/binaryview.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'python/binaryview.py') 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 -- cgit v1.3.1