From 1f1be9fa21b56516fd39b628bc25b19c5dce127a Mon Sep 17 00:00:00 2001 From: flobernd Date: Sat, 27 Jan 2018 17:48:20 +0100 Subject: [PATCH] Fixed non 64-bit mode mask-register error condition --- src/Decoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Decoder.c b/src/Decoder.c index ea41ddc..6dfc8f4 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -4297,7 +4297,8 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context, } break; case ZYDIS_REG_CONSTRAINTS_MASK: - if (context->cache.v_vvvv > 7) + if ((context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64) && + (context->cache.v_vvvv > 7)) { return ZYDIS_STATUS_BAD_REGISTER; }