mirror of https://github.com/x64dbg/zydis
Added own `NULL`
This commit is contained in:
parent
cf24ee010a
commit
c4f5af64d0
|
@ -75,6 +75,12 @@
|
|||
# error "Unsupported word size."
|
||||
#endif
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* NULL */
|
||||
/* ============================================================================================== */
|
||||
|
||||
#define ZYDIS_NULL ((void*)0)
|
||||
|
||||
/* ============================================================================================== */
|
||||
/* Boolean */
|
||||
/* ============================================================================================== */
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
***************************************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <Zydis/Decoder.h>
|
||||
#include <Zydis/Status.h>
|
||||
#include <DecoderData.h>
|
||||
|
@ -4237,7 +4236,7 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
|
||||
// Iterate through the decoder tree
|
||||
const ZydisDecoderTreeNode* node = ZydisDecoderTreeGetRootNode();
|
||||
const ZydisDecoderTreeNode* temp = NULL;
|
||||
const ZydisDecoderTreeNode* temp = ZYDIS_NULL;
|
||||
ZydisDecoderTreeNodeType nodeType;
|
||||
do
|
||||
{
|
||||
|
@ -4250,7 +4249,7 @@ static ZydisStatus ZydisDecodeInstruction(ZydisDecoderContext* context,
|
|||
if (temp)
|
||||
{
|
||||
node = temp;
|
||||
temp = NULL;
|
||||
temp = ZYDIS_NULL;
|
||||
nodeType = ZYDIS_NODETYPE_FILTER_MANDATORY_PREFIX;
|
||||
if (context->mandatoryCandidate == 0x66)
|
||||
{
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
***************************************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <FormatHelper.h>
|
||||
#include <LibC.h>
|
||||
|
||||
|
@ -408,7 +406,7 @@ ZydisStatus ZydisPrintHexS(char** buffer, ZydisUSize bufferLen, ZydisI64 value,
|
|||
ZYDIS_CHECK(ZydisPrintStr(buffer, bufEnd - *buffer, prefix, ZYDIS_LETTER_CASE_DEFAULT));
|
||||
}
|
||||
return ZydisPrintHexU(buffer, bufEnd - *buffer, -value, paddingLength, uppercase,
|
||||
NULL, suffix);
|
||||
ZYDIS_NULL, suffix);
|
||||
}
|
||||
return ZydisPrintHexU(buffer, bufferLen, value, paddingLength, uppercase, prefix, suffix);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
***************************************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
#include <Zydis/CommonTypes.h>
|
||||
#include <Zydis/Formatter.h>
|
||||
#include <Zydis/Utils.h>
|
||||
|
@ -475,7 +474,7 @@ static ZydisStatus ZydisFormatterPrintOperandSizeIntel(const ZydisFormatter* for
|
|||
}
|
||||
if (typecast)
|
||||
{
|
||||
const char* str = NULL;
|
||||
const char* str = ZYDIS_NULL;
|
||||
switch (typecast)
|
||||
{
|
||||
case 8:
|
||||
|
@ -919,7 +918,7 @@ ZydisStatus ZydisFormatterInit(ZydisFormatter* formatter, ZydisFormatterStyle st
|
|||
formatter->immediateFormat = ZYDIS_IMM_FORMAT_HEX_UNSIGNED;
|
||||
formatter->hexUppercase = ZYDIS_TRUE;
|
||||
formatter->hexPrefix = "0x";
|
||||
formatter->hexSuffix = NULL;
|
||||
formatter->hexSuffix = ZYDIS_NULL;
|
||||
formatter->hexPaddingAddress = 2;
|
||||
formatter->hexPaddingDisplacement = 2;
|
||||
formatter->hexPaddingImmediate = 2;
|
||||
|
@ -1151,7 +1150,7 @@ ZydisStatus ZydisFormatterSetHook(ZydisFormatter* formatter, ZydisFormatterHookT
|
|||
ZydisStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter,
|
||||
const ZydisDecodedInstruction* instruction, char* buffer, ZydisUSize bufferLen)
|
||||
{
|
||||
return ZydisFormatterFormatInstructionEx(formatter, instruction, buffer, bufferLen, NULL);
|
||||
return ZydisFormatterFormatInstructionEx(formatter, instruction, buffer, bufferLen, ZYDIS_NULL);
|
||||
}
|
||||
|
||||
ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter,
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
/* LibC is available */
|
||||
/* ============================================================================================== */
|
||||
|
||||
# include <string.h>
|
||||
# define ZydisMemoryCopy memcpy
|
||||
# define ZydisMemorySet memset
|
||||
# define ZydisStrLen strlen
|
||||
|
|
|
@ -42,7 +42,7 @@ const char* ZydisCategoryGetString(ZydisInstructionCategory category)
|
|||
{
|
||||
if (category > ZYDIS_ARRAY_SIZE(zydisInstructionCategoryStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return zydisInstructionCategoryStrings[category];
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ const char* ZydisISASetGetString(ZydisISASet isaSet)
|
|||
{
|
||||
if (isaSet > ZYDIS_ARRAY_SIZE(zydisISASetStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return zydisISASetStrings[isaSet];
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ const char* ZydisISAExtGetString(ZydisISAExt isaExt)
|
|||
{
|
||||
if (isaExt > ZYDIS_ARRAY_SIZE(zydisISAExtStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return zydisISAExtStrings[isaExt];
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ const char* ZydisMnemonicGetString(ZydisMnemonic mnemonic)
|
|||
{
|
||||
if (mnemonic > ZYDIS_ARRAY_SIZE(zydisMnemonicStrings) - 1)
|
||||
{
|
||||
return NULL;
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return zydisMnemonicStrings[mnemonic];
|
||||
}
|
||||
|
|
|
@ -270,7 +270,7 @@ const char* ZydisRegisterGetString(ZydisRegister reg)
|
|||
{
|
||||
if (reg > (sizeof(registerStrings) / sizeof(registerStrings[0])) - 1)
|
||||
{
|
||||
return NULL;
|
||||
return ZYDIS_NULL;
|
||||
}
|
||||
return registerStrings[reg];
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ ZydisU8 ZydisGetOperandDefinitions(const ZydisInstructionDefinition* definition,
|
|||
{
|
||||
if (definition->operandCount == 0)
|
||||
{
|
||||
*operand = NULL;
|
||||
*operand = ZYDIS_NULL;
|
||||
return 0;
|
||||
}
|
||||
ZYDIS_ASSERT(definition->operandReference != 0xFFFF);
|
||||
|
|
Loading…
Reference in New Issue