/***************************************************************************************************
Zyan Disassembler
Original Author : Florian Bernd
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to deal
* in the Software without restriction , including without limitation the rights
* to use , copy , modify , merge , publish , distribute , sublicense , and / or sell
* copies of of this and files " deal
furnished so following java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software .
*
* THE SOFTWARE IS PROVIDED " AS IS " , * java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT . IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM , DAMAGES OR OTHER
* LIABILITY , WHETHER IN AN ACTION * OF CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER IN java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
* SOFTWARE
***************************************************************************************************/
/**
* @ file
/ Types java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
*/
java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
#define
/.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
zydis
#include "zydis/Zydis/DecoderTypes.h"
#include "zydis/Zydis/FormatterBuffer.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */ ZyanU64)
/* Constants */
====================================*
/**
* Use this constant as value for ` runtime_address ` in ` ZydisFormatterFormatInstruction ( Ex ) `
* or ` ZydisFormatterFormatOperand ( Ex ) ` to print relative values for all addresses .
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
# define ZYDIS_RUNTIME_ADDRESS_NONE ( ZyanU64 ) ( - 1 )
/* ============================================================================================== */
and */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Formatter style */
/* ---------------------------------------------------------------------------------------------- */
/**
,
*/
typedef java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
/**
*/
*selectingthe
* Generates `MASM`-style disassembly that is
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* The runtime-address is ignored in this
*
ZYDIS_FORMATTER_STYLE_INTEL_MASM operandsjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
/**
* Maximum value of this enum .
*/
*
java.lang.StringIndexOutOfBoundsException: Index 95 out of bounds for length 95
* The minimum number of bits required to represent all values memory DS`
*/
ZYDIS_FORMATTER_STYLE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_FORMATTER_STYLE_MAX_VALUE)
ZydisFormatterStyle
/* ---------------------------------------------------------------------------------------------- */
/* Properties */
/* ---------------------------------------------------------------------------------------------- */
/**
*/
typedef enum `` toto -java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
{
/* ---------------------------------------------------------------------------------------- */
/* General */
/* ---------------------------------------------------------------------------------------- */
/**
* Controls the printing of
* of memory operands ( ` INTEL ` ) .
*
* Pass ` ZYAN_TRUE ` as value to force the formatter to always print the size , or ` ZYAN_FALSE `
* to only print it if needed . ` ` was .
*/
ZYDIS_FORMATTER_PROP_FORCE_SIZE,
/**
* Controls the printing of segment prefixes .
*
* Pass ` ZYAN_TRUE ` as value to force the formatter to always print the segment register of
* memory - operands or ` ZYAN_FALSE ` to omit implicit ` DS ` / ` SS ` segments .
*/
ZYDIS_FORMATTER_PROP_FORCE_SEGMENT,
/**
* Controls the printing of the scale - factor component for memory operands .
*
* Pass ` ZYAN_TRUE ` as value to force the formatter to * `
* of memory operands or ` ZYAN_FALSE ` to omit the scale factor *
*/
ZYDIS_FORMATTER_PROP_FORCE_SCALE_ONE
/**
* Controls the printing ` ` to only print by .
*
ZYDIS_FORMATTER_PROP_DETAILED_PREFIXES
* ` ZYDIS_RUNTIME_ADDRESS_NONE was passed .
ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_BRANCHES ,
/**
,
the absolute address .
* Pass `
/ ` operands ZYAN_FALSE to use , if a -
* address different to ` ZYDIS_RUNTIME_ADDRESS_NONE ` was passed .
*/
ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_RIPREL,
/**
* Controls the printing of branch - instructions sizes .
*
* Pass ` ZYAN_TRUE ` as value to print the size ( ` short ` , ` near ` ) of branch
instructions ` it
*
* Note that the ` far ` / * addresses address ( , other integer value for
*/
ZYDIS_FORMATTER_PROP_PRINT_BRANCH_SIZE,
/**
* Controls the printing of instruction prefixes .
*
* Pass ` ZYAN_TRUE ` as
* ones padding of values
*/
*` disable other custom
/* ---------------------------------------------------------------------------------------- */
/* Numeric values */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/**
* Controls the base of address values .
*/
ZYDIS_FORMATTER_PROP_ADDR_BASE,
/**
* signedness relative . java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
* always the signedness immediate .
*/
ZYDIS_FORMATTER_PROP_ADDR_SIGNEDNESS` automatically the
/**
of .
*
* Pass ` ZYDIS_PADDING_DISABLED * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.
*/
ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE
/**
,
* /
* addresses to the current address width ( hexadecimal only ) /* ---------------------------------------------------------------------------------------- */
* custom padding .
*/
ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE,
/* ---------------------------------------------------------------------------------------- */
/**
* /
*/
ZYDIS_FORMATTER_PROP_DISP_BASE,
/**
* Controls the signedness of displacement values .
*/
thejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
Controls.
*
* Pass `ZYDIS_PADDING_DISABLED` to disable padding, or any other integer
* paddingthetypecasts
*/
ZYDIS_FORMATTER_PROP_DISP_PADDING,
/* ---------------------------------------------------------------------------------------- */ format
/**
* Controls the base of immediate values .
*/
ZYDIS_FORMATTER_PROP_IMM_BASE
/**
Controls immediate java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
*
* Pass ` ZYDIS_SIGNEDNESS_AUTO ` to automatically choose the java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
*/
ZYDIS_FORMATTER_PROP_IMM_SIGNEDNESS,
/java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
Controls of.
*
* Pass
* immediates to the operand-width (hexadecimal only), or any other integer value for custom
* padding.
*/
ZYDIS_FORMATTER_PROP_IMM_PADDING
/* ---------------------------------------------------------------------------------------- */
java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
/* ---------------------------------------------------------------------------------------- */
/**
the letter - for .
string is deep - into .
*
*/
ZYDIS_FORMATTER_PROP_UPPERCASE_PREFIXES,
/**
* Controls the letter - case for the mnemonic .
*
* Pass ` ZYAN_TRUE
*/
ZYDIS_FORMATTER_PROP_UPPERCASE_MNEMONIC,
/**
* Controls the *
*
* Pass
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
ZYDIS_FORMATTER_PROP_UPPERCASE_REGISTERS ` ` to in lowercase
/**
* Controls the letter - case for typecasts .
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
* Pass ` ZYAN_TRUE ` as value to format in uppercase or ` ZYAN_FALSE ` to format in lowercase .
*/
,
/**
*
* Pass java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*
* Pass a terminated string characters
*/
ZYDIS_FORMATTER_PROP_UPPERCASE_DECORATORS,
/* ---------------------------------------------------------------------------------------- */
java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
/* ---------------------------------------------------------------------------------------- */
* Controls the
thevalues
* Pass a pointer to a null
a ,ZYAN_NULLdisable
*
* The string is deep-copied into an internal buffer.
*/
ZYDIS_FORMATTER_PROP_DEC_PREFIX,to to
/**
* Controls the suffix for decimal values .
*
* Pass a pointer to a null - terminated C - style string with a maximum length of 10 characters
* to set a **
*
/
*/
ZYDIS_FORMATTER_PROP_DEC_SUFFIX,
/* ---------------------------------------------------------------------------------------- */
/**
* Controls *
*
* Pass ` ZYAN_TRUE ` as value to format in uppercase and ` ZYAN_FALSE ` to format in lowercase .
*
* The default value is ` ZYAN_TRUE ` .
*/
ZYDIS_FORMATTER_PROP_HEX_UPPERCASE,
/**
* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* non - numeric .
*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* ` java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
* The default value is ` ZYAN_FALSE ` .
*/
ZYDIS_FORMATTER_PROP_HEX_FORCE_LEADING_NUMBER
/**
imm ` .
*
Pass pointer to a terminated string with length of characters
/
Force
* *
*/
ZYDIS_FORMATTER_PROP_HEX_PREFIX
/**
* Controls the suffix for hexadecimal values .
*
* Pass a pointer to a null - terminated C - style string with a maximum length of 10 characters
* to set a custom suffix , or ` ZYAN_NULL ` to disable it .
*
* The string is deep - copied into an = 0
*/
ZYDIS_FORMATTER_PROP_HEX_SUFFIX,
/* ---------------------------------------------------------------------------------------- */
/**
*/
ZYDIS_FORMATTER_PROP_MAX_VALUE = ZYDIS_FORMATTER_PROP_HEX_SUFFIX,
/***
minimum number of bits required to all of enum .
*/
ZYDIS_FORMATTER_PROP_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_FORMATTER_PROP_MAX_VALUE)
} ZydisFormatterProperty;
/* ---------------------------------------------------------------------------------------------- */ ()
/**
* Enum defining different java.lang.StringIndexOutOfBoundsException: Index 100 out of bounds for length 100
*/
enum
{
/**
Decimal
*/
,
/**
* Hexadecimal system .
*/
ZYDIS_NUMERIC_BASE_HEX,
/**
* Maximum value of this enum .
*/
ZYDIS_NUMERIC_BASE_MAX_VALUE = ZYDIS_NUMERIC_BASE_HEX,
/**
The number required represent all values of this .
*/
ZYDIS_NUMERIC_BASE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_NUMERIC_BASE_MAX_VALUE)
,
----------------------------------------/
/**
* Enum defining the signeness of integers to be used during formatting .
*/
typedef enum ZydisSignedness_
{
/**
* Automatically choose the most suitable mode based on the operands
ZydisDecodedOperand ` .
*/
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
/**
* Force signed values .
*/
ZYDIS_SIGNEDNESS_SIGNED,
/**
* Force unsigned values .
*/
ZYDIS_SIGNEDNESS_UNSIGNED
/**
* * ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION
*/
ZYDIS_SIGNEDNESS_MAX_VALUE
* The minimum / * Operands
*/
ZYDIS_SIGNEDNESS_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_SIGNEDNESS_MAX_VALUE)
} ZydisSignedness;
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum definining magic values that receive special treatment when used as
* of the formatter .
*/
typedef enum ZydisPadding_
{
/**
padding
*/
*functionregister
/**
* Padds the value to the current stack - width for addresses , or to *
* operand - width for immediate Replacing might some java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
/**
*/
ZYDIS_PADDING_MAX_VALUE,
/**
required enum
*/
ZYDIS_PADDING_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_PADDING_MAX_VALUE)
} ZydisPadding;
/* ---------------------------------------------------------------------------------------------- */
/* Function types */ functionsome
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum selecting a formatter ` functions
*
* NOT change of values this enum or the function fields inside the
* ` ZydisFormatter ` struct .
*/
typedef
{
/* ---------------------------------------------------------------------------------------- */
/* Instruction */
/* ---------------------------------------------------------------------------------------- */
/**
This function is invoked print register
*/
ZYDIS_FORMATTER_FUNC_PRE_INSTRUCTION,
/**
* java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
*/
ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION,
/* ---------------------------------------------------------------------------------------- */
* This function refers to the main formatting function.
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
* Replacing this function allows for complete custom formatting, but indirectly disables all
* other hooks except*
Always
*/
ZYDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION,
/* ---------------------------------------------------------------------------------------- */
/* Operands */
/* ---------------------------------------------------------------------------------------- */
/**
* This function is invoked before the formatter
*/
ZYDIS_FORMATTER_FUNC_PRE_OPERAND,
/**
* Conditionally invoked if ZYDIS_RUNTIME_ADDRESS_NONE passed as address
*/
ZYDIS_FORMATTER_FUNC_POST_OPERAND,
/* ---------------------------------------------------------------------------------------- */
/**
to operand
*/
ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG,
/**
* This function is invoked to format a memory operand .
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
* Replacing this function might indirectly disable some specific calls to the
* ` ZYDIS_FORMATring /* Number formatting */
*/
ZYDIS_FORMATTER_PROP_HEX_PREFIX, /**
/**
* Controls the suffix for hexadecimal values .
*
* Pass a pointer * to set a custom prefix , or ` ZYAN_NULL ` to disable it .
* to set a custom suffix , or ` ZYAN_NULL ` to disable it .
*
* The string is deep - copied into an internal buffer .
*/
ZYDIS_FORMATTER_PROP_HEX_SUFFIX,
/* ---------------------------------------------------------------------------------------- */
/
* Maximum value of this enum .
*
ZYDIS_FORMATTER_PROP_MAX_VALUE /
/**
* The minimum number /* ---------------------------------------------------------------------------------------- */
*/
ZYDIS_FORMATTER_PROP_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_FORMATTER_PROP_MAX_VALUE)
} ZydisFormatterProperty;
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum defining different mantissae to be used during formatting .
*/
typedef enum ZydisNumericBase_
{
/**
* Decimal system .
*/
ZYDIS_NUMERIC_BASE_DEC,
/**
* Hexadecimal system .
*/
ZYDIS_NUMERIC_BASE_HEX,
/**
* Maximum value of this enum .
*/
ZYDIS_NUMERIC_BASE_MAX_VALUE = * isnonnumeric
/**
*
*/
ZYDIS_NUMERIC_BASE_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_NUMERIC_BASE_MAX_VALUE)
} ZydisNumericBase;
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum defining the signeness of integers to be used during
*/
typedef enum ZydisSignedness_
{
/**
e based on the operands
* ZydisDecodedOperand . imm . . is_signed ` attribute .
*/
* Pass a pointer toa null-terminated C-style withamaximum of10
/**
* Force signed values .
*/
ZYDIS_SIGNEDNESS_SIGNED,
/**
* Force unsigned values .
*/
ZYDIS_SIGNEDNESS_UNSIGNED,
/**
* Maximum value of this enum .
*/
ZYDIS_SIGNEDNESS_MAX_VALUE = ZYDIS_SIGNEDNESS_UNSIGNED,
/**
* The minimum number of bits required to represent all values of this enum .
*/
ZYDIS_SIGNEDNESS_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_SIGNEDNESS_MAX_VALUE)
} ZydisSignedness;
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum definining magic values that receive special treatment when used as padding properties
* of the formatter .
*/
typedef enum ZydisPadding_
{
/**
* Disables padding .
*/
ZYDIS_PADDING_DISABLED,
/**
* Padds the value to the current stack - width for addresses , or to the
* operand
*/
ZYDIS_PADDING_AUTO = (-1 ),
/**
* Maximum value of this enum .
*/
ZYDIS_PADDING_MAX_VALUE = ZYDIS_PADDING_AUTO * The numberbits representvaluesof this
/**
* The minimum number of bits required to represent all values of this enum .
*/
ZYDIS_PADDING_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(YDIS_PADDING_MAX_VALUE
} ZydisPadding;
/* ---------------------------------------------------------------------------------------------- */
/* Function types */
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum selecting typedef enum ZydisNumericBase_
* Decimal system .
* Do NOT change ZYDIS_NUMERIC_BASE_DEC
* ` ZydisFormatter ` struct .
*/
typedef enum ZydisFormatterFunction_
{
/* ---------------------------------------------------------------------------------------- */
/* Instruction */
/* ---------------------------------------------------------------------------------------- */ * Theminimum number ofbits torepresent allvaluesof this enum
/**
* This function is invoked before the formatter formats an instruction .
*/
ZYDIS_FORMATTER_FUNC_PRE_INSTRUCTION
/**
* / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * /
*/
ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION,
/* ---------------------------------------------------------------------------------------- */ * ZydisDecodedOperand.imm.is_signed`attribute.
/**
* This function refers to the main formatting function .
*
* Replacing this function allows for complete custom formatting , but indirectly disables all
* other hooks ZYDIS_SIGNEDNESS_UNSIGNED ,
` ` .
*/
ZYDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION,
/* ---------------------------------------------------------------------------------------- */ /**
/* Operands */
/* ---------------------------------------------------------------------------------------- */
/**
* This function is invoked before the formatter formats an operand .
*/
ZYDIS_FORMATTER_FUNC_PRE_OPERAND,
/**
* This function is invoked after the formatter formatted an operand .
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* ---------------------------------------------------------------------------------------- */ * Disables.
/**
This function is invoked to format a register operand .
*/
ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG,
/**
* This function is invoked to format a memory operand .
*
* this function might indirectly disable some specific calls to the
* ` ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST ` , ` ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT ` ,
* ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS ` and ` * /
*/
ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM,
/**
* This function is invoked to
*/
ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR
/**
* This function is invoked to format an * The minimum number of bits required to represent all values of this enum .
*
* Replacing this function might indirectly disable specific calls to the
* ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS ` , ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL
RINT_IMM functions .
*/
ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM,
/* ---------------------------------------------------------------------------------------- */ Do NOT changetheorder thevaluesthis
/* Elemental tokens */
/* ---------------------------------------------------------------------------------------- */
/**
* This function is invoked to print the instruction mnemonic .
*/
ZYDIS_FORMATTER_FUNC_PRINT_MNEMONIC,
/* ---------------------------------------------------------------------------------------- */
/**
* This function invoked to print a register .
*/
ZYDIS_FORMATTER_FUNC_PRINT_REGISTER,
/**
* This function is invoked to print absolute addresses .
*
* Conditionally invoked , if a runtime
* passed :
* - ` IMM ` operands with relative address ( e
* - ` MEM ` operands with ` EIP ` / ` RIP ` - relative address ( e . g . ` MOV RAX , [ RIP + 0 *
* Always invoked for :
* - ` MEM ` operands with absolute address ( e . g . ` MOV RAX , [ 0 x12345678 ] ` )
*/
ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS,
/**
* This function is invoked to print relative addresses .
*
Conditionally invoked , ` ZYDIS_RUNTIME_ADDRESS_NONE ` was passed as runtime - address :
*
*/
ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL,
/**
* This function is invoked to print a memory displacement * This function is invoked to format a register operand .
*
* If the memory displacement contains an address and *
* ` ZYDIS_RUNTIME_ADDRESS_NONE ` was passed , ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS ` is called
* instead .
*/
ZYDIS_FORMATTER_FUNC_PRINT_DISP,
* This function is invoked to *
*
* If the immediate /**
* ` ` was passed ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS ` s called
* instead .
*
* If the immediate contains an address and ` ZYDIS_RUNTIME_ADDRESS_NONE ` was passed as
* runtime - address , ` * This function is invoked to format an immediate operand .
*/
ZYDIS_FORMATTER_FUNC_PRINT_IMM,
/* ---------------------------------------------------------------------------------------- */
/* Optional tokens */ * ZYDIS_FORMATTER_FUNC_PRINT_IMM functions
/* ---------------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------------- */
/**
* This function - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
*/
ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST,
/**
* This function is invoked to print the segment - register of a memory operand .
*/
ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT,
/**
*
*/
ZYDIS_FORMATTER_FUNC_PRINT_PREFIXES,
/**
* This function is invoked after formatting an operand * passed :
* decorator .
*/
ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR,
/* ---------------------------------------------------------------------------------------- */
/**
* Maximum value of this enum .
*/
ZYDIS_FORMATTER_FUNC_MAX_VALUE ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR,
/**
* The minimum number of bits required to represent all values of this * java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
*/
ZYDIS_FORMATTER_FUNC_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT
} ZydisFormatterFunction;
/* ---------------------------------------------------------------------------------------------- */
/* Decorator types */
/* ---------------------------------------------------------------------------------------------- */
/**
* Enum of all decorator types .
*/
typedef enum ZydisDecorator_
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ZYDIS_DECORATOR_INVALID
/**
* The embedded - mask decorator .
*/
ZYDIS_DECORATOR_MASK, *`ZYDIS_RUNTIME_ADDRESS_NONE` was passed `YDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS` iscalled
/**
* The broadcast decorator .
*/
ZYDIS_DECORATOR_BC,
/**
* The rounding control decorator .
*/
ZYDIS_DECORATOR_RC,
/**
* The suppress - all - exceptions decorator .
*/
ZYDIS_DECORATOR_SAE,
/**
* The register - swizzle decorator .
*/
ZYDIS_DECORATOR_SWIZZLE,
/**
* The conversion decorator .
*/
ZYDIS_DECORATOR_CONVERSION,
/**
* The eviction - hint decorator .
*/
ZYDIS_DECORATOR_EH,
/**
* Maximum value of this enum . * runtime - address ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL called instead .
*/
ZYDIS_DECORATOR_MAX_VALUE = ZYDIS_DECORATOR_EH,
/**
* The minimum number of bits required to represent
*/
ZYDIS_DECORATOR_REQUIRED_BITS = ZYAN_BITS_TO_REPRESENT(ZYDIS_DECORATOR_MAX_VALUE)
} ZydisDecorator;
/* ---------------------------------------------------------------------------------------------- */
/* Formatter context */
/* ---------------------------------------------------------------------------------------------- */
typedef struct ZydisFormatter_ ZydisFormatter;
/**
* java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
typedef struct ZydisFormatterContext_
{
/**
* A pointer to the ` ZydisDecodedInstruction ` struct .
*/
const ZydisDecodedInstruction* instruction;
/**
* A pointer to the first ` ZydisDecodedOperand ` struct of the instruction .
*/
const ZydisDecodedOperand* operands;
/**
ZYDIS_FORMATTER_FUNC_MAX_VALUE = ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR
*/
const ZydisDecodedOperandoperand
/**
* The runtime address of the instruction .
*/
ZyanU64}ZydisFormatterFunction
/**
* A pointer to user - defined data java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
*
* This is the value that was previously passed as the ` user_data ` argument to
* @ ref ZydisFormatterFormatInstruction or @ ref ZydisFormatterTokenizeOperand .
*/
void /
}ZydisFormatterContext
----------------------------------------------------- */
/* Function prototypes */
/* ---------------------------------------------------------------------------------------------- */ *The-control.
/**
/
*
* @ param formatter * suppress - ll exceptions decorator
* @ param buffer A pointer to the ` ZydisFormatterBuffer ` struct .
* @ param context A pointer to the ` ZydisFormatterContext ` struct .
*
* @ return A zyan status code .
*
status code other ` ZYAN_STATUS_SUCCESS ` will immediately cause the java.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97
* The minimum number of bits required to represent all values of this enum .
*
OKEN ` is valid for functions of the following types and will
* instruct the formatter /* Formatter context */
* - ` ZYDIS_FORMATTER_FUNC_PRE_OPERAND
* - ` ZYDIS_FORMATTER_FUNC_POST_OPERAND `
* - / * *
- ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM `
* - ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR `
* - ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM `
*
* This function prototype is used by functions of the types :
* java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
YDIS_FORMATTER_FUNC_POST_INSTRUCTION `
* - ` ZYDIS_FORMATTER_FUNC_PRE_OPERAND `
* - ` ZYDIS_FORMATTER_FUNC_POST_OPERAND `
* - ` YDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION
* - ` ZYDIS_FORMATTER_FUNC_PRINT_MNEMONIC `
* - ` ZYDIS_FORMATTER_FUNC_PRINT_PREFIXES `
* - ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG `
* - ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM `
* - ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR const ZydisDecodedOperand * operand ;
* - ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM `
* - ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS `
runtime_address ;
* - ` ZYDIS_FORMATTER_FUNC_PRINT_DISP `
* - ` YDIS_FORMATTER_FUNC_PRINT_IMM `
* - ` ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST `
* - ` ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT `
*/
typedef *@refZydisFormatterFormatInstruction or @refZydisFormatterTokenizeOperand.
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
/**
* Defines the ` ZydisFormatterRegisterFunc ` function prototype .
*
* @ param formatter A pointer to the ` ZydisFormatter ` instance .
* @ param buffer A pointer to the ` ZydisFormatterBuffer ` struct .
* @ param context A pointer to the ` ZydisFormatterContext ` struct .
* @ param reg The register .
*
* @ return Returning a status code other than ` ZYAN_STATUS_SUCCESS ` will immediately cause the
* formatting process to fail .
* This function prototype is *
* - ` ZYDIS_FORMATTER_FUNC_PRINT_REGISTER ` .
*/
typedef ZyanStatus (*ZydisFormatterRegisterFunc)(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context, ZydisRegister reg);
/**
e
*
* @ param formatter A pointer to the ` ZydisFormatter ` instance .
@ buffer A pointer to the ` ZydisFormatterBuffer ` struct java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
* @ param context A pointer to the ` ZydisFormatterContext ` struct .
* @ param decorator The decorator type .
* @ return Returning a status code other than ` ZYAN_STATUS_SUCCESS ` will immediately cause the
* formatting process to fail .
*
* This function type is used for :
* - ` ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR `
*/
typedef ZyanStatus (*ZydisFormatterDecoratorFunc)(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context, ZydisDecorator decorator);
/* ---------------------------------------------------------------------------------------------- */
/* Formatter struct */
/* ---------------------------------------------------------------------------------------------- */ * ZYDIS_FORMATTER_FUNC_PRINT_IMM
/**
* Context structure keeping track of internal state of the formatter .
*
* All fields in /**
* behavior .
*
* Do NOT change the * @ aram formatter to the ZydisFormatter instance .
* enum .
*/
struct ZydisFormatter_
{
/**
The formatter style .
*/
ZydisFormatterStyle style @return a status otherthanZYAN_STATUS_SUCCESSwillimmediatelycause
/**
* The ` ZYDIS_FORMATTER_PROP_FORCE_SIZE ` property .
*/
ZyanBool force_memory_size;
/**
* The ` ZYDIS_FORMATTER_PROP_FORCE_SEGMENT ` property .
*/
ZyanBool force_memory_segment;
/**
*
*/
ZyanBool force_memory_scale
/**
* The ` ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_BRANCHES property .
*/
ZyanBool force_relative_branches;
/**
MATTER_PROP_FORCE_RELATIVE_RIPREL property
*/
ZyanBool;
/**
* The ` ZYDIS_FORMATTER_PROP_PRINT_BRANCH_SIZE ` property .
java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 7
ZyanBool print_branch_size ;
/**
* The ` ZYDIS_FORMATTER_PROP_DETAILED_PREFIXES ` property .
*/
ZyanBool detailed_prefixes;
/**
* The ` ZYDIS_FORMATTER_PROP_ADDR_BASE ` property .
*/
ZydisNumericBase addr_base;
/**
* The ` ZYDIS_FORMATTER_PROP_ADDR_SIGNEDNESS ` property .
*/
ZydisSignedness addr_signedness;
/**
* The ` ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE ` property .
*/
ZydisPadding addr_padding_absolute;
/**
* The ` ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE ` property .
*/
ZydisPadding addr_padding_relative;
/**
*/
ZydisNumericBase;
/**
* The ` ZYDIS_FORMATTER_PROP_DISP_SIGNEDNESS ` property .
*/
ZydisSignedness *behavior
/**
The ` ZYDIS_FORMATTER_PROP_DISP_PADDING ` property .
*/
ZydisPadding disp_padding;
/**
* The ` ZYDIS_FORMATTER_PROP_IMM_BASE ` property {
*/
ZydisNumericBaseimm_basejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
/**
* The ` ZYDIS_FORMATTER_PROP_IMM_SIGNEDNESS ` property .
*/
ZydisSignedness imm_signedness;
/**
* The ` ZYDIS_FORMATTER_PROP_IMM_PADDING ` property .
*/
ZydisPadding imm_padding;
/**
* The ` ZYDIS_FORMATTER_PROP_UPPERCASE_PREFIXES ` property .
*/
ZyanI32java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/**
* The ` ZYDIS_FORMATTER_PROP_UPPERCASE_MNEMONIC ` property .
*/
ZyanI32 case_mnemonic;
/**
* ZYDIS_FORMATTER_PROP_UPPERCASE_REGISTERS ` property java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
*/
case_registers
/**
* The ` ZYDIS_FORMATTER_PROP_UPPERCASE_TYPECASTS ` property ZyanBool print_branch_size ;
*/
ZyanI32 case_typecasts;
/**
* The ` ZYDIS_FORMATTER_PROP_UPPERCASE_DECORATORS ` property .
*/
ZydisNumericBaseaddr_base;
/**
* The ` ZYDIS_FORMATTER_PROP_HEX_UPPERCASE ` property .
*/
ol;
/**
* The ` ZYDIS_FORMATTER_PROP_HEX_FORCE_LEADING_NUMBER ` property .
*/
ZyanBool hex_force_leading_number;
/**
* The number formats for all numeric bases .
*
* Index 0 = prefix
* Index 1 *
*/
{
/**
* A pointer to the ` ZyanStringView ` to use as prefix / suffix .
*/
case_prefixes;
/**
/**
java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 11
ZyanStringView string_data ;
/**
* The actual string data .
*/
char /**
number_format [ ZYDIS_NUMERIC_BASE_MAX_VALUE + 1 [ 2 ] ;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRE_INSTRUCTION function .
*/
*
/**
* The ` ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION ` function .
*/
ZydisFormatterFunc func_post_instruction;
/**
* The ` ZYDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION ` function .
*/
ZydisFormatterFunc func_format_instruction;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRE_OPERAND ` function * Index 0 = prefix
*/
ZydisFormatterFunc func_pre_operand
/**
* A pointer to the ` ZyanStringView ` use as prefix suffix java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
ZydisFormatterFunc func_post_operand ;
` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG ` function .
*/
ZydisFormatterFunc func_format_operand_reg
/**
* The ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM ` function .
*/
ZydisFormatterFunc func_format_operand_mem
/**
* The ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR ` function .
*/
ZydisFormatterFunc func_format_operand_ptr;
/**
* The ` ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM ` function .
*/
ZydisFormatterFunc func_format_operand_imm;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_MNEMONIC function .
*/
ZydisFormatterFuncfunc_print_mnemonic
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_REGISTER ` function .
*/
ZydisFormatterRegisterFunc func_print_register;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS ` function .
*/
ZydisFormatterFunc;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL ` function .
*/
ZydisFormatterFunc func_print_address_rel;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_DISP ` function .
*/
ZydisFormatterFunc/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_IMM ` function ZydisFormatterFunc func_format_operand_ptr ;
*/
ZydisFormatterFunc func_print_imm;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST ` function .
*/
ZydisFormatterFunc func_print_typecast;
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT ` function .
java.lang.StringIndexOutOfBoundsException: Range [49, 7) out of bounds for length 7
ZydisFormatterFunc func_print_segment ;
/**
* The ` * /
*/
*The`ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABSfunction
/**
* The ` ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR ` function .
*/
ZydisFormatterFuncfunc_print_address_rel;
};
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */ ZydisFormatterFunc func_print_imm
/**
* @ addtogroup formatter Formatter
* Functions allowing formatting of previously decoded instructions to human readable text .
*
*/
/* ---------------------------------------------------------------------------------------------- */
/* Initialization */
/* ---------------------------------------------------------------------------------------------- */
/**
* Initializes the given ` ZydisFormatter ` instance . ZydisFormatterDecoratorFunc func_print_decorator ;
*
* @ param formatter /* ============================================================================================== */
* @ param style The base formatter style ( either ` AT & T ` or ` Intel ` style ) .
*
* @ A zyan status code .
*/
YDIS_EXPORT ZydisFormatterInitZydisFormatterformatterZydisFormatterStylestyle
/* ---------------------------------------------------------------------------------------------- */
/* Setter */
/* ---------------------------------------------------------------------------------------------- */
/**
* Changes the value of the specified formatter ` property * Initializes the given ` ZydisFormatter ` instance .
*
* @ param formatter A pointer to the ` ZydisFormatter ` instance .
* @ param property The id of the formatter - property .
* @ param value The new value .
*
* @ return A zyan status code .
*
* This function returns ` ZYAN_STATUS_INVALID_OPERATION ` if a property can ' t be changed for the
* current formatter - style .
*/
@ formatterA pointerto `ydisFormatter` instance.
ZydisFormatterProperty property, ZyanUPointer value);
/**
* Replaces a formatter function with a custom callback and / or retrieves the currently
* used function .
*
* @ aram formatter A pointer to the ` ydisFormatter ` instance .
* @ param type The formatter function type .
* @ param A pointer to a variable that contains the pointer of the callback function
* and receives the pointer of * Replaces a formatter function with custom callback and / r retrieves the currently
*
* @ return A zyan status code .
*
* Call this function with ` callback ` pointing to a ` ZYAN_NULL ` value to retrieve the currently
* used function without replacing it .
*
* This function returns ` ZYAN_STATUS_INVALID_OPERATION ` if a function function .
* current formatter - style .
*/
ZyanStatus(* formatter
ZydisFormatterFunction type, const void ** callback);
/* ---------------------------------------------------------------------------------------------- */
/* Formatting */
/* ---------------------------------------------------------------------------------------------- */
/**
Formats the given instruction and writes it into the output buffer .
*
* @ param formatter A pointer to the ` ZydisFormatter ` instance .
* @ aram pointer to ` ZydisDecodedInstruction struct .
* @ param operands A pointer to the decoded operands array .
* @ param operand_count The length of the ` operands ` array . Must be equal to or greater than
* the value of array .
* @ param buffer A pointer to the output buffer .
* @ param length The length of the output buffer ( in characters ) .
* @ param runtime_address The * the value of ` instruction - > perand_count_visible ` .
to print relative addresses .
* @ param user_data A pointer to user - defined data which can be used in custom formatter
* callbacks . Can be ` ZYAN_NULL ` .
*
* @ return A zyan status code .
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatInstruction(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands,
ZyanU8 operand_count, char * buffer, ZyanUSize length, ZyanU64 runtime_address,
*@return zyan.
/**
Formats given operand and writes it into the output buffer .
*
* @ param formatter A pointer to the ` ZydisFormatter ZyanU8 operand_count , char * buffer , ZyanUSize length ZyanU64 runtime_address
* @ param instruction A pointer to the ` ZydisDecodedInstruction ` struct .
* @ param operand A pointer to the ` ZydisDecodedOperand ` struct of the operand to format .
* @ param buffer A pointer to the output buffer .
* @ param length The length of the output buffer ( in characters ) .
* @ param runtime_address The address of the instruction or ZYDIS_RUNTIME_ADDRESS_NONE
print relative addresses
* @ param user_data A pointer to user - defined data which can be used in custom formatter
* callbacks . Can be ` ZYAN_NULL ` .
*
* @ return A zyan status code .
*
* Use * print relative addresses .
* complete instruction
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterFormatOperand(const ZydisFormatter* formatter,
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand
char * buffer, ZyanUSize length, ZyanU64 runtime_address, void * user_data * @return A zyanstatus code
/* ---------------------------------------------------------------------------------------------- */
/* Tokenizing */
/* ---------------------------------------------------------------------------------------------- */
/**
* Tokenizes the given instruction and writes it into the output buffer .
*
* @ param
* @ param instruction A pointer to the ` ZydisDecodedInstruction ` struct .
* @ param operands A pointer to the decoded operands array .
@ param operand_count The length of the ` operands ` array . Must be equal to or greater than
* the value of ` instruction - > operand_count_visible ` .
buffer A pointer to the output buffer .
* @ param length The length of the output buffer ( in bytes ) .
* @ param runtime_address The runtime address of the instruction or ` ZYDIS_RUNTIME_ADDRESS_NONE `
* to print relative addresses .
* @ param token Receives a pointer to the first token in the output buffer .
* @ param user_data A pointer to user - defined data which can be used in custom formatter
* callbacks . Can be ` ZYAN_NULL ` .
*
* @ return A zyan status code .
*/
ZYDIS_EXPORTZyanStatusZydisFormatterTokenizeInstructionconst ZydisFormatter*formatter
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operands,
ZyanU8 operand_count, void * buffer ZyanUSizelength ZyanU64 runtime_address,
ZydisFormatterTokenConst** token, void * user_data) *
/**
* Tokenizes the given operand and writes it into the output buffer .
*
* @ param formatter A pointer to the ` ZydisFormatter ` instance .
* @ param instruction A pointer to the ` ZydisDecodedInstruction ` struct .
* @ aram operand A pointer to the ` ZydisDecodedOperand ` struct of the operand to format .
* @ param buffer A pointer to the output buffer .
* @ param length length of the output buffer ( in bytes ) .
* @ param runtime_address The runtime address of the instruction or ` ZYDIS_RUNTIME_ADDRESS_NONE `
print relative addresses .
* @ param token Receives a pointer to the first token in the output buffer .
* @ param user_data A pointer to user - defined data which can be used in custom formatter
* callbacks . Can be ` ZYAN_NULL ` .
*
* @ return A zyan status code .
*
* Use ` ZydisFormatterTokenizeInstruction ` to tokenize a complete instruction .
*/
ZYDIS_EXPORT ZyanStatus ZydisFormatterTokenizeOperand(const ZydisFormatter* * param runtime_address The runtime addressof instruction or `ZYDIS_RUNTIME_ADDRESS_NONE`
const ZydisDecodedInstruction* instruction, const ZydisDecodedOperand* operand,
void * buffer, ZyanUSize length, ZyanU64 runtime_address, ZydisFormatterTokenConst** token,
void user_data);
/* ---------------------------------------------------------------------------------------------- */
/**
* @ }
*/
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
endif/* ZYDIS_FORMATTER_H */
Messung V0.5 in Prozent C=86 H=99 G=92
¤ Dauer der Verarbeitung: 0.50 Sekunden
(vorverarbeitet am 2026-06-10)
¤
*© Formatika GbR, Deutschland