From ef04e9ae0483574531542223aed3eb1768a01db9 Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Thu, 30 Aug 2018 22:13:33 -0400 Subject: Fix signed constants in Python IL --- python/lowlevelil.py | 1 + python/mediumlevelil.py | 1 + 2 files changed, 2 insertions(+) (limited to 'python') 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] -- cgit v1.3.1