Ignore REX-prefix, if it is not the last prefix before the opcode

This commit is contained in:
flobernd 2017-06-21 04:04:58 +02:00
parent 9628fb8367
commit dc62509b9b
1 changed files with 4 additions and 0 deletions

View File

@ -777,6 +777,10 @@ static ZydisStatus ZydisCollectOptionalPrefixes(ZydisDecoderContext* context,
}
if (!done)
{
if ((prefixByte & 0xF0) != 0x40)
{
info->details.rex.data[0] = 0x00;
}
context->prefixes[info->details.prefixes.count] = prefixByte;
info->details.prefixes.data[info->details.prefixes.count++] = prefixByte;
ZydisInputSkip(context, info);