From cb333fffef47105e36b38873e4666bcf6556d628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20H=C3=B6ner?= Date: Tue, 29 Nov 2016 01:27:39 +0100 Subject: [PATCH] Fixed formatter hook example build on LP64 targets --- examples/FormatterHooks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/FormatterHooks.c b/examples/FormatterHooks.c index 6d214a2..4405d2a 100644 --- a/examples/FormatterHooks.c +++ b/examples/FormatterHooks.c @@ -35,6 +35,7 @@ #include #include +#include #include #include "FormatHelper.h" @@ -155,7 +156,7 @@ static ZydisStatus ZydisFormatterFormatOperandImm(ZydisInstructionFormatter* for { // The @c ZydisFormatterFormatMnemonic sinals us to omit the immediate (condition-code) // operand, because it got replaced by the alias-mnemonic - if ((int)info->userData == 1) + if ((uintptr_t)info->userData == 1) { // The formatter will automatically omit the operand, if the buffer remains unchanged // after the callback returns @@ -201,7 +202,7 @@ void disassembleBuffer(uint8_t* data, size_t length, bool installHooks) char buffer[256]; while (ZYDIS_SUCCESS(ZydisDecoderDecodeNextInstruction(&decoder, &info))) { - printf("%016llX ", info.instrAddress); + printf("%016" PRIx64 " ", info.instrAddress); if (info.instrFlags & ZYDIS_INSTRFLAG_ERROR_MASK) { printf(" db %02x\n", info.data[0]);