diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-17 14:18:16 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-17 14:18:16 +0100 |
| commit | a49419dd5e16283b1663181a47cdc85b7eff14dc (patch) | |
| tree | eed2791c9c96039c6603d0173646eb4265a85366 /miasm2/ir | |
| parent | c0826fefbbcd00c60f0e9f27dcac92c98fcb9d8e (diff) | |
| parent | bf4c21011c8396b939e147615d12998a11c91dcd (diff) | |
| download | miasm-a49419dd5e16283b1663181a47cdc85b7eff14dc.tar.gz miasm-a49419dd5e16283b1663181a47cdc85b7eff14dc.zip | |
Merge pull request #277 from commial/fix-x86-xchg
Fix x86 xchg
Diffstat (limited to 'miasm2/ir')
| -rw-r--r-- | miasm2/ir/symbexec.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/miasm2/ir/symbexec.py b/miasm2/ir/symbexec.py index f51baf9f..9ac79b1f 100644 --- a/miasm2/ir/symbexec.py +++ b/miasm2/ir/symbexec.py @@ -384,10 +384,7 @@ class symbexec(object): # test if mem lookup is known tmp = m2_expr.ExprMem(a, e.dst.size) dst = tmp - if self.func_write and isinstance(dst.arg, m2_expr.ExprInt): - self.func_write(self, dst, src, pool_out) - else: - pool_out[dst] = src + pool_out[dst] = src elif isinstance(e.dst, m2_expr.ExprId): pool_out[e.dst] = src @@ -398,7 +395,6 @@ class symbexec(object): def eval_ir(self, ir): mem_dst = [] - # src_dst = [(x.src, x.dst) for x in ir] src_dst = self.eval_ir_expr(ir) eval_cache = dict(self.symbols.items()) for dst, src in src_dst: @@ -411,10 +407,11 @@ class symbexec(object): new_val.is_term = True self.symbols[new_mem] = new_val src_o = self.expr_simp(src) - # print 'SRCo', src_o - # src_o.is_term = True self.symbols[dst] = src_o if isinstance(dst, m2_expr.ExprMem): + if self.func_write and isinstance(dst.arg, m2_expr.ExprInt): + self.func_write(self, dst, src_o) + del self.symbols[dst] mem_dst.append(dst) return mem_dst |