From 05aba7a4456950d93f74fcbd7184ccc4a8d69f50 Mon Sep 17 00:00:00 2001 From: flobernd Date: Thu, 8 Feb 2018 01:48:37 +0100 Subject: [PATCH] Minor bugfixes --- src/Formatter.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Formatter.c b/src/Formatter.c index ec40974..24e5490 100644 --- a/src/Formatter.c +++ b/src/Formatter.c @@ -1197,6 +1197,11 @@ ZydisStatus ZydisFormatterFormatInstructionEx(const ZydisFormatter* formatter, const ZydisStatus status = ZydisFormatInstruction(formatter, instruction, &string, userData); buffer[string.length] = 0; + + if (status == ZYDIS_STATUS_SKIP_OPERAND) + { + return ZYDIS_STATUS_SUCCESS; + } return status; } @@ -1263,6 +1268,11 @@ ZydisStatus ZydisFormatterFormatOperandEx(const ZydisFormatter* formatter, status = ZYDIS_STATUS_INVALID_PARAMETER; break; } + // Ignore `ZYDIS_STATUS_SKIP_OPERAND` + if (status == ZYDIS_STATUS_SKIP_OPERAND) + { + status = ZYDIS_STATUS_SUCCESS; + } if (!ZYDIS_SUCCESS(status)) { goto FinalizeString;