From efa98e251f1b445d0c662f4fc162d55a9a78be40 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Fri, 7 Feb 2020 15:38:27 +0100 Subject: [PATCH] Add missing machine-mode check related to #133 --- src/Decoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Decoder.c b/src/Decoder.c index 70d32f22..27c3c8ae 100644 --- a/src/Decoder.c +++ b/src/Decoder.c @@ -4460,7 +4460,9 @@ static ZyanStatus ZydisCheckErrorConditions(ZydisDecoderContext* context, has_VSIB = ZYAN_TRUE; break; case ZYDIS_REG_CONSTRAINTS_NO_REL: - if (instruction->raw.modrm.mod == 0 && instruction->raw.modrm.rm == 5) + if ((context->decoder->machine_mode == ZYDIS_MACHINE_MODE_LONG_64) && + (instruction->raw.modrm.mod == 0) && + (instruction->raw.modrm.rm == 5)) { return ZYDIS_STATUS_DECODING_ERROR; }