about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--miasm2/ir/symbexec.py2
-rw-r--r--miasm2/jitter/emulatedsymbexec.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/miasm2/ir/symbexec.py b/miasm2/ir/symbexec.py
index 1a077de5..433db049 100644
--- a/miasm2/ir/symbexec.py
+++ b/miasm2/ir/symbexec.py
@@ -198,7 +198,7 @@ class MemArray(MutableMapping):
             ptr = base
         else:
             ptr = base + ExprInt(offset, base.size)
-        return ptr
+        return ptr.canonize()
 
     def read(self, offset, size):
         """
diff --git a/miasm2/jitter/emulatedsymbexec.py b/miasm2/jitter/emulatedsymbexec.py
index 42f96aa2..358e0897 100644
--- a/miasm2/jitter/emulatedsymbexec.py
+++ b/miasm2/jitter/emulatedsymbexec.py
@@ -41,7 +41,10 @@ class EmulatedSymbExec(SymbolicExecutionEngine):
         """Memory read wrapper for symbolic execution
         @expr_mem: ExprMem"""
 
-        addr = expr_mem.arg.arg.arg
+        addr = expr_mem.arg
+        if not addr.is_int():
+            return expr_mem
+        addr = int(addr)
         size = expr_mem.size / 8
         value = self.cpu.get_mem(addr, size)
         if self.vm.is_little_endian():