-
-
Notifications
You must be signed in to change notification settings - Fork 482
Open
Labels
A-formatterArea: FormatterArea: Formatter
Description
Zydis incorrectly formats ret far instruction with INTEL_MASM
CBinstruction is formatted asret far. Expected output: 'retf'48 CBinstruction is formatted asret far. Expected output: 'retfq'
Example:
#include <assert.h>
#include <stdio.h>
#include <Zydis/Zydis.h>
int main(void)
{
const ZyanU8 data[] = { 0xCB };
const ZyanU8 data1[] = { 0x48, 0xCB };
ZydisDecoder decoder;
ZydisFormatter formatter;
ZydisDecodedInstruction instruction;
ZydisDecodedOperand operands[ZYDIS_MAX_OPERAND_COUNT];
ZydisDecoderInit(&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_STACK_WIDTH_64);
ZydisFormatterInit(&formatter, ZYDIS_FORMATTER_STYLE_INTEL_MASM);
assert(ZYAN_SUCCESS(ZydisDecoderDecodeFull(&decoder,
data,
sizeof(data),
&instruction,
operands)));
char buff[128]{ 0 };
ZydisFormatterFormatInstruction(&formatter, &instruction, operands, instruction.operand_count_visible, buff, 127, 0, nullptr);
printf("%s\n", buff);
assert(ZYAN_SUCCESS(ZydisDecoderDecodeFull(&decoder,
data1,
sizeof(data1),
&instruction,
operands)));
ZydisFormatterFormatInstruction(&formatter, &instruction, operands, instruction.operand_count_visible, buff, 127, 0, nullptr);
printf("%s\n", buff);
return 0;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-formatterArea: FormatterArea: Formatter