diff options
| author | serpilliere <fabrice.desclaux@cea.fr> | 2015-10-19 21:27:42 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-10-23 10:53:51 +0200 |
| commit | 0dcb6c4c6a7cb0297a056375f4a2a4cd13c616e2 (patch) | |
| tree | 2f82526b783c88249f33327c766ac552ec9287c9 /miasm2/arch/x86/sem.py | |
| parent | 48aa21f8adc4130750bc6b8f5da19fbe8b2cca64 (diff) | |
| download | miasm-0dcb6c4c6a7cb0297a056375f4a2a4cd13c616e2.tar.gz miasm-0dcb6c4c6a7cb0297a056375f4a2a4cd13c616e2.zip | |
Arch/x86/sem: fix p[or/and/xor]
Diffstat (limited to '')
| -rw-r--r-- | miasm2/arch/x86/sem.py | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 2e7eac6b..8e85e635 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -293,10 +293,6 @@ def xor(ir, instr, a, b): def pxor(ir, instr, a, b): e = [] - if isinstance(a, m2_expr.ExprMem): - a = m2_expr.ExprMem(a.arg, b.size) - if isinstance(b, m2_expr.ExprMem): - b = m2_expr.ExprMem(b.arg, a.size) c = a ^ b e.append(m2_expr.ExprAff(a, c)) return e, [] @@ -3233,13 +3229,24 @@ def movapd(ir, instr, a, b): return [m2_expr.ExprAff(a, b)], [] +def andps(ir, instr, a, b): + e = [] + e.append(m2_expr.ExprAff(a, m2_expr.ExprOp('&', a, b))) + return e, [] + + +def orps(ir, instr, a, b): + e = [] + e.append(m2_expr.ExprAff(a, m2_expr.ExprOp('|', a, b))) + return e, [] + + def xorps(ir, instr, a, b): e = [] - if isinstance(b, m2_expr.ExprMem): - b = m2_expr.ExprMem(b.arg, a.size) e.append(m2_expr.ExprAff(a, m2_expr.ExprOp('^', a, b))) return e, [] + def rdmsr(ir, instr): msr_addr = m2_expr.ExprId('MSR') + m2_expr.ExprInt32(8) * mRCX[instr.mode][:32] e = [] @@ -3375,12 +3382,11 @@ def pand(ir, instr, a, b): e.append(m2_expr.ExprAff(a, c)) return e, [] + +def por(ir, instr, a, b): e = [] - if isinstance(a, m2_expr.ExprMem): - a = m2_expr.ExprMem(a.arg, b.size) - if isinstance(b, m2_expr.ExprMem): - b = m2_expr.ExprMem(b.arg, a.size) - e.append(m2_expr.ExprAff(a, b)) + c = a | b + e.append(m2_expr.ExprAff(a, c)) return e, [] @@ -3836,6 +3842,10 @@ mnemo_func = {'mov': mov, "movupd": movapd, # XXX TODO alignement check "movaps": movapd, # XXX TODO alignement check "movups": movapd, # XXX TODO alignement check + "andps": andps, + "andpd": andps, + "orps": orps, + "orpd": orps, "xorps": xorps, "xorpd": xorps, @@ -3930,6 +3940,7 @@ mnemo_func = {'mov': mov, ### "pand": pand, + "por": por, "rdmsr": rdmsr, "wrmsr": wrmsr, |