Skip to content

Commit

Permalink
Add missing machine-mode check
Browse files Browse the repository at this point in the history
related to #133
  • Loading branch information
flobernd committed Feb 7, 2020
1 parent 88c97a2 commit efa98e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit efa98e2

Please sign in to comment.