From d5d4fd71b9b8972b2cc391411e6a8c2b1fe75392 Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Tue, 22 Jul 2025 10:10:59 -0400 Subject: Update define_auto_symbol_and_var_or_function API to pass confidence type. --- python/binaryview.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/binaryview.py b/python/binaryview.py index bb220b3a..3805807a 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -6416,7 +6416,7 @@ class BinaryView: core.BNDefineAutoSymbol(self.handle, sym.handle) def define_auto_symbol_and_var_or_function( - self, sym: '_types.CoreSymbol', type: '_types.Type', plat: Optional['_platform.Platform'] = None + self, sym: '_types.CoreSymbol', type: Optional['_types.Type'] = None, plat: Optional['_platform.Platform'] = None, type_confidence: Optional[int] = 0 ) -> Optional['_types.CoreSymbol']: """ ``define_auto_symbol_and_var_or_function`` Defines an "Auto" symbol, and a Variable/Function alongside it. @@ -6426,6 +6426,7 @@ class BinaryView: :param sym: Symbol to define :param type: Type for the function/variable being defined (can be None) :param plat: Platform (optional) + :param type_confidence: Optional confidence value for the type :rtype: Optional[CoreSymbol] """ if plat is None: @@ -6435,12 +6436,16 @@ class BinaryView: elif not isinstance(plat, _platform.Platform): raise ValueError("Provided platform is not of type `Platform`") + tc = core.BNTypeWithConfidence() + tc.type = None + tc.confidence = 0 if isinstance(type, _types.Type): - type = type.handle + tc.type = type.handle + tc.confidence = type_confidence elif type is not None: raise ValueError("Provided type is not of type `binaryninja.Type`") - _sym = core.BNDefineAutoSymbolAndVariableOrFunction(self.handle, plat.handle, sym.handle, type) + _sym = core.BNDefineAutoSymbolAndVariableOrFunction(self.handle, plat.handle, sym.handle, tc) if _sym is None: return None return _types.CoreSymbol(_sym) -- cgit v1.3.1