about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2018-08-07 23:04:17 +0200
committerGitHub <noreply@github.com>2018-08-07 23:04:17 +0200
commit2c6f5240455e1d198bcead7d292e7270b19a12ad (patch)
treeaf90a633baf47edd42379b96266f038dd98a7f1c
parente38b5dd91d10ad66d537675e4592f68eda9fcce2 (diff)
parent2b0f00d86ffd5a4423bdf39a41e324cdc42d6f1b (diff)
downloadmiasm-2c6f5240455e1d198bcead7d292e7270b19a12ad.tar.gz
miasm-2c6f5240455e1d198bcead7d292e7270b19a12ad.zip
Merge pull request #819 from commial/fix/symbexec
Fix/symbexec
Diffstat (limited to '')
-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():