mirror of https://github.com/x64dbg/zydis
Various changes to the instruction-definitions and decoder/encoder-tables
This commit is contained in:
parent
d7a49370fe
commit
341f3866c3
File diff suppressed because it is too large
Load Diff
|
@ -3369,26 +3369,27 @@ static void ZydisSetEffectiveOperandSize(ZydisDecoderContext* context,
|
|||
*
|
||||
* @param context A pointer to the @c ZydisDecoderContext struct.
|
||||
* @param instruction A pointer to the @c ZydisDecodedInstruction struct.
|
||||
* @param definition A pointer to the @c ZydisInstructionDefinition struct.
|
||||
*/
|
||||
static void ZydisSetEffectiveAddressWidth(ZydisDecoderContext* context,
|
||||
ZydisDecodedInstruction* instruction)
|
||||
ZydisDecodedInstruction* instruction, const ZydisInstructionDefinition* definition)
|
||||
{
|
||||
ZYDIS_ASSERT(context);
|
||||
ZYDIS_ASSERT(instruction);
|
||||
|
||||
ZydisBool hasOverride = definition->acceptsAddressSizeOverride &&
|
||||
(instruction->attributes & ZYDIS_ATTRIB_HAS_ADDRESSSIZE);
|
||||
|
||||
switch (context->decoder->addressWidth)
|
||||
{
|
||||
case 16:
|
||||
instruction->addressWidth =
|
||||
(instruction->attributes & ZYDIS_ATTRIB_HAS_ADDRESSSIZE) ? 32 : 16;
|
||||
instruction->addressWidth = hasOverride ? 32 : 16;
|
||||
break;
|
||||
case 32:
|
||||
instruction->addressWidth =
|
||||
(instruction->attributes & ZYDIS_ATTRIB_HAS_ADDRESSSIZE) ? 16 : 32;
|
||||
instruction->addressWidth = hasOverride ? 16 : 32;
|
||||
break;
|
||||
case 64:
|
||||
instruction->addressWidth =
|
||||
(instruction->attributes & ZYDIS_ATTRIB_HAS_ADDRESSSIZE) ? 32 : 64;
|
||||
instruction->addressWidth = hasOverride ? 32 : 64;
|
||||
break;
|
||||
default:
|
||||
ZYDIS_UNREACHABLE;
|
||||
|
@ -4226,7 +4227,7 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
const ZydisInstructionDefinition* definition;
|
||||
ZydisGetInstructionDefinition(instruction->encoding, node->value, &definition);
|
||||
ZydisSetEffectiveOperandSize(context, instruction, definition);
|
||||
ZydisSetEffectiveAddressWidth(context, instruction);
|
||||
ZydisSetEffectiveAddressWidth(context, instruction, definition);
|
||||
|
||||
const ZydisInstructionEncodingInfo* info;
|
||||
ZydisGetInstructionEncodingInfo(node, &info);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -545,7 +545,8 @@ enum ZydisMaskPolicies
|
|||
uint8_t operandCount ZYDIS_BITFIELD( 4); \
|
||||
uint16_t operandReference ZYDIS_BITFIELD(15); \
|
||||
uint8_t operandSizeMap ZYDIS_BITFIELD( 3); \
|
||||
uint8_t flagsReference ZYDIS_BITFIELD( 7)
|
||||
uint8_t flagsReference ZYDIS_BITFIELD( 7); \
|
||||
ZydisBool acceptsAddressSizeOverride ZYDIS_BITFIELD( 1)
|
||||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE; \
|
||||
|
|
Loading…
Reference in New Issue