From 1885f43bf55c9091737290deee7ecc618bc2b655 Mon Sep 17 00:00:00 2001 From: Boris Batteux Date: Thu, 18 Feb 2021 15:23:48 +0100 Subject: [PATCH] Allow to specify the size of the mop operand manually --- d810/hexrays_helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/d810/hexrays_helpers.py b/d810/hexrays_helpers.py index d8192f9..50307e3 100644 --- a/d810/hexrays_helpers.py +++ b/d810/hexrays_helpers.py @@ -135,12 +135,14 @@ MSB_TABLE = {1: 0x80, 2: 0x8000, 4: 0x80000000, 8: 0x8000000000000000} # Hex-Rays mop equality checking -def equal_bnot_cst(lo: mop_t, ro: mop_t) -> bool: +def equal_bnot_cst(lo: mop_t, ro: mop_t, mop_size=None) -> bool: if (lo.t != mop_n) or (ro.t != mop_n): return False if lo.size != ro.size: return False - return lo.nnn.value ^ ro.nnn.value == AND_TABLE[lo.size] + if mop_size is None: + mop_size = lo.size + return lo.nnn.value ^ ro.nnn.value == AND_TABLE[mop_size] def equal_bnot_mop(lo: mop_t, ro: mop_t, test_two_sides=True) -> bool: