From 03b7723770e0006a78b1b77f5c9b10d7af0237c9 Mon Sep 17 00:00:00 2001 From: mappzor <34216645+mappzor@users.noreply.github.com> Date: Thu, 11 Jan 2024 21:33:16 +0100 Subject: [PATCH] Pad addresses to address width --- include/Zydis/Formatter.h | 8 ++++---- src/FormatterBase.c | 4 ++-- src/FormatterIntel.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/Zydis/Formatter.h b/include/Zydis/Formatter.h index b2f8d025..e503d5fa 100644 --- a/include/Zydis/Formatter.h +++ b/include/Zydis/Formatter.h @@ -176,16 +176,16 @@ typedef enum ZydisFormatterProperty_ /** * Controls the padding of absolute address values. * - * Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to padd all - * addresses to the current stack width (hexadecimal only), or any other integer value for + * Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to pad all + * addresses to the current address width (hexadecimal only), or any other integer value for * custom padding. */ ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE, /** * Controls the padding of relative address values. * - * Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to padd all - * addresses to the current stack width (hexadecimal only), or any other integer value for + * Pass `ZYDIS_PADDING_DISABLED` to disable padding, `ZYDIS_PADDING_AUTO` to pad all + * addresses to the current address width (hexadecimal only), or any other integer value for * custom padding. */ ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE, diff --git a/src/FormatterBase.c b/src/FormatterBase.c index d797a469..495b31c2 100644 --- a/src/FormatterBase.c +++ b/src/FormatterBase.c @@ -235,7 +235,7 @@ ZyanStatus ZydisFormatterBasePrintAddressABS(const ZydisFormatter* formatter, if ((formatter->addr_padding_absolute == ZYDIS_PADDING_AUTO) && (formatter->addr_base == ZYDIS_NUMERIC_BASE_HEX)) { - switch (context->instruction->stack_width) + switch (context->instruction->address_width) { case 16: padding = 4; @@ -275,7 +275,7 @@ ZyanStatus ZydisFormatterBasePrintAddressREL(const ZydisFormatter* formatter, if ((formatter->addr_padding_relative == ZYDIS_PADDING_AUTO) && (formatter->addr_base == ZYDIS_NUMERIC_BASE_HEX)) { - switch (context->instruction->stack_width) + switch (context->instruction->address_width) { case 16: padding = 4; diff --git a/src/FormatterIntel.c b/src/FormatterIntel.c index d754ce32..5e01e858 100644 --- a/src/FormatterIntel.c +++ b/src/FormatterIntel.c @@ -426,7 +426,7 @@ ZyanStatus ZydisFormatterIntelPrintAddressMASM(const ZydisFormatter* formatter, if ((formatter->addr_padding_relative == ZYDIS_PADDING_AUTO) && (formatter->addr_base == ZYDIS_NUMERIC_BASE_HEX)) { - switch (context->instruction->stack_width) + switch (context->instruction->address_width) { case 16: padding = 4;