Sebastian Lackner : ntoskrnl: Add emulation for 'movzx {Eb, Ew}, Gv' instruction.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 19 07:19:14 CDT 2015


Module: wine
Branch: master
Commit: 9c789f2949faa14dc98df6a42b7e04b2af3e9ded
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9c789f2949faa14dc98df6a42b7e04b2af3e9ded

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Fri Jun 19 04:07:58 2015 +0200

ntoskrnl: Add emulation for 'movzx {Eb,Ew}, Gv' instruction.

---

 dlls/ntoskrnl.exe/instr.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/dlls/ntoskrnl.exe/instr.c b/dlls/ntoskrnl.exe/instr.c
index 7684b24..1306d5f 100644
--- a/dlls/ntoskrnl.exe/instr.c
+++ b/dlls/ntoskrnl.exe/instr.c
@@ -675,6 +675,30 @@ static DWORD emulate_instruction( EXCEPTION_RECORD *rec, CONTEXT *context )
 
     switch(*instr)
     {
+    case 0x0f: /* extended instruction */
+        switch(instr[1])
+        {
+        case 0xb6: /* movzx Eb, Gv */
+        case 0xb7: /* movzx Ew, Gv */
+        {
+            BYTE *data = INSTR_GetOperandAddr( context, instr + 2, long_addr,
+                                               rex, segprefix, &len );
+            unsigned int data_size = (instr[1] == 0xb7) ? 2 : 1;
+            unsigned int offset = data - user_shared_data;
+
+            if (offset <= sizeof(KSHARED_USER_DATA) - data_size)
+            {
+                ULONGLONG temp = 0;
+                memcpy( &temp, wine_user_shared_data + offset, data_size );
+                store_reg_word( context, instr[2], (BYTE *)&temp, long_op, rex );
+                context->Rip += prefixlen + len + 2;
+                return ExceptionContinueExecution;
+            }
+            break;  /* Unable to emulate it */
+        }
+        }
+        break;  /* Unable to emulate it */
+
     case 0x8a: /* mov Eb, Gb */
     case 0x8b: /* mov Ev, Gv */
     {




More information about the wine-cvs mailing list