summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py11
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)