diff options
| author | Brian Potchik <brian@vector35.com> | 2025-07-22 10:10:59 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2025-07-22 10:17:46 -0400 |
| commit | d5d4fd71b9b8972b2cc391411e6a8c2b1fe75392 (patch) | |
| tree | 4c8ef4268df974266a53e3a2f19a1af24f51e061 /python/binaryview.py | |
| parent | b9c9048625e6b949c2269815838ba80f5074c499 (diff) | |
Update define_auto_symbol_and_var_or_function API to pass confidence type.
Diffstat (limited to 'python/binaryview.py')
| -rw-r--r-- | python/binaryview.py | 11 |
1 files changed, 8 insertions, 3 deletions
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) |
