diff options
| -rw-r--r-- | miasm/arch/x86/arch.py | 7 | ||||
| -rw-r--r-- | miasm/core/cpu.py | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/miasm/arch/x86/arch.py b/miasm/arch/x86/arch.py index d1802045..127dded4 100644 --- a/miasm/arch/x86/arch.py +++ b/miasm/arch/x86/arch.py @@ -481,7 +481,7 @@ class instruction_x86(instruction): expr = self.args[0] if not expr.is_int(): return - addr = expr.arg + int(self.offset) + addr = (int(expr) + int(self.offset)) & int(expr.mask) loc_key = loc_db.get_or_create_offset_location(addr) self.args[0] = ExprLoc(loc_key, expr.size) @@ -1913,7 +1913,10 @@ def modrm2expr(modrm, parent, w8, sx=0, xmm=0, mm=0, bnd=0): if parent.disp.value is None: return None o.append(ExprInt(int(parent.disp.expr), admode)) - expr = ExprOp('+', *o) + if len(o) == 1: + expr = o[0] + else: + expr = ExprOp('+', *o) if w8 == 0: opmode = 8 elif sx == 1: diff --git a/miasm/core/cpu.py b/miasm/core/cpu.py index ec8d95bc..aee22c97 100644 --- a/miasm/core/cpu.py +++ b/miasm/core/cpu.py @@ -1589,6 +1589,9 @@ class imm_noarg(object): assert(m2_expr.is_expr(e)) self.expr = e + if self.expr is None: + log.debug('cannot fromstring int %r', text) + return None, None return start, stop def decodeval(self, v): |