Skip to content

Commit

Permalink
Fuzzing test
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Dec 22, 2021
1 parent 615a8f5 commit f05434e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/SharedData.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,4 @@ ZyanBool ZydisGetAccessedFlags(const ZydisInstructionDefinition* definition,

/* ---------------------------------------------------------------------------------------------- */

/* ============================================================================================== */
/* ============================================================================================== */
7 changes: 7 additions & 0 deletions tools/ZydisFuzzDecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ typedef struct ZydisFuzzControlBlock_
ZyanUPointer formatter_properties[ZYDIS_FORMATTER_PROP_MAX_VALUE + 1];
char string[16];
ZyanU16 formatter_max_len;

ZydisDecoder decoder;
ZydisDecoderContext context;
ZydisDecodedInstruction instruction;
} ZydisFuzzControlBlock;

/* ============================================================================================== */
Expand Down Expand Up @@ -86,6 +90,9 @@ int ZydisFuzzTarget(ZydisStreamRead read_fn, void* stream_ctx)
}
}

ZydisDecodedOperand operands2[ZYDIS_MAX_OPERAND_COUNT];
ZydisDecoderDecodeOperands(&control_block.decoder, &control_block.context, &control_block.instruction, operands2, ZYDIS_MAX_OPERAND_COUNT);

ZydisFormatter formatter;
if (!ZYAN_SUCCESS(ZydisFormatterInit(&formatter, control_block.formatter_style)))
{
Expand Down

0 comments on commit f05434e

Please sign in to comment.