summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2020-05-28 09:49:16 -0400
committerPeter LaFosse <peter@vector35.com>2020-05-28 11:27:33 -0400
commit1f8ca3f77de08b5c581693153bf1ef580c912a0e (patch)
tree8a9c3d33c730513b1d16f7dbc15db73fd188b848 /python
parent95c8fa5b0cea3daa4dba774a2dab612c3d3fe39f (diff)
Add optional type to define as in Function::ApplyImportedTypes and BinaryView::DefineImportedFunction APIs
Diffstat (limited to 'python')
-rw-r--r--python/binaryview.py4
-rw-r--r--python/function.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 994d9edd..01da5517 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -3587,7 +3587,7 @@ class BinaryView(object):
"""
core.BNUndefineUserSymbol(self.handle, sym.handle)
- def define_imported_function(self, import_addr_sym, func):
+ def define_imported_function(self, import_addr_sym, func, type=None):
"""
``define_imported_function`` defines an imported Function ``func`` with a ImportedFunctionSymbol type.
@@ -3595,7 +3595,7 @@ class BinaryView(object):
:param Function func: A Function object to define as an imported function
:rtype: None
"""
- core.BNDefineImportedFunction(self.handle, import_addr_sym.handle, func.handle)
+ core.BNDefineImportedFunction(self.handle, import_addr_sym.handle, func.handle, None if type is None else type.handle)
def create_tag_type(self, name, icon):
"""
diff --git a/python/function.py b/python/function.py
index 76c8de0c..1c244ae4 100644
--- a/python/function.py
+++ b/python/function.py
@@ -1960,8 +1960,8 @@ class Function(object):
settings_obj = None
return binaryninja.flowgraph.CoreFlowGraph(core.BNCreateFunctionGraph(self.handle, graph_type, settings_obj))
- def apply_imported_types(self, sym):
- core.BNApplyImportedTypes(self.handle, sym.handle)
+ def apply_imported_types(self, sym, type=None):
+ core.BNApplyImportedTypes(self.handle, sym.handle, None if type is None else type.handle)
def apply_auto_discovered_type(self, func_type):
core.BNApplyAutoDiscoveredFunctionType(self.handle, func_type.handle)