Fixed lib build with clang, fixed tools

This commit is contained in:
Joel Höner 2016-11-28 18:56:39 +01:00 committed by Joel Höner
parent 477a908bb0
commit 4e78d04788
6 changed files with 16 additions and 33 deletions

View File

@ -376,7 +376,7 @@ typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(ZydisInstructionFormatter
/** /**
* @brief Defines the @c ZydisInstructionFormatter struct. * @brief Defines the @c ZydisInstructionFormatter struct.
*/ */
typedef struct ZydisInstructionFormatter_ struct ZydisInstructionFormatter_
{ {
ZydisFormatFlags flags; ZydisFormatFlags flags;
ZydisFormatterAddressFormat addressFormat; ZydisFormatterAddressFormat addressFormat;
@ -402,7 +402,7 @@ typedef struct ZydisInstructionFormatter_
const char* delimMnemonic; const char* delimMnemonic;
const char* delimOperands; const char* delimOperands;
const char* fmtDecorator; // TODO: const char* fmtDecorator; // TODO:
} ZydisInstructionFormatter; };
/* ============================================================================================== */ /* ============================================================================================== */
/* Exported functions */ /* Exported functions */

View File

@ -65,13 +65,13 @@ typedef bool (*ZydisInputNextFunc)(ZydisCustomInput* input, uint8_t* data);
/** /**
* @brief Defines the zydis custom input struct. * @brief Defines the zydis custom input struct.
*/ */
typedef struct ZydisCustomInput_ struct ZydisCustomInput_
{ {
/** /**
* @brief The @c ZydisInputNextFunc callback. * @brief The @c ZydisInputNextFunc callback.
*/ */
ZydisInputNextFunc inputNext; ZydisInputNextFunc inputNext;
} ZydisCustomInput; };
/* ---------------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------------- */

View File

@ -17,8 +17,8 @@ typedef struct ZydisInstructionDefinition_
#endif #endif
#ifdef ZYDIS_ENABLE_FEATURE_AFFECTED_FLAGS #ifdef ZYDIS_ENABLE_FEATURE_AFFECTED_FLAGS
uint8_t affectedFlagsId : 8; uint8_t affectedFlagsId : 8;
#endif; #endif
#ifdef ZYDIS_ENABLE_FEATURE_CPUID #ifdef ZYDIS_ENABLE_FEATURE_CPUID
uint8_t cpuidId : 8; uint8_t cpuidId : 8;
#endif #endif
} ZydisInstructionDefinition; } ZydisInstructionDefinition;

View File

@ -2142,28 +2142,6 @@ static ZydisDecoderStatus ZydisNodeHandlerEvexB(ZydisInstructionInfo* info, uint
return ZYDIS_STATUS_DECODER_SUCCESS; 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 * @brief Uses the instruction-table to decode the bytestream until an instruction-definition
* is found. * is found.

View File

@ -59,8 +59,9 @@ int main(int argc, char** argv)
} }
ZydisInstructionFormatter formatter; ZydisInstructionFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter, if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FORMATTER_FLAG_ALWAYS_DISPLAY_MEMORY_SEGMENT))) 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); fputs("Failed to initialized instruction-formatter\n", stderr);
return EXIT_FAILURE; return EXIT_FAILURE;

View File

@ -43,7 +43,10 @@ typedef struct ZydisFuzzControlBlock_ {
ZydisDisassemblerMode disasMode; ZydisDisassemblerMode disasMode;
ZydisDecoderFlags decoderFlags; ZydisDecoderFlags decoderFlags;
ZydisFormatterStyle formatterStyle; ZydisFormatterStyle formatterStyle;
ZydisFormatterFlags formatterFlags; ZydisFormatFlags formatterFlags;
ZydisFormatterAddressFormat formatterAddrFormat;
ZydisFormatterDisplacementFormat formatterDispFormat;
ZydisFormatterImmediateFormat formatterImmFormat;
uint8_t bufSize; uint8_t bufSize;
} ZydisFuzzControlBlock; } ZydisFuzzControlBlock;
@ -68,8 +71,9 @@ int main()
} }
ZydisInstructionFormatter formatter; ZydisInstructionFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter, if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
controlBlock.formatterStyle, controlBlock.formatterFlags))) controlBlock.formatterStyle, controlBlock.formatterFlags, controlBlock.formatterAddrFormat,
controlBlock.formatterDispFormat, controlBlock.formatterImmFormat)))
{ {
fputs("failed to initialized instruction-formatter\n", stderr); fputs("failed to initialized instruction-formatter\n", stderr);
return EXIT_FAILURE; return EXIT_FAILURE;