From dc62509b9be9ec46786703910ec7a33cfc3a74e4 Mon Sep 17 00:00:00 2001 From: flobernd Date: Wed, 21 Jun 2017 04:04:58 +0200 Subject: [PATCH] Ignore REX-prefix, if it is not the last prefix before the opcode --- src/Decoder.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Decoder.c b/src/Decoder.c index d42ff54..f3b2190 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -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);