summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/lowlevelil.py1
-rw-r--r--python/mediumlevelil.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index 41579719..ec7c37fd 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -365,6 +365,7 @@ class LowLevelILInstruction(object):
name, operand_type = operand
if operand_type == "int":
value = instr.operands[i]
+ value = (value & ((1 << 63) - 1)) - (value & (1 << 63))
elif operand_type == "float":
if instr.size == 4:
value = struct.unpack("f", struct.pack("I", instr.operands[i] & 0xffffffff))[0]
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index c7b21aa9..d8347ebf 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -230,6 +230,7 @@ class MediumLevelILInstruction(object):
name, operand_type = operand
if operand_type == "int":
value = instr.operands[i]
+ value = (value & ((1 << 63) - 1)) - (value & (1 << 63))
elif operand_type == "float":
if instr.size == 4:
value = struct.unpack("f", struct.pack("I", instr.operands[i] & 0xffffffff))[0]