summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/lowlevelil.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index efa92a7a..9435fd5c 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -939,6 +939,19 @@ class LowLevelILFunction(object):
flags = 0
return LowLevelILExpr(core.BNLowLevelILAddExpr(self.handle, operation, size, flags, a, b, c, d))
+ def replace_expr(self, original, new):
+ if isinstance(original, LowLevelILInstruction):
+ original = original.expr_index
+ elif isinstance(original, LowLevelILExpr):
+ original = original.index
+
+ if isinstance(new, LowLevelILInstruction):
+ new = new.expr_index
+ elif isinstance(new, LowLevelILExpr):
+ new = new.index
+
+ core.BNReplaceLowLevelILExpr(self.handle, original, new)
+
def append(self, expr):
"""
``append`` adds the LowLevelILExpr ``expr`` to the current LowLevelILFunction.