mirror of https://github.com/x64dbg/zydis
Tables fixes and more meta-info
- Added exception-class meta-info - Added CMake option for shared-libraries - Fixed some instruction-definitions - Updated VersionInfo.rc
This commit is contained in:
parent
fafa93d40b
commit
5914abc0be
|
@ -29,6 +29,9 @@ option(ZYDIS_FEATURE_CPUID
|
|||
OFF)
|
||||
|
||||
# Build configuration
|
||||
option(BUILD_SHARED_LIBS
|
||||
"Build shared libraries"
|
||||
OFF)
|
||||
option(ZYDIS_BUILD_EXAMPLES
|
||||
"Build examples"
|
||||
ON)
|
||||
|
|
|
@ -486,7 +486,23 @@ typedef uint16_t ZydisExceptionClass;
|
|||
enum ZydisExceptionClasses
|
||||
{
|
||||
ZYDIS_EXCEPTION_CLASS_NONE,
|
||||
// TODO: SSE and AVX
|
||||
// TODO: FP Exceptions
|
||||
ZYDIS_EXCEPTION_CLASS_SSE1,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE2,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE3,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE4,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE5,
|
||||
ZYDIS_EXCEPTION_CLASS_SSE7,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX1,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX2,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX3,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX4,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX5,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX6,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX7,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX8,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX11,
|
||||
ZYDIS_EXCEPTION_CLASS_AVX12,
|
||||
ZYDIS_EXCEPTION_CLASS_E1,
|
||||
ZYDIS_EXCEPTION_CLASS_E1NF,
|
||||
ZYDIS_EXCEPTION_CLASS_E2,
|
||||
|
@ -505,6 +521,7 @@ enum ZydisExceptionClasses
|
|||
ZYDIS_EXCEPTION_CLASS_E10,
|
||||
ZYDIS_EXCEPTION_CLASS_E10NF,
|
||||
ZYDIS_EXCEPTION_CLASS_E11,
|
||||
ZYDIS_EXCEPTION_CLASS_E11NF,
|
||||
ZYDIS_EXCEPTION_CLASS_E12,
|
||||
ZYDIS_EXCEPTION_CLASS_E12NP,
|
||||
ZYDIS_EXCEPTION_CLASS_K20,
|
||||
|
@ -834,6 +851,10 @@ typedef struct ZydisDecodedInstruction_
|
|||
* @brief The ISA-set extension.
|
||||
*/
|
||||
ZydisISAExt isaExt;
|
||||
/**
|
||||
* @brief The exception class.
|
||||
*/
|
||||
ZydisExceptionClass exceptionClass;
|
||||
} meta;
|
||||
/**
|
||||
* @brief Extended info about different instruction-parts like ModRM, SIB or
|
||||
|
|
|
@ -58,7 +58,7 @@ typedef uint16_t ZydisISASet;
|
|||
#include <Zydis/Generated/EnumISASet.h>
|
||||
|
||||
/**
|
||||
* @brief Defines the @c ZydisISAExtension datatype.
|
||||
* @brief Defines the @c ZydisISAExt datatype.
|
||||
*/
|
||||
typedef uint16_t ZydisISAExt;
|
||||
|
||||
|
|
|
@ -4280,6 +4280,7 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
instruction->meta.category = definition->category;
|
||||
instruction->meta.isaSet = definition->isaSet;
|
||||
instruction->meta.isaExt = definition->isaExt;
|
||||
instruction->meta.exceptionClass = definition->exceptionClass;
|
||||
|
||||
if (context->decoder->decodeGranularity == ZYDIS_DECODE_GRANULARITY_FULL)
|
||||
{
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1920,6 +1920,10 @@ const ZydisOperandDefinition operandDefinitions[] =
|
|||
{ ZYDIS_SEMANTIC_OPTYPE_MASK, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT1, { .encoding = ZYDIS_OPERAND_ENCODING_MASK } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_ZMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 64, 64, 64 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_UINT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_ZMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READWRITE, { 64, 64, 64 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MASK, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT1, { .encoding = ZYDIS_OPERAND_ENCODING_MASK } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_ZMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 64, 64, 64 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MEM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_RM } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_WRITE, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT16, { .encoding = ZYDIS_OPERAND_ENCODING_MODRM_REG } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_MASK, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 8, 8, 8 }, ZYDIS_IELEMENT_TYPE_INT1, { .encoding = ZYDIS_OPERAND_ENCODING_MASK } },
|
||||
{ ZYDIS_SEMANTIC_OPTYPE_XMM, ZYDIS_OPERAND_VISIBILITY_EXPLICIT, ZYDIS_OPERAND_ACTION_READ, { 16, 16, 16 }, ZYDIS_IELEMENT_TYPE_INT32, { .encoding = ZYDIS_OPERAND_ENCODING_NDSNDD } },
|
||||
|
|
|
@ -549,7 +549,8 @@ enum ZydisMaskPolicies
|
|||
ZydisBool acceptsAddressSizeOverride ZYDIS_BITFIELD( 1); \
|
||||
ZydisInstructionCategory category ZYDIS_BITFIELD(ZYDIS_CATEGORY_MAX_BITS); \
|
||||
ZydisISASet isaSet ZYDIS_BITFIELD(ZYDIS_ISA_SET_MAX_BITS); \
|
||||
ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MAX_BITS)
|
||||
ZydisISAExt isaExt ZYDIS_BITFIELD(ZYDIS_ISA_EXT_MAX_BITS); \
|
||||
ZydisExceptionClass exceptionClass ZYDIS_BITFIELD( 6)
|
||||
|
||||
#define ZYDIS_INSTRUCTION_DEFINITION_BASE_VECTOR \
|
||||
ZYDIS_INSTRUCTION_DEFINITION_BASE; \
|
||||
|
|
Binary file not shown.
|
@ -391,6 +391,50 @@ void printInstruction(ZydisDecodedInstruction* instruction)
|
|||
"MVEX"
|
||||
};
|
||||
|
||||
static const char* exceptionClassStrings[] =
|
||||
{
|
||||
"NONE",
|
||||
"SSE1",
|
||||
"SSE2",
|
||||
"SSE3",
|
||||
"SSE4",
|
||||
"SSE5",
|
||||
"SSE7",
|
||||
"AVX1",
|
||||
"AVX2",
|
||||
"AVX3",
|
||||
"AVX4",
|
||||
"AVX5",
|
||||
"AVX6",
|
||||
"AVX7",
|
||||
"AVX8",
|
||||
"AVX11",
|
||||
"AVX12",
|
||||
"E1",
|
||||
"E1NF",
|
||||
"E2",
|
||||
"E2NF",
|
||||
"E3",
|
||||
"E3NF",
|
||||
"E4",
|
||||
"E4NF",
|
||||
"E5",
|
||||
"E5NF",
|
||||
"E6",
|
||||
"E6NF",
|
||||
"E7NM",
|
||||
"E7NM128",
|
||||
"E9NF",
|
||||
"E10",
|
||||
"E10NF",
|
||||
"E11",
|
||||
"E11NF",
|
||||
"E12",
|
||||
"E12NP",
|
||||
"K20",
|
||||
"K21"
|
||||
};
|
||||
|
||||
fputs("== [ BASIC ] =====================================================", stdout);
|
||||
fputs("=======================================\n", stdout);
|
||||
printf(" MNEMONIC: %s [ENC: %s, MAP: %s, OPC: %02X]\n",
|
||||
|
@ -405,6 +449,7 @@ void printInstruction(ZydisDecodedInstruction* instruction)
|
|||
printf(" CATEGORY: %s\n", ZydisCategoryGetString(instruction->meta.category));
|
||||
printf(" ISA-SET: %s\n", ZydisISASetGetString(instruction->meta.isaSet));
|
||||
printf(" ISA-EXT: %s\n", ZydisISAExtGetString(instruction->meta.isaExt));
|
||||
printf(" EXCEPTIONS: %s\n", exceptionClassStrings[instruction->meta.exceptionClass]);
|
||||
|
||||
if (instruction->operandCount > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue