From bad25117d2e0125879c10b0569960d82276f4088 Mon Sep 17 00:00:00 2001 From: flobernd Date: Wed, 7 Mar 2018 14:56:04 +0100 Subject: [PATCH] Formatter: Fixed padding of immediate values --- src/Formatter.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/Formatter.c b/src/Formatter.c index d2156ce..a7ac3fb 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -517,19 +517,20 @@ static ZydisStatus ZydisPrintImmIntel(const ZydisFormatter* formatter, ZydisStri { case 8: return ZydisStringAppendHexS(string, (ZydisI8)operand->imm.value.s, - formatter->formatImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 16: return ZydisStringAppendHexS(string, (ZydisI16)operand->imm.value.s, - formatter->formatImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 32: return ZydisStringAppendHexS(string, (ZydisI32)operand->imm.value.s, - formatter->formatImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); case 64: - return ZydisStringAppendHexS(string, operand->imm.value.s, formatter->formatImm, - formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); + return ZydisStringAppendHexS(string, operand->imm.value.s, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexSuffix); default: return ZYDIS_STATUS_INVALID_PARAMETER; } @@ -537,17 +538,21 @@ static ZydisStatus ZydisPrintImmIntel(const ZydisFormatter* formatter, ZydisStri switch (instruction->operandWidth) { case 8: - return ZydisStringAppendHexU(string, (ZydisU8)operand->imm.value.u, formatter->formatImm, - formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); + return ZydisStringAppendHexU(string, (ZydisU8)operand->imm.value.u, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexSuffix); case 16: - return ZydisStringAppendHexU(string, (ZydisU16)operand->imm.value.u, formatter->formatImm, - formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); + return ZydisStringAppendHexU(string, (ZydisU16)operand->imm.value.u, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexSuffix); case 32: - return ZydisStringAppendHexU(string, (ZydisU32)operand->imm.value.u, formatter->formatImm, - formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); + return ZydisStringAppendHexU(string, (ZydisU32)operand->imm.value.u, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexSuffix); case 64: - return ZydisStringAppendHexU(string, operand->imm.value.u, formatter->formatImm, - formatter->hexUppercase, formatter->hexPrefix, formatter->hexSuffix); + return ZydisStringAppendHexU(string, operand->imm.value.u, + formatter->hexPaddingImm, formatter->hexUppercase, formatter->hexPrefix, + formatter->hexSuffix); default: return ZYDIS_STATUS_INVALID_PARAMETER; }