-
-
Notifications
You must be signed in to change notification settings - Fork 483
Structual changes to decouple operand-decoding #110
Copy link
Copy link
Closed
Labels
A-decoderArea: DecoderArea: DecoderC-enhancementCategory: Enhancement of existing featuresCategory: Enhancement of existing features
Milestone
Description
Decouple operand-decoding from general instruction decoding to significantly decrease the size of ZydisDecodedInstruction which will improve usage of CPU cache in some situations.
- Remove the
ZydisDecodedOperandarray from theZydisDecodedInstructionstruct - Provide a function that allows to decode
countoperands beginning from a givenindex. Additional flags like e.g. "include hidden operands" could be useful as well. - Implement a wrapper struct that contains the fixed size
ZydisDecodedOperandarray (like in the currentZydisDecodedInstruction) and a function to fill this struct (for convenience reasons)
Possible prototypes for the decoding functions could be:
ZydisStatus ZydisDecodeOperands(ZydisDecodedInstruction* instruction, ZydisDecodedOperand* operands, ZyanU8 count);and
ZydisStatus ZydisDecodeOperandsEx(ZydisDecodedInstruction* instruction, ZydisDecodedOperand* operands, ZyanU8 count, ZyanU8 index, ZydisOperandDecodeFlags flags);where ZydisOperandDecodeFlags might look like this:
#define ZYDIS_OPERAND_DECODE_FLAGS_VISIBLE 1 << 0
#define ZYDIS_OPERAND_DECODE_FLAGS_HIDDEN 1 << 1
#define ZYDIS_OPERAND_DECODE_FLAGS_ALL = ZYDIS_OPERAND_DECODE_FLAGS_VISIBLE | ZYDIS_OPERAND_DECODE_FLAGS_HIDDEN Additionally the basic ZydisDecodedInstruction struct should always be filled with at least operand_count and operand_count_hidden.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-decoderArea: DecoderArea: DecoderC-enhancementCategory: Enhancement of existing featuresCategory: Enhancement of existing features