Fixed segment-register priority in 64-bit mode

This commit is contained in:
flobernd 2017-06-24 04:35:48 +02:00
parent 3a346b5e9d
commit 96a7197647
1 changed files with 20 additions and 4 deletions

View File

@ -754,19 +754,35 @@ static ZydisStatus ZydisCollectOptionalPrefixes(ZydisDecoderContext* context,
break; break;
case 0x2E: case 0x2E:
++info->details.prefixes.has2E; ++info->details.prefixes.has2E;
context->lastSegmentPrefix = 0x2E; if ((context->decoder->machineMode != ZYDIS_MACHINE_MODE_LONG_64) ||
((context->lastSegmentPrefix != 0x64) && (context->lastSegmentPrefix != 0x65)))
{
context->lastSegmentPrefix = 0x2E;
}
break; break;
case 0x36: case 0x36:
++info->details.prefixes.has36; ++info->details.prefixes.has36;
context->lastSegmentPrefix = 0x36; if ((context->decoder->machineMode != ZYDIS_MACHINE_MODE_LONG_64) ||
((context->lastSegmentPrefix != 0x64) && (context->lastSegmentPrefix != 0x65)))
{
context->lastSegmentPrefix = 0x36;
}
break; break;
case 0x3E: case 0x3E:
++info->details.prefixes.has3E; ++info->details.prefixes.has3E;
context->lastSegmentPrefix = 0x3E; if ((context->decoder->machineMode != ZYDIS_MACHINE_MODE_LONG_64) ||
((context->lastSegmentPrefix != 0x64) && (context->lastSegmentPrefix != 0x65)))
{
context->lastSegmentPrefix = 0x3E;
}
break; break;
case 0x26: case 0x26:
++info->details.prefixes.has26; ++info->details.prefixes.has26;
context->lastSegmentPrefix = 0x26; if ((context->decoder->machineMode != ZYDIS_MACHINE_MODE_LONG_64) ||
((context->lastSegmentPrefix != 0x64) && (context->lastSegmentPrefix != 0x65)))
{
context->lastSegmentPrefix = 0x26;
}
break; break;
case 0x64: case 0x64:
++info->details.prefixes.has64; ++info->details.prefixes.has64;