mirror of https://github.com/x64dbg/zydis
Fixed lib build with clang, fixed tools
This commit is contained in:
parent
477a908bb0
commit
4e78d04788
|
@ -376,7 +376,7 @@ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(ZydisInstructionFormatter
|
|||
/**
|
||||
* @brief Defines the @c ZydisInstructionFormatter struct.
|
||||
*/
|
||||
typedef struct ZydisInstructionFormatter_
|
||||
struct ZydisInstructionFormatter_
|
||||
{
|
||||
ZydisFormatFlags flags;
|
||||
ZydisFormatterAddressFormat addressFormat;
|
||||
|
@ -402,7 +402,7 @@ typedef struct ZydisInstructionFormatter_
|
|||
const char* delimMnemonic;
|
||||
const char* delimOperands;
|
||||
const char* fmtDecorator; // TODO:
|
||||
} ZydisInstructionFormatter;
|
||||
};
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Exported functions */
|
||||
|
|
|
@ -65,13 +65,13 @@ typedef bool (*ZydisInputNextFunc)(ZydisCustomInput* input, uint8_t* data);
|
|||
/**
|
||||
* @brief Defines the zydis custom input struct.
|
||||
*/
|
||||
typedef struct ZydisCustomInput_
|
||||
struct ZydisCustomInput_
|
||||
{
|
||||
/**
|
||||
* @brief The @c ZydisInputNextFunc callback.
|
||||
*/
|
||||
ZydisInputNextFunc inputNext;
|
||||
} ZydisCustomInput;
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ typedef struct ZydisInstructionDefinition_
|
|||
#endif
|
||||
#ifdef ZYDIS_ENABLE_FEATURE_AFFECTED_FLAGS
|
||||
uint8_t affectedFlagsId : 8;
|
||||
#endif;
|
||||
#endif
|
||||
#ifdef ZYDIS_ENABLE_FEATURE_CPUID
|
||||
uint8_t cpuidId : 8;
|
||||
#endif
|
||||
} ZydisInstructionDefinition;
|
||||
} ZydisInstructionDefinition;
|
||||
|
|
|
@ -2142,28 +2142,6 @@ static ZydisDecoderStatus ZydisNodeHandlerEvexB(ZydisInstructionInfo* info, uint
|
|||
return ZYDIS_STATUS_DECODER_SUCCESS;
|
||||
}
|
||||
|
||||
static ZydisDecoderStatus ZydisNodeHandlerEvexK(ZydisInstructionInfo* info, uint16_t* index)
|
||||
{
|
||||
ZYDIS_ASSERT(info);
|
||||
ZYDIS_ASSERT(index);
|
||||
|
||||
ZYDIS_ASSERT(info->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX);
|
||||
ZYDIS_ASSERT(info->details.evex.isDecoded);
|
||||
*index = (info->details.evex.aaa == 0) ? 0 : 1;
|
||||
return ZYDIS_STATUS_DECODER_SUCCESS;
|
||||
}
|
||||
|
||||
static ZydisDecoderStatus ZydisNodeHandlerEvexZ(ZydisInstructionInfo* info, uint16_t* index)
|
||||
{
|
||||
ZYDIS_ASSERT(info);
|
||||
ZYDIS_ASSERT(index);
|
||||
|
||||
ZYDIS_ASSERT(info->encoding == ZYDIS_INSTRUCTION_ENCODING_EVEX);
|
||||
ZYDIS_ASSERT(info->details.evex.isDecoded);
|
||||
*index = info->details.evex.z;
|
||||
return ZYDIS_STATUS_DECODER_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Uses the instruction-table to decode the bytestream until an instruction-definition
|
||||
* is found.
|
||||
|
|
|
@ -59,8 +59,9 @@ int main(int argc, char** argv)
|
|||
}
|
||||
|
||||
ZydisInstructionFormatter formatter;
|
||||
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
|
||||
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FORMATTER_FLAG_ALWAYS_DISPLAY_MEMORY_SEGMENT)))
|
||||
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
|
||||
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE,
|
||||
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_IMM_DEFAULT)))
|
||||
{
|
||||
fputs("Failed to initialized instruction-formatter\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
@ -43,7 +43,10 @@ typedef struct ZydisFuzzControlBlock_ {
|
|||
ZydisDisassemblerMode disasMode;
|
||||
ZydisDecoderFlags decoderFlags;
|
||||
ZydisFormatterStyle formatterStyle;
|
||||
ZydisFormatterFlags formatterFlags;
|
||||
ZydisFormatFlags formatterFlags;
|
||||
ZydisFormatterAddressFormat formatterAddrFormat;
|
||||
ZydisFormatterDisplacementFormat formatterDispFormat;
|
||||
ZydisFormatterImmediateFormat formatterImmFormat;
|
||||
uint8_t bufSize;
|
||||
} ZydisFuzzControlBlock;
|
||||
|
||||
|
@ -68,8 +71,9 @@ int main()
|
|||
}
|
||||
|
||||
ZydisInstructionFormatter formatter;
|
||||
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
|
||||
controlBlock.formatterStyle, controlBlock.formatterFlags)))
|
||||
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
|
||||
controlBlock.formatterStyle, controlBlock.formatterFlags, controlBlock.formatterAddrFormat,
|
||||
controlBlock.formatterDispFormat, controlBlock.formatterImmFormat)))
|
||||
{
|
||||
fputs("failed to initialized instruction-formatter\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
|
|
Loading…
Reference in New Issue