mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-06 23:19:58 +01:00
3.3 KiB
3.3 KiB
Porting Guide v3 -> v4
General
- Zydis now requires a C11 capable compiler
- Type renamed:
ZydisAddressWidth->ZydisStackWidth - Enum changed:
ZydisMemoryOperandType- Constants added:
ZYDIS_MEMOP_TYPE_VSIB
- Constants added:
- Decoding behavior changed:
- In case of vector SIB addressing memory operands,
ZYDIS_MEMOP_TYPE_VSIBwill be reported by the decoder instead ofZYDIS_MEMOP_TYPE_MEM(inZydisDecodedOperand.mem.type)
- In case of vector SIB addressing memory operands,
- Constants renamed:
ZYDIS_STATIC_DEFINE->ZYDIS_STATIC_BUILDZydis_EXPORTS->ZYDIS_SHOULD_EXPORTZYDIS_ADDRESS_WIDTH_XXX->ZYDIS_STACK_WIDTH_XXX
ZydisCPUFlagActiongot replaced byZydisAccessedFlagsMaskZydisAccessedFlagswas added as a replacement for the CPU flag arraysZYDIS_CPUFLAG_C[0-3]were replaced withZYDIS_FPUFLAG_C[0-3]- The segment API (
ZydisGetInstructionSegmentsand corresponding types) was moved to a separate header file
Decoder
- Added functions to decode instructions and operands individually, allowing for improved performance when the operands
are not actually needed.
ZydisDecoderDecodeInstructionZydisDecoderDecodeOperands
ZydisDecoderDecodeBuffergot replaced byZydisDecoderDecodeFullZydisDecodedInstructionstruct was changed- Removed field
operands- The
operandsarray is passed to the desired decoder function as a separate argument instead
- The
- Added field
operand_count_visible- Contains the number of visible (explicit and implicit) operands
- The
cpu_flags_readandcpu_flags_writtenfields are replaced with thecpu_flagsfield - The
fpu_flags_readandfpu_flags_readfields are replaced with thefpu_flagsfield - The older
accessed_flagsarray is replaced by thecpu_flagsandfpu_flagsfields
- Removed field
Formatter
- Added arguments to accommodate the new decoder API changes
- Arguments from
Exvariants of various functions were integrated into the non-Exvariant- All of these varied by only a single argument and didn't warrant the additional complexity
- As a result, the signature of the following functions changed:
ZydisFormatterFormatInstructionZydisFormatterFormatOperandZydisFormatterTokenizeInstructionZydisFormatterTokenizeOperand
Utils
- Removed flag helpers (no longer needed with new flags format!)
ZydisGetAccessedFlagsByActionZydisGetAccessedFlagsReadZydisGetAccessedFlagsWritten
Changes relevant for language bindings
- Encoder added
Encoder.h, various new types and functions
- Type
ZydisRegisterKindadded - The
ZYDIS_ATTRIB_defines were rebased (underlying bits were changed) - New type
ZydisDecodingFlags - New type
ZydisDecoderContext - An anonymous union was added around some fields in the
rawpart ofZydisDecodedInstruction - An anonymous union was added around the operand type specific fields in
ZydisDecodedOperand - The previously anonymous sub-structs in
ZydisDecodedOperandwere lifted to the top level scope and are proper types now - Some of the previously anonymous sub-structs in
ZydisDecodedInstructionwere lifted to the top level scope as well ZydisDecodedOperand::typewas moved to a different location in the struct- Unions were added around fields in
ZydisDecodedOperandandZydisDecodedInstruction