mirror of https://github.com/x64dbg/zydis
Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop
This commit is contained in:
commit
0c38e08306
|
@ -51,6 +51,14 @@ int main(int argc, char** argv)
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ZydisInstructionDecoder decoder;
|
||||
if (!ZYDIS_SUCCESS(ZydisDecoderInitInstructionDecoder(
|
||||
&decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_INVALID)))
|
||||
{
|
||||
fputs("Failed to initialize decoder\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ZydisInstructionFormatter formatter;
|
||||
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
|
||||
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE,
|
||||
|
@ -69,8 +77,8 @@ int main(int argc, char** argv)
|
|||
ZydisInstructionInfo info;
|
||||
ZydisStatus status;
|
||||
size_t readOffs = 0;
|
||||
while ((status = ZydisDecode(
|
||||
ZYDIS_OPERATING_MODE_64BIT,
|
||||
while ((status = ZydisDecoderDecodeBuffer(
|
||||
&decoder,
|
||||
readBuf + readOffs,
|
||||
numBytesRead - readOffs,
|
||||
readOffs,
|
||||
|
|
|
@ -40,13 +40,13 @@
|
|||
#include <Zydis/Zydis.h>
|
||||
|
||||
typedef struct ZydisFuzzControlBlock_ {
|
||||
ZydisOperatingMode operatingMode;
|
||||
ZydisMachineMode machineMode;
|
||||
ZydisDecodeGranularity granularity;
|
||||
ZydisFormatterStyle formatterStyle;
|
||||
ZydisFormatterFlags formatterFlags;
|
||||
ZydisFormatterAddressFormat formatterAddrFormat;
|
||||
ZydisFormatterDisplacementFormat formatterDispFormat;
|
||||
ZydisFormatterImmediateFormat formatterImmFormat;
|
||||
ZydisDecodeGranularity granularity;
|
||||
} ZydisFuzzControlBlock;
|
||||
|
||||
/* ============================================================================================== */
|
||||
|
@ -62,6 +62,15 @@ int main()
|
|||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ZydisInstructionDecoder decoder;
|
||||
if (!ZYDIS_SUCCESS(ZydisDecoderInitInstructionDecoderEx(
|
||||
&decoder, controlBlock.machineMode,
|
||||
ZYDIS_ADDRESS_WIDTH_INVALID, controlBlock.granularity)))
|
||||
{
|
||||
fputs("Failed to initialize decoder\n", stderr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
ZydisInstructionFormatter formatter;
|
||||
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
|
||||
controlBlock.formatterStyle, controlBlock.formatterFlags, controlBlock.formatterAddrFormat,
|
||||
|
@ -80,12 +89,11 @@ int main()
|
|||
ZydisInstructionInfo info;
|
||||
ZydisStatus status;
|
||||
size_t readOffs = 0;
|
||||
while ((status = ZydisDecodeEx(
|
||||
controlBlock.operatingMode,
|
||||
while ((status = ZydisDecoderDecodeBuffer(
|
||||
&decoder,
|
||||
readBuf + readOffs,
|
||||
numBytesRead - readOffs,
|
||||
readOffs,
|
||||
controlBlock.granularity,
|
||||
&info
|
||||
)) != ZYDIS_STATUS_NO_MORE_DATA)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue