Fixed detection of bad gather registers in non 64-bit mode

This commit is contained in:
flobernd 2018-01-27 21:57:16 +01:00
parent 1f1be9fa21
commit 74ef4ac22e
No known key found for this signature in database
GPG Key ID: 9C3AE0ED4A969F10
1 changed files with 8 additions and 1 deletions

View File

@ -4325,7 +4325,14 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
ZYDIS_ASSERT((constrREG == ZYDIS_REG_CONSTRAINTS_NONE) &&
(constrRM == ZYDIS_REG_CONSTRAINTS_VSIB) &&
(constrNDSNDD == ZYDIS_REG_CONSTRAINTS_NONE));
mask = context->cache.v_vvvv;
if (context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64)
{
mask = context->cache.v_vvvv;
} else
{
// Ignore the high-register bits in 16- and 32-bit mode
mask = context->cache.v_vvvv & 0x07;
}
break;
case ZYDIS_INSTRUCTION_ENCODING_EVEX:
case ZYDIS_INSTRUCTION_ENCODING_MVEX: