From bd6e1976b379527f3327fafe5e18805b180eb742 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 7 Sep 2014 20:22:33 +0200 Subject: [PATCH] ntoskrnl.exe: Emulate some more mov eax -> drX. --- dlls/ntoskrnl.exe/instr.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c index dd33085b9d1..85ab9eb170b 100644 --- a/dlls/ntoskrnl.exe/instr.c +++ b/dlls/ntoskrnl.exe/instr.c @@ -366,18 +366,34 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context ) context->Eip += prefixlen+3; return ExceptionContinueExecution; } - ERR("Unsupported DR register, eip+2 is %02x\n", instr[2]); + ERR("Unsupported DR register -> EAX, eip+2 is %02x\n", instr[2]); /* fallthrough to illegal instruction */ break; case 0x23: /* mov eax drX */ switch (instr[2]) { + case 0xc0: /* mov eax, dr0 */ + context->Dr0 = context->Eax; + context->Eip += prefixlen+3; + return ExceptionContinueExecution; case 0xc8: /* mov eax, dr1 */ context->Dr1 = context->Eax; context->Eip += prefixlen+3; return ExceptionContinueExecution; + case 0xd0: /* mov eax, dr2 */ + context->Dr2 = context->Eax; + context->Eip += prefixlen+3; + return ExceptionContinueExecution; + case 0xd8: /* mov eax, dr3 */ + context->Dr3 = context->Eax; + context->Eip += prefixlen+3; + return ExceptionContinueExecution; + case 0xf8: /* mov eax, dr7 */ + context->Dr7 = context->Eax; + context->Eip += prefixlen+3; + return ExceptionContinueExecution; } - ERR("Unsupported DR register, eip+2 is %02x\n", instr[2]); + ERR("Unsupported EAX -> DR register, eip+2 is %02x\n", instr[2]); /* fallthrough to illegal instruction */ break; } -- 2.11.4.GIT