summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2025-02-24 17:08:50 -0500
committerGlenn Smith <glenn@vector35.com>2025-03-05 16:39:59 -0500
commit9011177909529852181726329626234110099652 (patch)
treefdbd8ef3591182c45ccbaf00974bf7b7ef86c6ad /python/mediumlevelil.py
parent4501746424590380578222766731587320816671 (diff)
Python: Make copy_expr copy with location
Co-Authored-By: ltlly <a1253213025@163.com>
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 9a73e95f..d5b1c029 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -989,6 +989,10 @@ class MediumLevelILInstruction(BaseILInstruction):
return ExpressionIndex(self.instr.source_operand)
@property
+ def source_location(self) -> ILSourceLocation:
+ return ILSourceLocation.from_instruction(self)
+
+ @property
def core_operands(self) -> OperandsType:
return self.instr.operands
@@ -3554,7 +3558,16 @@ class MediumLevelILFunction:
:param MediumLevelILInstruction original: the original IL Instruction you want to copy
:return: The index of the newly copied expression
"""
- return self.expr(original.operation, original.raw_operands[0], original.raw_operands[1], original.raw_operands[2], original.raw_operands[3], original.raw_operands[4], original.size)
+ return self.expr(
+ original.operation,
+ original.raw_operands[0],
+ original.raw_operands[1],
+ original.raw_operands[2],
+ original.raw_operands[3],
+ original.raw_operands[4],
+ original.size,
+ original.source_location
+ )
def replace_expr(self, original: InstructionOrExpression, new: InstructionOrExpression) -> None:
"""