1. Prashant Vaibhav
  2. xnu-emunexgen

Commits

mercurysquad  committed d606945

Fixed the union struct in operand decoder

  • Participants
  • Parent commits 0c05d3f
  • Branches default

Comments (0)

Files changed (2)

File C/OperandDecoder.c

View file
  • Ignore whitespace
     unsigned int    bytesToSkip;  // AFTER modrm byte
 } operandspec_t;
 
-typedef struct { 
-    union {
-        unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax;
+typedef union {
+        struct { unsigned int edi, esi, ebp, esp, ebx, edx, ecx, eax; };
         unsigned int reg[8];
-    };
 } registers_t;
 
 #define disp32(pointer)   (*((signed int*)  (pointer)))

File C/Test_OperandDecoder.c

View file
  • Ignore whitespace
         for (i = 0; i <= 7; i++)
             printf("0x%08x ", regs.reg[i]);
     }
+    printf("\n0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x ", regs.edi, regs.esi, regs.ebp, regs.esp, regs.ebx, regs.edx, regs.ecx, regs.eax);
     printf("\n");
 
     if (!modRM) free(modRM);