summaryrefslogtreecommitdiff
path: root/python/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/types.py')
-rw-r--r--python/types.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/python/types.py b/python/types.py
index 39378963..af62e5b4 100644
--- a/python/types.py
+++ b/python/types.py
@@ -19,6 +19,8 @@
# IN THE SOFTWARE.
from __future__ import absolute_import
+
+from binaryninja.log import log_warn
max_confidence = 255
import ctypes
@@ -1452,26 +1454,26 @@ class Structure(object):
tc.confidence = t.confidence
core.BNAddStructureBuilderMember(self._handle, tc, name)
- def insert(self, offset, t, name = ""):
+ def insert(self, offset, t, name = "", overwriteExisting = True):
if not self._mutable:
raise AttributeError("Finalized Structure object is immutable, use mutable_copy()")
tc = core.BNTypeWithConfidence()
tc.type = t.handle
tc.confidence = t.confidence
- core.BNAddStructureBuilderMemberAtOffset(self._handle, tc, name, offset)
+ core.BNAddStructureBuilderMemberAtOffset(self._handle, tc, name, offset, overwriteExisting)
def remove(self, i):
if not self._mutable:
raise AttributeError("Finalized Structure object is immutable, use mutable_copy()")
core.BNRemoveStructureBuilderMember(self._handle, i)
- def replace(self, i, t, name = ""):
+ def replace(self, i, t, name = "", overwriteExisting = True):
if not self._mutable:
raise AttributeError("Finalized Structure object is immutable, use mutable_copy()")
tc = core.BNTypeWithConfidence()
tc.type = t.handle
tc.confidence = t.confidence
- core.BNReplaceStructureBuilderMember(self._handle, i, tc, name)
+ core.BNReplaceStructureBuilderMember(self._handle, i, tc, name, overwriteExisting)
def mutable_copy(self):
if self._mutable: