diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-09 14:48:06 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-09 14:48:06 +0100 |
| commit | ea2b165ae2b31d05dfac69bc723bb4625d434a82 (patch) | |
| tree | b65bf086d11dfd9ce4790841e11d9eadcf511d97 | |
| parent | 82009afe2e94a4e9a6ac6200969936cb3285ec63 (diff) | |
| parent | f30ee5a3275e0e8665d017ab4e302e412d01a8c9 (diff) | |
| download | miasm-ea2b165ae2b31d05dfac69bc723bb4625d434a82.tar.gz miasm-ea2b165ae2b31d05dfac69bc723bb4625d434a82.zip | |
Merge pull request #260 from commial/fix-rdtsc
x86/Sem/RDTSC: update tsc2 value on tsc1 overflow
| -rw-r--r-- | miasm2/arch/x86/sem.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py index 1a4d7168..1dd5bc67 100644 --- a/miasm2/arch/x86/sem.py +++ b/miasm2/arch/x86/sem.py @@ -2495,6 +2495,9 @@ def hlt(ir, instr): def rdtsc(ir, instr): e = [] e.append(m2_expr.ExprAff(tsc1, tsc1 + m2_expr.ExprInt32(1))) + e.append(m2_expr.ExprAff(tsc2, tsc2 + ExprCond(tsc1 - tsc1.mask, + ExprInt32(0), + ExprInt32(1)))) e.append(m2_expr.ExprAff(mRAX[32], tsc1)) e.append(m2_expr.ExprAff(mRDX[32], tsc2)) return e, [] |