mirror of https://github.com/x64dbg/zydis
Fixed check for invalid gather registers in non 64-bit mode
This commit is contained in:
parent
16e6d0f02b
commit
16c60185a6
|
@ -4279,16 +4279,20 @@ static ZydisStatus ZydisCheckErrorConditions(ZydisDecoderContext* context,
|
||||||
ZYDIS_UNREACHABLE;
|
ZYDIS_UNREACHABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check gather/scatter registers
|
// Check gather registers
|
||||||
if (isGather)
|
if (isGather)
|
||||||
{
|
{
|
||||||
ZYDIS_ASSERT(hasVSIB);
|
ZYDIS_ASSERT(hasVSIB);
|
||||||
ZYDIS_ASSERT(instruction->raw.modrm.mod != 3);
|
ZYDIS_ASSERT(instruction->raw.modrm.mod != 3);
|
||||||
ZYDIS_ASSERT(instruction->raw.modrm.rm == 4);
|
ZYDIS_ASSERT(instruction->raw.modrm.rm == 4);
|
||||||
const ZydisU8 dest = instruction->raw.modrm.reg | (context->cache.R << 3) |
|
|
||||||
(context->cache.R2 << 4);
|
ZydisU8 dest = instruction->raw.modrm.reg;
|
||||||
const ZydisU8 index = instruction->raw.sib.index | (context->cache.X << 3) |
|
ZydisU8 index = instruction->raw.sib.index;
|
||||||
(context->cache.V2 << 4);
|
if (context->decoder->machineMode == ZYDIS_MACHINE_MODE_LONG_64)
|
||||||
|
{
|
||||||
|
dest = dest | (context->cache.R << 3) | (context->cache.R2 << 4);
|
||||||
|
index = index | (context->cache.X << 3) | (context->cache.V2 << 4);
|
||||||
|
}
|
||||||
ZydisU8 mask = 0xFF;
|
ZydisU8 mask = 0xFF;
|
||||||
|
|
||||||
switch (instruction->encoding)
|
switch (instruction->encoding)
|
||||||
|
|
Loading…
Reference in New Issue