Skip to content

Commit

Permalink
Print sizes for agen memory operands (forced mode)
Browse files Browse the repository at this point in the history
  • Loading branch information
mappzor authored and athre0z committed Jan 14, 2024
1 parent d654598 commit 860ec0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/FormatterBase.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,17 @@ ZyanU32 ZydisFormatterHelperGetExplicitSize(const ZydisFormatter* formatter,

ZYAN_ASSERT(operand->type == ZYDIS_OPERAND_TYPE_MEMORY);
ZYAN_ASSERT((operand->mem.type == ZYDIS_MEMOP_TYPE_MEM) ||
(operand->mem.type == ZYDIS_MEMOP_TYPE_AGEN) ||
(operand->mem.type == ZYDIS_MEMOP_TYPE_VSIB));

if (formatter->force_memory_size)
{
return operand->size;
}
else if (operand->mem.type == ZYDIS_MEMOP_TYPE_AGEN)
{
return 0;
}

if (!context->operands)
{
Expand Down
1 change: 1 addition & 0 deletions src/FormatterIntel.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ ZyanStatus ZydisFormatterIntelFormatOperandMEM(const ZydisFormatter* formatter,
ZYAN_ASSERT(context);

if ((context->operand->mem.type == ZYDIS_MEMOP_TYPE_MEM) ||
(context->operand->mem.type == ZYDIS_MEMOP_TYPE_AGEN) ||
(context->operand->mem.type == ZYDIS_MEMOP_TYPE_VSIB))
{
ZYAN_CHECK(formatter->func_print_typecast(formatter, buffer, context));
Expand Down

0 comments on commit 860ec0f

Please sign in to comment.