diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2014-09-19 10:43:32 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2014-09-19 10:43:32 +0200 |
| commit | 3674bace8dbc185aefca1b4fa85983adfe73956b (patch) | |
| tree | 3868dca81348cc0ef76b024d2d151293e9a911d9 /miasm2/arch/x86/sem.py | |
| parent | 3f11ce8a64d4dcc37587c4750ae5381a808695ef (diff) | |
| download | miasm-3674bace8dbc185aefca1b4fa85983adfe73956b.tar.gz miasm-3674bace8dbc185aefca1b4fa85983adfe73956b.zip | |
merge
Diffstat (limited to 'miasm2/arch/x86/sem.py')
| -rw-r--r-- | miasm2/arch/x86/sem.py | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index c304def6..46302de3 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -1340,10 +1340,10 @@ def loop(ir, instr, dst): n = ExprId(ir.get_next_label(instr), instr.mode) c = myecx - ExprInt_from(myecx, 1) + dst_o = ExprCond(c, dst, n).zeroExtend(instr.mode) e.append(ExprAff(myecx, c)) - e.append(ExprAff(meip, ExprCond(c, dst, n).zeroExtend(instr.mode))) - e.append(ExprAff(ir.IRDst, ExprCond(myecx, dst, n).zeroExtend(instr.mode))) - #dst_o = ExprCond(myecx, dst, n).zeroExtend(instr.mode) + e.append(ExprAff(meip, dst_o)) + e.append(ExprAff(ir.IRDst, dst_o)) return e, [] @@ -1362,15 +1362,9 @@ def loopne(ir, instr, dst): c &= zf ^ ExprInt1(1) e.append(ExprAff(myecx, myecx - ExprInt_from(myecx, 1))) - e.append(ExprAff(meip, ExprCond(c, dst, n).zeroExtend(instr.mode))) - - # for dst, ecx has been modified! - c = ExprCond(mRCX[instr.mode][:s], - ExprInt1(1), - ExprInt1(0)) - c &= zf ^ ExprInt1(1) - #dst_o = ExprCond(c, dst, n).zeroExtend(instr.mode) - e.append(ExprAff(ir.IRDst, ExprCond(c, dst, n).zeroExtend(instr.mode))) + dst_o = ExprCond(c, dst, n).zeroExtend(instr.mode) + e.append(ExprAff(meip, dst_o)) + e.append(ExprAff(ir.IRDst, dst_o)) return e, [] @@ -1389,14 +1383,7 @@ def loope(ir, instr, dst): e.append(ExprAff(myecx, myecx - ExprInt_from(myecx, 1))) dst_o = ExprCond(c, dst, n).zeroExtend(instr.mode) e.append(ExprAff(meip, dst_o)) - - # for dst, ecx has been modified! - c = ExprCond(mRCX[instr.mode][:s], - ExprInt1(1), - ExprInt1(0)) - c &= zf - #dst_o = ExprCond(c, dst, n).zeroExtend(instr.mode) - e.append(ExprAff(ir.IRDst, ExprCond(c, dst, n).zeroExtend(instr.mode))) + e.append(ExprAff(ir.IRDst, dst_o)) return e, [] |