Compare commits

...

108 Commits

Author SHA1 Message Date
Joel Höner fda4f15c6d Many encoder bug-fixes, movabs support 2017-01-23 21:52:26 +01:00
Joel Höner 616cd00ec8 Encoder support for rIP relative addressing 2017-01-23 19:21:15 +01:00
Joel Höner 0862398940 Various encoder bug-fixes 2017-01-23 18:31:50 +01:00
Joel Höner 781b9641c4 Merge branch 'develop' of https://github.com/zyantific/zyan-disassembler-engine into develop 2017-01-23 01:37:45 +01:00
flobernd 8157b9fa42 Temporary change to expose the semantic operand-type 2017-01-23 01:17:15 +01:00
Joel Höner 4fe029a34e Merge branch 'develop' of https://github.com/zyantific/zyan-disassembler-engine into develop 2017-01-22 22:12:24 +01:00
Joel Höner eb64a23231 Added encoding of opcode bits into ModRM 2017-01-22 22:12:06 +01:00
flobernd deff3b8e55 Fixed register encoding 2017-01-22 21:44:42 +01:00
Joel Höner 1faec66a66 Fixed mandatory prefixes, added prefix compatibility checks 2017-01-22 19:02:07 +01:00
Joel Höner cb98db80ea Minor encoder cleanup 2017-01-22 17:38:14 +01:00
Joel Höner 587187af89 Implemented address size prefix encoding, bugfixes 2017-01-22 15:46:20 +01:00
Joel Höner b3c8d44bda Implemented segment prefix encoding, refactoring
- Moved memory operand encoding into dedicated function
2017-01-21 23:53:50 +01:00
Joel Höner 87e80346f4 Fixed tools 2017-01-21 18:15:37 +01:00
Joel Höner 03e26408fe Merge branch 'develop' of https://github.com/zyantific/zyan-disassembler-engine into develop 2017-01-21 01:48:35 +01:00
Joel Höner 0a50bb9daa Implemented encoding for XOP, VEX and EVEX 2017-01-20 21:18:13 +01:00
Joel Höner 46077709f8 Completed SIB encoding 2017-01-20 00:54:48 +01:00
flobernd 98d34d0c62 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-01-20 00:03:28 +01:00
flobernd dc70ee7eb2 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-01-20 00:02:21 +01:00
flobernd 4b54158aa2 Minor bugfixes 2017-01-20 00:01:56 +01:00
Joel Höner c0f53a3a69 More encoder progress, minor refactoring
- Added encoding support for more X86 features (IMMs, SIB, ..)
- Added ZYDIS_ARRAY_SIZE macro
- Moved ZYDIS_MAX_INSTRUCTION_LENGTH (Decoder.h -> InstructionInfo.h)
- Renamed ZydisInstructionEncoder -> ZydisEncoderContext
- Various bug-fixes
2017-01-19 17:37:05 +01:00
Joel Höner 14848083ae More encoder progress 2017-01-17 20:53:34 +01:00
flobernd 5ead1d9345 Minor refactorings
- The instruction pointer is now directly passed to the ZydisDecoderDecodeInstruction function
- Removed the user-data pointer in the ZydisOperandInfo struct
2017-01-12 20:14:12 +01:00
Joel Höner 689708fbd3 Refactored docstrings to use uppercase abbreviations 2017-01-12 19:37:57 +01:00
Joel Höner a9514fbfea Minor documentation and style fixes 2017-01-12 18:54:16 +01:00
Joel Höner 0793090388 Implemented basic prefix encoding 2017-01-12 18:53:28 +01:00
Joel Höner 3d2365b6ed Added encoder stub, made decoder input const 2017-01-12 15:12:09 +01:00
Joel Höner 67231ccdff Increased read buffer size in tools 2017-01-12 10:29:42 +01:00
flobernd 3b56c867fc Updated mask-policy definitions for EVEX instructions 2017-01-11 22:11:30 +01:00
flobernd 794a769800 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-01-11 17:29:36 +01:00
flobernd 5af25eee4b Fixed a bug in ZYDIS_CHECK that caused functions to run more than once on certain conditions 2017-01-11 17:29:26 +01:00
Joel Höner 4d0caac923 Fixed build for tools 2017-01-11 12:18:26 +01:00
flobernd 9804bf1d3e Fixed CMake file 2017-01-11 11:51:18 +01:00
flobernd c0528d5cb0 Exposed ZYDIS_MAX_INSTRUCTION_LENGTH constant 2017-01-11 11:24:10 +01:00
flobernd 9073b3a415 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2017-01-11 11:20:45 +01:00
flobernd 4165c3b9b2 Removed Input-struct. The input buffer is now directly passed to the ZydisDecodeInstruction function. 2017-01-11 11:20:24 +01:00
Joel Höner c11929a5f7 Prefixed CMake options 2017-01-10 06:01:04 +01:00
Joel Höner b291c8a760 Use size_t instead of uint64_t for memory input 2017-01-07 00:29:16 +01:00
Joel Höner 2e11b44ddf Minor CMake and C++ compatibility fixes 2017-01-06 02:06:08 +01:00
Joel Höner cbc9460547 Added tool for testing Zydis against CPU behaviour (Intel PIN) 2017-01-06 02:04:21 +01:00
flobernd 5b63557f3c Fixed decoding of instructions with EVEX high-16 register specifiers (R', X, V') 2016-12-05 21:06:29 +01:00
flobernd d4dd176438 Refactorings and bugfixes
- Added support for the BOUND prefix
- Added support for more detailed operand-actions (read, write, readwrite, cond. read, cond. write, read + cond. write, write + cond. read)
- Added operand-visibility info (explicit, implicit, hidden)
- Fixed some bugs in the prefix-decoding routines
- Removed stdbool.h dependency and introduced custom boolean-type for better portability
2016-12-05 02:24:01 +01:00
flobernd bb913f1272 Fixed some instruction-definitions and re-generated tables 2016-11-29 23:48:10 +01:00
flobernd 879f456b03 Fixed some instruction-definitions 2016-11-29 18:30:39 +01:00
flobernd 2e58e13d81 Fixed some instruction-definitions 2016-11-29 13:50:15 +01:00
flobernd 5480ad0aaf Fixed some instruction-definitions 2016-11-29 13:21:09 +01:00
flobernd 425a0d6cd7 Fixed some operand-definitions 2016-11-29 12:38:01 +01:00
flobernd bcfb84e59b Minor refactorings 2016-11-29 11:49:38 +01:00
flobernd e926c26d6e Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2016-11-29 11:47:32 +01:00
Joel Höner e655e8a1b8 Fixed broken enum typedef 2016-11-29 04:09:41 +01:00
Joel Höner cb333fffef Fixed formatter hook example build on LP64 targets 2016-11-29 01:27:39 +01:00
Joel Höner 75921f9ca6 Altered instruction DB format
- support for multiple flag operations
- various definition fixes based on newly enabled editor heuristics
2016-11-28 23:25:26 +01:00
flobernd fbbbcbadb8 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2016-11-28 19:58:01 +01:00
Joel Höner f4959072dc Renamed ZydisFormatFlags -> ZydisFormatterFlags 2016-11-28 19:13:01 +01:00
Joel Höner 4e78d04788 Fixed lib build with clang, fixed tools 2016-11-28 18:56:39 +01:00
flobernd bfcbe3e8c1 Minor bugfixes and refactorings 2016-11-28 15:03:39 +01:00
flobernd 477a908bb0 Added more formatter-hooks
- ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT
- ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE
2016-11-28 11:14:47 +01:00
flobernd 805a407395 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2016-11-28 10:48:10 +01:00
Joel Höner 05d36bd39b fixed many inaccurate flag definitions 2016-11-28 02:44:17 +01:00
flobernd 25f5dfeff1 Added missing x86-flags 2016-11-27 23:54:55 +01:00
flobernd 9a0b1da975 Added missing registers and CPUID feature-flags 2016-11-27 23:24:43 +01:00
Joel Höner 90538a8040 ignore .DS_Store 2016-11-27 22:36:38 +01:00
Joel Höner 9ce1ba1b3b regs and flags for Intel VT-x instructions 2016-11-27 22:35:38 +01:00
flobernd 8dafd68211 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2016-11-27 20:15:19 +01:00
Joel Höner e4f89a05ee regs and flags for VSCALEFPD - XTEST 2016-11-27 19:40:22 +01:00
Joel Höner 08d7a198f3 regs and flags for VFNMADD132PD - VRSQRT28SS 2016-11-27 00:14:27 +01:00
Joel Höner 6240bb8f7d regs and flags for SYSCALL - VFMSUB231SS 2016-11-26 20:43:33 +01:00
flobernd e481c3e401 Minor refactorings and changes to the instruction-formatter
- The formatter now makes use of the format-macros in inttypes.h for better portability
- Added formatter-hook ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT
2016-11-26 18:41:58 +01:00
Joel Höner 9a39623411 regs and flags for RCL - SWAPGS 2016-11-26 17:38:33 +01:00
flobernd 83f41f0f55 Removed unneeded files 2016-11-26 13:15:35 +01:00
flobernd 816bb570c7 Complete rewrite of the instruction-formatter
- Added hooking functionality to support custom instruction-formatting
- Added FormatterHooks demo that demonstrates the hooking functionality

InstructionEditor:
- Fixed issues with still non-deterministic output on code-generation
2016-11-26 13:08:37 +01:00
Joel Höner 03b4d69b08 regs and flags PTWRITE - PXOR 2016-11-26 01:16:08 +01:00
Joel Höner e2a9329781 regs and flags for PABS - PTEST 2016-11-25 20:45:17 +01:00
Joel Höner d3d4c05246 fixed definitions for OUTS, INS 2016-11-25 18:21:09 +01:00
Joel Höner 39c1f3591e regs and flags for MOV - OUT 2016-11-25 18:13:04 +01:00
Joel Höner 4cbc832e5c fixed definitions for MOVS, LODS, STOS, CMPS, SCAS
plus added a few definitions forgotten in my last commit
2016-11-25 17:13:46 +01:00
flobernd 7f1c0bd8f1 Minor refactorings and bugfixes 2016-11-24 10:57:23 +01:00
flobernd 659ead2280 Fixed second operand missing for IVLPGA 2016-11-24 10:53:00 +01:00
Joel Höner 03751240c2 regs and flags for KORTESTB - MOVAPD 2016-11-24 05:41:22 +01:00
Joel Höner 44385df1d5 regs and flags for JCC & JMP 2016-11-24 01:31:01 +01:00
Joel Höner 87b9a281cf added flags and implicit regs for instructions DPPD-IRET 2016-11-24 00:31:49 +01:00
flobernd 32f8a798d2 Minor refactorings 2016-11-22 22:33:32 +01:00
flobernd 1159966784 Changed definition-sorting to produce deterministic output (JSON and generated tables) 2016-11-22 21:47:54 +01:00
flobernd 7f7cbd8dcd Internal changes and optimizations of the generated tables and the InstructionEditor 2016-11-22 18:12:05 +01:00
flobernd be56ef937d Minor bugfixes and refactorings 2016-11-21 14:55:17 +01:00
flobernd c4dce1adb9 Added support for test-register operands (TR0..TR7)
- New instructions: "mov TR, GPR32" and "mov GPR32, TR"
2016-11-14 03:39:17 +01:00
flobernd f5610b937e Fixed code generation and tables (again) 2016-11-14 02:53:16 +01:00
flobernd ead586b722 Fixed code generation and tables 2016-11-14 02:22:29 +01:00
flobernd 58c73b2885 Bugfixes and Support for some more registers
Zydis:
- Fixed operand-size of some instructions in 64-bit mode
- Fixed operand decoding of the "movq MM, GPR" instruction
- Added table-registers (GDRT, LDTR, IDTR, TR)
- Added test-registers (TR0..TR7)
- Added BNDCFG and BNDSTATUS registers
- Added MXCR register

InstructionEditor:
- The code-generator now eliminates duplicate instruction-definitions to optimize the size of the generated tables
- Fixed conflict indication for some operand type/encoding combinations
- Added conflict indication for X86Flags
2016-11-14 02:10:59 +01:00
flobernd 3f09ffca69 Minor refactorings and further preparation for advanced features 2016-11-11 22:03:26 +01:00
flobernd 98e9559d6d Fixed some instruction definitions 2016-09-22 21:19:15 +02:00
flobernd 4c911f91b9 Minor bugfixes and refactorings
* Fixed some instruction Definitions
* Implemented a primitive diffing-mode to compare different versions of the instruction-database (InstructionEditor)
2016-09-21 20:02:09 +02:00
flobernd 317976afbf Minor bugfixes 2016-09-13 20:24:14 +02:00
flobernd a636fa353e Fixed fuzzer tool 2016-09-13 05:35:25 +02:00
flobernd 2472a86405 Merge branch 'develop' of github.com:zyantific/zyan-disassembler-engine into develop 2016-09-13 05:27:20 +02:00
flobernd 72907c6845 Added support for instructions with 5 operands
* optimized table structure to support instructions with 5 operands (vpermil2ps, vpermil2pd)
* updated InstructionEditor
2016-09-13 05:26:55 +02:00
Joel Höner 5eee4a6b18 made output buffer in fuzzer input tool dynamic 2016-09-01 19:14:08 +02:00
Joel Höner 589c4ae691 added stuff forgotten in previous commit 2016-08-28 23:12:40 +02:00
Joel Höner a947d86539 added tool for fuzzing the disassembler 2016-08-28 23:08:07 +02:00
flobernd 0cfed163a0 Commited internally used InstructionEditor 2016-08-23 16:11:42 +02:00
flobernd 54f2bc43ac Preparations for optional feature support 2016-08-23 15:58:40 +02:00
flobernd a6e76d81b4 Preparations for optional feature support 2016-08-23 15:57:38 +02:00
flobernd 52dd9fac89 Fixed CMake file 2016-06-20 01:33:29 +02:00
flobernd 7c9a6db6af Initial version 2.0 release 2016-05-25 21:25:48 +02:00
athre0z f377f7b559 use an example with a little more interesting output 2016-04-15 22:11:49 +02:00
Ingve Vormestrand 92715986fa Added sample output to README 2016-04-06 00:15:12 +02:00
flobernd aa684c1bcc Fixed invalid decoding of INSERTPS instruction
closes #4
2016-03-23 18:06:42 +01:00
Joel Höner f8ed7e1bac fixed travis 2016-02-05 08:42:21 +01:00
Joel Höner 44c3b6b2b0 fixed invalid array access
- an invalid array access could crash on decoding some 3D-Now instructions
2015-12-08 19:19:34 +01:00
90 changed files with 333135 additions and 32962 deletions

227
.gitignore vendored
View File

@ -1,183 +1,82 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# Created by https://www.gitignore.io/api/c,c++,cmake
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
### C ###
# Object files
*.o
*.ko
*.obj
*.elf
# Precompiled Headers
*.gch
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Libraries
*.lib
*.a
*.la
*.lo
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# TFS 2012 Local Workspace
$tf/
# Debug files
*.dSYM/
*.su
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
### C++ ###
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# JustCode is a .NET coding addin-in
.JustCode
# Precompiled Headers
*.gch
*.pch
# TeamCity is a build add-in
_TeamCity*
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# DotCover is a Code Coverage Tool
*.dotCover
# Fortran module files
*.mod
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# MightyMoose
*.mm.*
AutoTest.Net/
# Executables
*.exe
*.out
*.app
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
### CMake ###
CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest.txt
CTestTestfile.cmake
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# MacOS
.DS_Store
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# If using the old MSBuild-Integrated Package Restore, uncomment this:
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/

View File

@ -1,29 +0,0 @@
language: cpp
compiler: clang
script: make
branches:
only:
- master
before_install:
# Install clang 3.6
- echo "yes" | sudo add-apt-repository 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main'
- echo "yes" | sudo add-apt-repository 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.6 main'
- wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -;
- sudo apt-get update
- sudo apt-get install -qq --allow-unauthenticated llvm-3.6 llvm-3.6-dev clang-3.6 libstdc++-4.8-dev lib32stdc++6
- export CXX="clang++-3.6" CC="clang-3.6"
# Install cmake 3.2
- wget http://www.cmake.org/files/v3.2/cmake-3.2.2-Linux-i386.sh
- chmod a+x cmake-3.2.2-Linux-i386.sh
- sudo ./cmake-3.2.2-Linux-i386.sh --skip-license --prefix=/usr
before_script:
- mkdir build
- cd build
- cmake ..
script:
- make

View File

@ -2,95 +2,112 @@ cmake_minimum_required(VERSION 2.8.12)
include(GenerateExportHeader)
project(Zydis)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
option(BUILD_SHARED_LIBS "Build shared libraries rather than static ones" FALSE)
option(FORCE_SHARED_CRT
option(ZYDIS_BUILD_SHARED_LIBS
"Build shared libraries rather than static ones"
FALSE)
option(ZYDIS_FORCE_SHARED_CRT
"Forces shared linkage against the CRT even when building a static library"
FALSE)
option(BUILD_EXAMPLES "Build examples" TRUE)
option(BUILD_C_BINDINGS "Build C bindings" TRUE)
option(ZYDIS_FEATURE_IMPLICITLY_USED_REGISTERS
"Include information about implicitly used registers"
TRUE)
option(ZYDIS_FEATURE_AFFECTED_FLAGS
"Include information about affected flags"
TRUE)
option(ZYDIS_FEATURE_CPUID
"Include information about CPUID feature-flags"
FALSE)
option(ZYDIS_BUILD_EXAMPLES "Build examples" TRUE)
option(ZYDIS_BUILD_TOOLS "Build tools" TRUE)
if (NOT CONFIGURED_ONCE)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(compiler_specific "-Werror")
set(compiler_specific_cxx "-std=c++14")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(compiler_specific "-std=c99 -pedantic -Wextra -Werror")
elseif (MSVC)
set(compiler_specific "/WX /W4 /D_CRT_SECURE_NO_WARNINGS /GR-")
set(compiler_specific "/WX /W4 /TC")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${compiler_specific} ${compiler_specific_cxx}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${compiler_specific}"
CACHE STRING "Flags used by the compiler during all build types." FORCE)
endif ()
# CMake always orders MSVC to build with a shared CRT. Hack CMake variables in order
# to generate with a statically linked CRT when we build as a static library.
if (MSVC AND NOT FORCE_SHARED_CRT)
set(manipulated_vars
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO)
foreach (cur_var ${manipulated_vars})
string(REPLACE "/MD" "/MT" ${cur_var} "${${cur_var}}")
# to generate with a statically linked CRT when we build a static library.
if (("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") AND NOT ZYDIS_FORCE_SHARED_CRT)
foreach(flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif ()
endforeach ()
endif ()
# Library
set(headers
"Zydis/Zydis.hpp"
"Zydis/ZydisInstructionDecoder.hpp"
"Zydis/ZydisInstructionFormatter.hpp"
"Zydis/ZydisOpcodeTable.hpp"
"Zydis/ZydisSymbolResolver.hpp"
"Zydis/ZydisTypes.hpp"
"Zydis/ZydisUtils.hpp")
"include/Zydis/Decoder.h"
"include/Zydis/Encoder.h"
"include/Zydis/Defines.h"
"include/Zydis/Formatter.h"
"include/Zydis/InstructionInfo.h"
"include/Zydis/Mnemonic.h"
"include/Zydis/Register.h"
"include/Zydis/Status.h"
"include/Zydis/Types.h"
"include/Zydis/Utils.h"
"include/Zydis/Zydis.h"
"include/Zydis/Internal/InstructionTable.h")
set(sources
"Zydis/ZydisInstructionDecoder.cpp"
"Zydis/ZydisInstructionFormatter.cpp"
"Zydis/ZydisOpcodeTable.cpp"
"Zydis/ZydisSymbolResolver.cpp"
"Zydis/ZydisUtils.cpp")
"src/Decoder.c"
"src/Encoder.c"
"src/Formatter.c"
"src/InstructionTable.c"
"src/Mnemonic.c"
"src/Register.c"
"src/Utils.c"
"src/Zydis.c")
if (BUILD_SHARED_LIBS AND WIN32)
set(sources ${sources}
"Zydis/VersionInfo.rc")
endif ()
if (BUILD_C_BINDINGS)
set(headers ${headers}
"Zydis/ZydisAPI.h")
set(sources ${sources}
"Zydis/ZydisAPI.cpp")
if (ZYDIS_BUILD_SHARED_LIBS AND WIN32)
set(sources ${sources} "src/VersionInfo.rc")
endif ()
add_library("Zydis" ${headers} ${sources})
set_target_properties("Zydis" PROPERTIES COMPILE_DEFINITIONS "Zydis_EXPORTS")
generate_export_header(
"Zydis"
BASE_NAME "ZYDIS"
EXPORT_FILE_NAME "ZydisExportConfig.h")
include_directories(${PROJECT_BINARY_DIR})
target_include_directories("Zydis" PUBLIC "include/" ${PROJECT_BINARY_DIR})
target_compile_definitions("Zydis" PRIVATE "_CRT_SECURE_NO_WARNINGS" "ZYDIS_EXPORTS")
generate_export_header("Zydis" BASE_NAME "ZYDIS" EXPORT_FILE_NAME "ZydisExportConfig.h")
# Examples
if (BUILD_EXAMPLES)
include_directories("Zydis")
add_executable("SimpleDemo_CPP" "Examples/CPP/SimpleDemo/SimpleDemo.cpp")
target_link_libraries("SimpleDemo_CPP" "Zydis")
add_executable("CustomDataSource_CPP" "Examples/CPP/CustomDataSource/CustomDataSource.cpp")
target_link_libraries("CustomDataSource_CPP" "Zydis")
if (BUILD_C_BINDINGS)
add_executable("SimpleDemo_C" "Examples/C/SimpleDemo/SimpleDemo.c")
target_link_libraries("SimpleDemo_C" "Zydis")
endif ()
if (ZYDIS_FEATURE_IMPLICITLY_USED_REGISTERS)
target_compile_definitions("Zydis" PRIVATE "ZYDIS_ENABLE_FEATURE_IMPLICITLY_USED_REGISTERS")
endif ()
if (ZYDIS_FEATURE_AFFECTED_FLAGS)
target_compile_definitions("Zydis" PRIVATE "ZYDIS_ENABLE_FEATURE_AFFECTED_FLAGS")
endif ()
if (ZYDIS_FEATURE_CPUID)
target_compile_definitions("Zydis" PRIVATE "ZYDIS_ENABLE_FEATURE_CPUID")
endif ()
set(CONFIGURED_ONCE TRUE CACHE INTERNAL "CMake has configured at least once.")
# Examples
if (ZYDIS_BUILD_EXAMPLES)
add_executable("FormatterHooks"
"examples/FormatterHooks.c"
"examples/FormatHelper.h")
target_link_libraries("FormatterHooks" "Zydis")
set_target_properties ("FormatterHooks" PROPERTIES FOLDER "Examples/Formatter")
target_compile_definitions("FormatterHooks" PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif ()
# Tools
if (ZYDIS_BUILD_TOOLS)
add_executable("ZydisDisasm" "tools/ZydisDisasm.c")
target_link_libraries("ZydisDisasm" "Zydis")
set_target_properties ("ZydisDisasm" PROPERTIES FOLDER "Tools")
target_compile_definitions("ZydisDisasm" PRIVATE "_CRT_SECURE_NO_WARNINGS")
add_executable("ZydisFuzzIn" "tools/ZydisFuzzIn.c")
target_link_libraries("ZydisFuzzIn" "Zydis")
set_target_properties("ZydisFuzzIn" PROPERTIES FOLDER "Tools")
target_compile_definitions("ZydisFuzzIn" PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif ()

File diff suppressed because it is too large Load Diff

View File

@ -1,199 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <ZydisAPI.h>
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
void PrintZydisError()
{
puts("Zydis error: ");
switch (ZydisGetLastError())
{
case ZYDIS_ERROR_SUCCESS:
puts("success");
break;
case ZYDIS_ERROR_UNKNOWN:
puts("unknown error");
break;
case ZYDIS_ERROR_NOT_ENOUGH_MEMORY:
puts("not enough memory");
break;
case ZYDIS_ERROR_INVALID_PARAMETER:
puts("invalid parameter");
break;
}
}
int main()
{
uint8_t data32[] =
{
0x8B, 0xFF, 0x55, 0x8B, 0xEC, 0x6A, 0xFE, 0x68, 0xD8, 0x18, 0x09, 0x77, 0x68, 0x85, 0xD2,
0x09, 0x77, 0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x50, 0x83, 0xEC, 0x14, 0x53, 0x56, 0x57,
0xA1, 0x68, 0xEE, 0x13, 0x77, 0x31, 0x45, 0xF8, 0x33, 0xC5, 0x50, 0x8D, 0x45, 0xF0, 0x64,
0xA3, 0x00, 0x00, 0x00, 0x00, 0x89, 0x65, 0xE8, 0xC7, 0x45, 0xFC, 0x00, 0x00, 0x00, 0x00,
0x8B, 0x5D, 0x08, 0xF6, 0xC3, 0x04, 0x0F, 0x85, 0x57, 0x74, 0x00, 0x00, 0x53, 0x6A, 0x00,
0xFF, 0x35, 0xA0, 0xE3, 0x13, 0x77, 0xFF, 0x15, 0x00, 0x10, 0x14, 0x77, 0x85, 0xC0, 0x0F,
0x84, 0xC6, 0x48, 0x04, 0x00, 0xC7, 0x45, 0x08, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x45, 0xFC,
0xFE, 0xFF, 0xFF, 0xFF, 0x33, 0xC0, 0x8B, 0x4D, 0xF0, 0x64, 0x89, 0x0D, 0x00, 0x00, 0x00,
0x00, 0x59, 0x5F, 0x5E, 0x5B, 0x8B, 0xE5, 0x5D, 0xC2, 0x04, 0x00
};
uint8_t data64[] =
{
0x48, 0x89, 0x5C, 0x24, 0x10, 0x48, 0x89, 0x74, 0x24, 0x18, 0x89, 0x4C, 0x24, 0x08, 0x57,
0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, 0x57, 0x48, 0x83, 0xEC, 0x40, 0x4C, 0x8B, 0xF2,
0x8B, 0xD9, 0x48, 0xC7, 0x44, 0x24, 0x20, 0x00, 0x00, 0x00, 0x00, 0x33, 0xF6, 0x48, 0x89,
0x74, 0x24, 0x30, 0x45, 0x33, 0xFF, 0xF7, 0xC1, 0x8D, 0xF0, 0xFF, 0xFF, 0x0F, 0x85, 0xAA,
0x53, 0x08, 0x00, 0xF6, 0xC1, 0x40, 0x8B, 0xFE, 0x41, 0xBD, 0x08, 0x00, 0x00, 0x00, 0x41,
0x0F, 0x45, 0xFD, 0xF6, 0xC1, 0x02, 0x48, 0x8B, 0x0D, 0x10, 0xD4, 0x0E, 0x00, 0x0F, 0x85,
0x40, 0xE1, 0x01, 0x00, 0x8B, 0x15, 0x4C, 0xD5, 0x0E, 0x00, 0x81, 0xC2, 0x00, 0x00, 0x14,
0x00, 0x0B, 0xD7, 0x4D, 0x8B, 0xC6, 0xFF, 0x15, 0x3B, 0x2F, 0x10, 0x00, 0x48, 0x8B, 0xD8,
0x48, 0x85, 0xC0, 0x0F, 0x84, 0x93, 0x78, 0x0A, 0x00, 0x48, 0x8B, 0xC3, 0x48, 0x8B, 0x5C,
0x24, 0x78, 0x48, 0x8B, 0xB4, 0x24, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, 0xC4, 0x40, 0x41,
0x5F, 0x41, 0x5E, 0x41, 0x5D, 0x41, 0x5C, 0x5F, 0xC3
};
ZydisInstructionInfo info;
ZydisInstructionDecoderContext* decoder = NULL;
ZydisInstructionFormatterContext* formatter = NULL;
ZydisInputContext* input32 = NULL;
ZydisInputContext* input64 = NULL;
// Create decoder and formatter instances
decoder = ZydisCreateInstructionDecoder();
if (!decoder)
{
goto ZydisError;
}
formatter = ZydisCreateIntelInstructionFormatter();
if (!formatter)
{
goto FreeZydisDecoder;
}
// Create memory data sources
input32 = ZydisCreateMemoryInput(&data32[0], sizeof(data32));
if (!input32)
{
goto FreeZydisFormatter;
}
input64 = ZydisCreateMemoryInput(&data64[0], sizeof(data64));
if (!input64)
{
goto FreeZydisInput32;
}
// Set decoder properties
ZydisSetDisassemblerMode(decoder, ZYDIS_DM_M32BIT);
ZydisSetDataSource(decoder, input32);
ZydisSetInstructionPointer(decoder, 0x77091852);
// Decode and format all instructions
puts("32 bit test ...\n\n");
while (ZydisDecodeInstruction(decoder, &info))
{
printf("%08X ", (uint32_t)(info.instrAddress & 0xFFFFFFFF));
if (info.flags & ZYDIS_IF_ERROR_MASK)
{
printf("db %02X\n", info.data[0]);
}
else
{
const char* instructionText;
if (!ZydisFormatInstruction(formatter, &info, &instructionText))
{
goto FreeZydisInput64;
}
printf("%s\n", instructionText);
}
}
// Check if an error occured in ZydisDecodeInstruction or the end of the input was reached.
if (ZydisGetLastError() != ZYDIS_ERROR_SUCCESS)
{
goto FreeZydisInput64;
}
puts("\n");
// Set decoder properties
ZydisSetDisassemblerMode(decoder, ZYDIS_DM_M64BIT);
ZydisSetDataSource(decoder, input64);
ZydisSetInstructionPointer(decoder, 0x00007FFA39A81930ull);
// Decode and format all instructions
puts("64 bit test ...\n\n");
while (ZydisDecodeInstruction(decoder, &info))
{
printf("%016"PRIX64" ", info.instrAddress);
if (info.flags & ZYDIS_IF_ERROR_MASK)
{
printf("db %02X", info.data[0]);
}
else
{
const char* instructionText;
if (!ZydisFormatInstruction(formatter, &info, &instructionText))
{
goto FreeZydisInput64;
}
printf("%s\n", instructionText);
}
}
// Check if an error occured in ZydisDecodeInstruction or the end of the input was reached.
if (ZydisGetLastError() != ZYDIS_ERROR_SUCCESS)
{
goto FreeZydisInput64;
}
// Cleanup code
FreeZydisInput64:
ZydisFreeInput(input64);
FreeZydisInput32:
ZydisFreeInput(input32);
FreeZydisFormatter:
ZydisFreeInstructionFormatter(formatter);
FreeZydisDecoder:
ZydisFreeInstructionDecoder(decoder);
ZydisError:
if (ZydisGetLastError() != ZYDIS_ERROR_SUCCESS)
{
PrintZydisError();
getchar();
return 1;
}
getchar();
return 0;
}

View File

@ -1,169 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <stdint.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <sstream>
#include <Zydis.hpp>
class ZydisStdinInput : public Zydis::BaseInput
{
private:
std::vector<uint8_t> m_buffer;
uint32_t m_position = 0;
uint64_t m_globalPosition = 0;
private:
void gatherInput();
protected:
uint8_t internalInputPeek() override;
uint8_t internalInputNext() override;
public:
bool isEndOfInput() const override;
uint64_t getPosition() const override;
bool setPosition(uint64_t position) override;
};
void ZydisStdinInput::gatherInput()
{
if (m_position != m_buffer.size())
{
return;
}
std::vector<uint8_t> buffer;
bool valid;
do
{
valid = true;
buffer.clear();
std::string input;
std::getline(std::cin, input);
if (input.empty())
{
valid = false;
continue;
}
std::istringstream ss(input);
uint32_t x;
do
{
ss >> std::hex >> x;
if (ss.fail())
{
std::cout << std::endl << "# Error: Invalid hex input." << std::endl << std::endl;
ss.ignore();
valid = false;
break;
}
if (buffer.size() == buffer.capacity())
{
buffer.reserve(buffer.capacity() + 512);
}
if (x > 255)
{
std::cout << std::endl << "# Warning: 0x"
<< std::hex << std::setw(8) << std::setfill('0') << std::uppercase << x
<< " converted to uint8_t. Possible data loss." << std::endl << std::endl;
}
buffer.resize(buffer.size() + 1);
buffer[buffer.size() - 1] = static_cast<uint8_t>(x);
} while (!ss.eof());
} while (!valid);
m_buffer = buffer;
m_position = 0;
}
uint8_t ZydisStdinInput::internalInputPeek()
{
gatherInput();
return m_buffer[m_position];
}
uint8_t ZydisStdinInput::internalInputNext()
{
gatherInput();
m_globalPosition++;
return m_buffer[m_position++];
}
bool ZydisStdinInput::isEndOfInput() const
{
return false;
}
uint64_t ZydisStdinInput::getPosition() const
{
return m_globalPosition;
}
bool ZydisStdinInput::setPosition(uint64_t position)
{
if (position > m_globalPosition)
{
return false;
}
int64_t delta = m_globalPosition - position;
if (delta > m_position)
{
return false;
}
m_position = m_position - static_cast<int32_t>(delta);
m_globalPosition = position;
return true;
}
int main()
{
Zydis::InstructionInfo info;
Zydis::InstructionDecoder decoder;
Zydis::IntelInstructionFormatter formatter;
ZydisStdinInput input;
decoder.setDisassemblerMode(Zydis::DisassemblerMode::M32BIT);
decoder.setDataSource(&input);
decoder.setInstructionPointer(0x00000000);
while (decoder.decodeInstruction(info))
{
std::cout << std::hex << std::setw(8) << std::setfill('0') << std::uppercase
<< info.instrAddress << " ";
if (info.flags & Zydis::IF_ERROR_MASK)
{
std::cout << "db " << std::setw(2) << static_cast<int>(info.data[0]) << std::endl;
} else
{
std::cout << formatter.formatInstruction(info) << std::endl;
}
}
return 0;
}

View File

@ -1,109 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <stdint.h>
#include <iostream>
#include <iomanip>
#include <Zydis.hpp>
int main()
{
uint8_t data32[] =
{
0x8B, 0xFF, 0x55, 0x8B, 0xEC, 0x6A, 0xFE, 0x68, 0xD8, 0x18, 0x09, 0x77, 0x68, 0x85, 0xD2,
0x09, 0x77, 0x64, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x50, 0x83, 0xEC, 0x14, 0x53, 0x56, 0x57,
0xA1, 0x68, 0xEE, 0x13, 0x77, 0x31, 0x45, 0xF8, 0x33, 0xC5, 0x50, 0x8D, 0x45, 0xF0, 0x64,
0xA3, 0x00, 0x00, 0x00, 0x00, 0x89, 0x65, 0xE8, 0xC7, 0x45, 0xFC, 0x00, 0x00, 0x00, 0x00,
0x8B, 0x5D, 0x08, 0xF6, 0xC3, 0x04, 0x0F, 0x85, 0x57, 0x74, 0x00, 0x00, 0x53, 0x6A, 0x00,
0xFF, 0x35, 0xA0, 0xE3, 0x13, 0x77, 0xFF, 0x15, 0x00, 0x10, 0x14, 0x77, 0x85, 0xC0, 0x0F,
0x84, 0xC6, 0x48, 0x04, 0x00, 0xC7, 0x45, 0x08, 0x00, 0x00, 0x00, 0x00, 0xC7, 0x45, 0xFC,
0xFE, 0xFF, 0xFF, 0xFF, 0x33, 0xC0, 0x8B, 0x4D, 0xF0, 0x64, 0x89, 0x0D, 0x00, 0x00, 0x00,
0x00, 0x59, 0x5F, 0x5E, 0x5B, 0x8B, 0xE5, 0x5D, 0xC2, 0x04, 0x00
};
uint8_t data64[] =
{
0x48, 0x89, 0x5C, 0x24, 0x10, 0x48, 0x89, 0x74, 0x24, 0x18, 0x89, 0x4C, 0x24, 0x08, 0x57,
0x41, 0x54, 0x41, 0x55, 0x41, 0x56, 0x41, 0x57, 0x48, 0x83, 0xEC, 0x40, 0x4C, 0x8B, 0xF2,
0x8B, 0xD9, 0x48, 0xC7, 0x44, 0x24, 0x20, 0x00, 0x00, 0x00, 0x00, 0x33, 0xF6, 0x48, 0x89,
0x74, 0x24, 0x30, 0x45, 0x33, 0xFF, 0xF7, 0xC1, 0x8D, 0xF0, 0xFF, 0xFF, 0x0F, 0x85, 0xAA,
0x53, 0x08, 0x00, 0xF6, 0xC1, 0x40, 0x8B, 0xFE, 0x41, 0xBD, 0x08, 0x00, 0x00, 0x00, 0x41,
0x0F, 0x45, 0xFD, 0xF6, 0xC1, 0x02, 0x48, 0x8B, 0x0D, 0x10, 0xD4, 0x0E, 0x00, 0x0F, 0x85,
0x40, 0xE1, 0x01, 0x00, 0x8B, 0x15, 0x4C, 0xD5, 0x0E, 0x00, 0x81, 0xC2, 0x00, 0x00, 0x14,
0x00, 0x0B, 0xD7, 0x4D, 0x8B, 0xC6, 0xFF, 0x15, 0x3B, 0x2F, 0x10, 0x00, 0x48, 0x8B, 0xD8,
0x48, 0x85, 0xC0, 0x0F, 0x84, 0x93, 0x78, 0x0A, 0x00, 0x48, 0x8B, 0xC3, 0x48, 0x8B, 0x5C,
0x24, 0x78, 0x48, 0x8B, 0xB4, 0x24, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, 0xC4, 0x40, 0x41,
0x5F, 0x41, 0x5E, 0x41, 0x5D, 0x41, 0x5C, 0x5F, 0xC3
};
Zydis::InstructionInfo info;
Zydis::InstructionDecoder decoder;
Zydis::IntelInstructionFormatter formatter;
Zydis::MemoryInput input32(&data32[0], sizeof(data32));
Zydis::MemoryInput input64(&data64[0], sizeof(data64));
decoder.setDisassemblerMode(Zydis::DisassemblerMode::M32BIT);
decoder.setDataSource(&input32);
decoder.setInstructionPointer(0x77091852);
std::cout << "32 bit test ..." << std::endl << std::endl;
while (decoder.decodeInstruction(info))
{
std::cout << std::hex << std::setw(8) << std::setfill('0') << std::uppercase
<< info.instrAddress << " ";
if (info.flags & Zydis::IF_ERROR_MASK)
{
std::cout << "db " << std::setw(2) << static_cast<int>(info.data[0]) << std::endl;
} else
{
std::cout << formatter.formatInstruction(info) << std::endl;
}
}
std::cout << std::endl;
decoder.setDisassemblerMode(Zydis::DisassemblerMode::M64BIT);
decoder.setDataSource(&input64);
decoder.setInstructionPointer(0x00007FFA39A81930ull);
std::cout << "64 bit test ..." << std::endl << std::endl;
while (decoder.decodeInstruction(info))
{
std::cout << std::hex << std::setw(16) << std::setfill('0') << std::uppercase
<< info.instrAddress << " ";
if (info.flags & Zydis::IF_ERROR_MASK)
{
std::cout << "db " << std::setw(2) << static_cast<int>(info.data[0]) << std::endl;
} else
{
std::cout << formatter.formatInstruction(info) << std::endl;
}
}
std::cin.get();
return 0;
}

View File

@ -1,40 +0,0 @@
/**************************************************************************************************
Verteron Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications :
Last change : 29. October 2014
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
**************************************************************************************************/
#include <tchar.h>
#include "PugiXML/pugixml.hpp"
#include "VXDisassemblerTypes.h"
int _tmain(int argc, _TCHAR* argv[])
{
// TODO:
return 0;
}

View File

@ -1,156 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{EFA075B8-AFB9-4E06-99AD-BD58F50A9500}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>OptableGenerator</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>..\VerteronDisassemblerEngine\;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VerteronDisassemblerEngine\VerteronDisassemblerEngine.vcxproj">
<Project>{f5c6f0a7-f75d-42bd-a8ab-a2d1d5f67099}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="Main.cpp" />
</ItemGroup>
</Project>

View File

@ -1,72 +0,0 @@
/**
* pugixml parser - version 1.4
* --------------------------------------------------------
* Copyright (C) 2006-2014, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
* Report bugs and download new versions at http://pugixml.org/
*
* This library is distributed under the MIT License. See notice at the end
* of this file.
*
* This work is based on the pugxml parser, which is:
* Copyright (C) 2003, by Kristen Wegner (kristen@tima.net)
*/
#ifndef HEADER_PUGICONFIG_HPP
#define HEADER_PUGICONFIG_HPP
// Uncomment this to enable wchar_t mode
// #define PUGIXML_WCHAR_MODE
// Uncomment this to disable XPath
// #define PUGIXML_NO_XPATH
// Uncomment this to disable STL
// #define PUGIXML_NO_STL
// Uncomment this to disable exceptions
// #define PUGIXML_NO_EXCEPTIONS
// Set this to control attributes for public classes/functions, i.e.:
// #define PUGIXML_API __declspec(dllexport) // to export all public symbols from DLL
// #define PUGIXML_CLASS __declspec(dllimport) // to import all classes from DLL
// #define PUGIXML_FUNCTION __fastcall // to set calling conventions to all public functions to fastcall
// In absence of PUGIXML_CLASS/PUGIXML_FUNCTION definitions PUGIXML_API is used instead
// Tune these constants to adjust memory-related behavior
// #define PUGIXML_MEMORY_PAGE_SIZE 32768
// #define PUGIXML_MEMORY_OUTPUT_STACK 10240
// #define PUGIXML_MEMORY_XPATH_PAGE_SIZE 4096
// Uncomment this to switch to header-only version
// #define PUGIXML_HEADER_ONLY
// #include "pugixml.cpp"
// Uncomment this to enable long long support
// #define PUGIXML_HAS_LONG_LONG
#endif
/**
* Copyright (c) 2006-2014 Arseny Kapoulkine
*
* 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 the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, 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 CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +1,88 @@
Zyan Disassembler Engine (Zydis) [![Build Status](https://travis-ci.org/zyantific/zyan-disassembler-engine.svg?branch=master)](https://travis-ci.org/zyantific/zyan-disassembler-engine)
Zyan Disassembler Engine (Zydis)
================================
Fast and lightweight x86/x86-64 disassembler library.
## Features ##
- Supports all x86 and x86-64 (AMD64) General purpose and System instructions.
- Supports all x86 and x86-64 (AMD64) general-purpose and system instructions.
- Supported ISA extensions:
- MMX, FPU (x87), AMD 3DNow
- SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AES,
- AMD-V, INTEL-VMX, SMX
- FPU (x87), MMX
- SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, SSE4A, AESNI
- AVX, AVX2, AVX512BW, AVX512CD, AVX512DQ, AVX512ER, AVX512F, AVX512PF, AVX512VL
- ADX, BMI1, BMI2, FMA, FMA4
- ..
- Optimized for high performance
- Very small overhead compared to other common disassembler libraries (about 60KiB)
- Abstract formatter and symbol-resolver classes for custom syntax implementations.
- Intel syntax is implemented by default
- No dynamic memory allocation
- Perfect for kernel-mode drivers and embedded devices
- Very small file-size overhead compared to other common disassembler libraries
- Language bindings
- C++, Delphi, Python, ..
- Complete doxygen documentation
## Quick Example ##
The following example program uses Zydis to disassemble a given memory buffer and prints the output to the console.
```c++
#include <tchar.h>
#include <iostream>
#include <stdint.h>
#include "Zydis.hpp"
```C
#include <stdio.h>
#include <Zydis/Zydis.h>
int _tmain(int argc, _TCHAR* argv[])
int main()
{
uint8_t data[] =
{
0x90, 0xE9, 0x00, 0x00, 0x00, 0x00, 0xC3
0x51, 0x8D, 0x45, 0xFF, 0x50, 0xFF, 0x75, 0x0C, 0xFF, 0x75,
0x08, 0xFF, 0x15, 0xA0, 0xA5, 0x48, 0x76, 0x85, 0xC0, 0x0F,
0x88, 0xFC, 0xDA, 0x02, 0x00
};
Zydis::MemoryInput input(&data[0], sizeof(data));
Zydis::InstructionInfo info;
Zydis::InstructionDecoder decoder;
decoder.setDisassemblerMode(Zydis::DisassemblerMode::M32BIT);
decoder.setDataSource(&input);
decoder.setInstructionPointer(0);
Zydis::IntelInstructionFormatter formatter;
while (decoder.decodeInstruction(info))
ZydisMemoryInput input;
ZydisInputInitMemoryInput(&input, &data, sizeof(data));
ZydisInstructionDecoder decoder;
ZydisDecoderInitInstructionDecoderEx(&decoder, ZYDIS_DISASSEMBLER_MODE_64BIT,
(ZydisCustomInput*)&input, ZYDIS_DECODER_FLAG_SKIP_DATA);
ZydisDecoderSetInstructionPointer(&decoder, 0x007FFFFFFF400000);
ZydisInstructionFormatter formatter;
ZydisFormatterInitInstructionFormatterEx(&formatter,
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FORMATTER_FLAG_ALWAYS_DISPLAY_MEMORY_SEGMENT);
ZydisInstructionInfo info;
char buffer[256];
while (ZYDIS_SUCCESS(ZydisDecoderDecodeNextInstruction(&decoder, &info)))
{
std::cout << formatter.formatInstruction(info) << std::endl;
printf("%016llX ", info.instrAddress);
if (info.flags & ZYDIS_IFLAG_ERROR_MASK)
{
printf(" db %02x\n", info.data[0]);
continue;
}
ZydisFormatterFormatInstruction(&formatter, &info, &buffer[0], sizeof(buffer));
printf(" %s\n", &buffer[0]);
}
}
```
## Sample Output ##
The above example program generates the following output:
```
007FFFFFFF400000 push rcx
007FFFFFFF400001 lea eax, dword ptr ss:[rbp-0x01]
007FFFFFFF400004 push rax
007FFFFFFF400005 push qword ptr ss:[rbp+0x0C]
007FFFFFFF400008 push qword ptr ss:[rbp+0x08]
007FFFFFFF40000B call qword ptr ds:[0x008000007588A5B1]
007FFFFFFF400011 test eax, eax
007FFFFFFF400013 js 0x007FFFFFFF42DB15
```
## Compilation ##
Zydis builds cleanly on most platforms without any external dependencies. You can use CMake to generate project files for your favorite C++14 compiler.
## Documentation ##
[The HTML Doxygen documentation](https://www.zyantific.com/doc/zydis/index.html) is automatically built from master every 12 hours.
Zydis builds cleanly on most platforms without any external dependencies. You can use CMake to generate project files for your favorite C99 compiler.
## License ##

View File

@ -1,100 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief C++ API include file.
*/
/**
* @mainpage Zyan Disassembler Engine (Zydis)
*
* Zydis is a fast and lightweight x86/x86-64 disassembler library.
*
* @section Features
* - Supports all x86 and x86-64 (AMD64) General purpose and System instructions.
* - Supported ISA extensions:
* - MMX, FPU (x87), AMD 3DNow
* - SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AES,
* - AMD-V, INTEL-VMX, SMX
* - Optimized for high performance
* - Very small overhead compared to other common disassembler libraries (about 60KiB)
* - Abstract formatter and symbol-resolver classes for custom syntax implementations.
* - Intel syntax is implemented by default
* - Complete doxygen documentation
*
* @section Quick Example
* The following example program uses Zydis to disassemble a given memory buffer and prints the
* output to the console.
*
* @code
* #include <tchar.h>
* #include <iostream>
* #include <stdint.h>
* #include "Zydis.hpp"
*
* int _tmain(int argc, _TCHAR* argv[])
* {
* uint8_t data[] =
* {
* 0x90, 0xE9, 0x00, 0x00, 0x00, 0x00, 0xC3
* };
* Zydis::MemoryInput input(&data[0], sizeof(data));
* Zydis::InstructionInfo info;
* Zydis::InstructionDecoder decoder;
* decoder.setDisassemblerMode(Zydis::DisassemblerMode::M32BIT);
* decoder.setDataSource(&input);
* decoder.setInstructionPointer(0);
* Zydis::IntelInstructionFormatter formatter;
* while (decoder.decodeInstruction(info))
* {
* std::cout << formatter.formatInstruction(info) << std::endl;
* }
* }
* @endcode
*
* @section Compilation
* Zydis builds cleanly on most platforms without any external dependencies. You can use CMake
* to generate project files for your favorite C++14 compiler.
*
* @section License
* Zyan Disassembler Engine is licensed under the MIT License. Dependencies are under their
* respective licenses.
*/
#ifndef _ZYDIS_HPP_
#define _ZYDIS_HPP_
#include "ZydisInstructionDecoder.hpp"
#include "ZydisInstructionFormatter.hpp"
#include "ZydisSymbolResolver.hpp"
#include "ZydisUtils.hpp"
#endif /*_ZYDIS_HPP_ */

View File

@ -1,653 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include "ZydisAPI.h"
#include "ZydisInstructionDecoder.hpp"
#include "ZydisInstructionFormatter.hpp"
/* Static Checks ================================================================================ */
static_assert(
sizeof(ZydisOperandInfo) == sizeof(Zydis::OperandInfo),
"struct size mismatch");
static_assert(
sizeof(ZydisInstructionInfo) == sizeof(Zydis::InstructionInfo),
"struct size mismatch");
/* Error Handling =============================================================================== */
static uint32_t g_zydisLastError = ZYDIS_ERROR_SUCCESS;
uint32_t ZydisGetLastError()
{
return g_zydisLastError;
}
void ZydisSetLastError(uint32_t errorCode)
{
g_zydisLastError = errorCode;
}
/* Conversion Helper ============================================================================ */
typedef enum _ZydisClassType
{
ZYDIS_CONTEXT_INPUT = 0x00000080,
ZYDIS_CONTEXT_INPUT_CUSTOM = ZYDIS_CONTEXT_INPUT | 0x00000001,
ZYDIS_CONTEXT_INPUT_MEMORY = ZYDIS_CONTEXT_INPUT | 0x00000002,
ZYDIS_CONTEXT_INSTRUCTIONDECODER = 0x00000040,
ZYDIS_CONTEXT_INSTRUCTIONFORMATTER = 0x00000020,
ZYDIS_CONTEXT_INSTRUCTIONFORMATTER_CUSTOM = ZYDIS_CONTEXT_INSTRUCTIONFORMATTER | 0x00000001,
ZYDIS_CONTEXT_INSTRUCTIONFORMATTER_INTEL = ZYDIS_CONTEXT_INSTRUCTIONFORMATTER | 0x00000002,
ZYDIS_CONTEXT_SYMBOLRESOLVER = 0x00000010,
ZYDIS_CONTEXT_SYMBOLRESOLVER_CUSTOM = ZYDIS_CONTEXT_SYMBOLRESOLVER | 0x00000001,
ZYDIS_CONTEXT_SYMBOLRESOLVER_EXACT = ZYDIS_CONTEXT_SYMBOLRESOLVER | 0x00000002
} ZydisClassType;
/**
* @brief This helper class extends a zydis class with a type field. It is used by the C-bindings
* to check type correctness for input parameters.
* @param ZydisClassT The zydis class type.
*/
#pragma pack(push, 1)
template <typename ZydisClassT>
class ZydisClassEx final
{
private:
using FullClassT = ZydisClassEx<ZydisClassT>;
public:
uint32_t type;
uint32_t align;
std::conditional_t<std::is_abstract<ZydisClassT>::value, char, ZydisClassT> instance;
public:
/**
* @brief Constructor
* @param InstanceCtorArgsT The argument types for the constructor of the zydis class.
* @param classType The type of the zydis class.
* @param args... The arguments for the constructor of the zydis class.
*/
template<
typename ZydisClassTT=ZydisClassT,
std::enable_if_t<!std::is_abstract<ZydisClassTT>::value, int> = 0,
typename... InstanceCtorArgsT>
ZydisClassEx(uint32_t classType, InstanceCtorArgsT... args)
: type(classType)
, align(0)
, instance(args...) { };
public:
/**
* @brief Returns the class type.
* @return The assigned class type.
*/
uint32_t getClassType() const
{
return type;
}
/**
* @brief Returns the zydis class instance.
* @return Pointer to the zydis class instance.
*/
ZydisClassT* getInstance()
{
return reinterpret_cast<ZydisClassT*>(&instance);
}
public:
/**
* @brief Casts the given instance to @c ZydisClassEx.
* @param instance The zydis class instance.
* @return Pointer to the @c ZydisClassEx instance.
*/
static FullClassT* fromInstance(ZydisClassT* instance)
{
return reinterpret_cast<FullClassT*>(
reinterpret_cast<uintptr_t>(instance)
- sizeof(std::declval<FullClassT>().type)
- sizeof(std::declval<FullClassT>().align));
}
};
#pragma pack(pop)
/**
* @brief Creates a context by constructing a new wrapped zydis class instance.
* @param ContextClassT The context class.
* @param ZydisClassT The zydis class type.
* @param ZydisClassCtorArgsT The argument types for the constructor of the zydis class.
* @param classType The type of the zydis class.
* @param args... The arguments for the constructor of the zydis class.
*/
template <typename ContextClassT, typename ZydisClassT, typename... ZydisClassCtorArgsT>
ContextClassT* ZydisCreateContext(uint32_t classType, ZydisClassCtorArgsT... args)
{
auto instanceEx = new (std::nothrow) ZydisClassEx<ZydisClassT>(classType, args...);
if (!instanceEx)
{
ZydisSetLastError(ZYDIS_ERROR_NOT_ENOUGH_MEMORY);
return nullptr;
}
// Return the original instance as context.
return reinterpret_cast<ContextClassT*>(instanceEx->getInstance());
}
/**
* @brief Retrieves the zydis class instance of the given context.
* @param ContextClassT The context class.
* @param ZydisClassT The zydis class type.
* @param expectedType The expected type of the zydis class.
*/
template <typename ContextClassT, typename ZydisClassT>
ZydisClassT* ZydisRetrieveInstance(uint32_t expectedType, const ContextClassT* context)
{
auto instanceEx = ZydisClassEx<ZydisClassT>::fromInstance(
reinterpret_cast<ZydisClassT*>(const_cast<ContextClassT*>(context)));
if ((instanceEx->getClassType() & expectedType) != expectedType)
{
ZydisSetLastError(ZYDIS_ERROR_INVALID_PARAMETER);
return nullptr;
}
// The context points to the same address as the instance. We just need to cast it.
return reinterpret_cast<ZydisClassT*>(const_cast<ContextClassT*>(context));
}
/**
* @brief Creates a context by constructing a new wrapped zydis instance.
* @param ContextClassT The context class.
* @param ZydisClassT The zydis class type.
* @param expectedType The expected type of the zydis class.
*/
template <typename ContextClassT, typename ZydisClassT>
bool ZydisFreeContext(uint32_t expectedType, const ContextClassT* context)
{
auto instanceEx = ZydisClassEx<ZydisClassT>::fromInstance(
reinterpret_cast<ZydisClassT*>(const_cast<ContextClassT*>(context)));
if ((instanceEx->getClassType() & expectedType) != expectedType)
{
ZydisSetLastError(ZYDIS_ERROR_INVALID_PARAMETER);
return false;
}
delete instanceEx;
return true;
}
/* Input ======================================================================================== */
/**
* @brief Helper class for custom input implementations.
*/
class ZydisCustomInput : public Zydis::BaseInput
{
private:
void* m_userData;
ZydisCustomDestructorT m_cbDestructor;
ZydisCustomInputPeekT m_cbPeek;
ZydisCustomInputNextT m_cbNext;
ZydisCustomInputIsEndOfInputT m_cbIsEndOfInput;
ZydisCustomInputGetPositionT m_cbGetPosition;
ZydisCustomInputSetPositionT m_cbSetPosition;
protected:
uint8_t internalInputPeek() override
{
return m_cbPeek(m_userData);
}
uint8_t internalInputNext() override
{
return m_cbNext(m_userData);
}
public:
ZydisCustomInput(void* userData,
ZydisCustomInputPeekT cbPeek, ZydisCustomInputNextT cbNext,
ZydisCustomInputIsEndOfInputT cbIsEndOfInput, ZydisCustomInputGetPositionT cbGetPosition,
ZydisCustomInputSetPositionT cbSetPosition, ZydisCustomDestructorT cbDestructor)
: m_userData(userData)
, m_cbDestructor(cbDestructor)
, m_cbPeek(cbPeek)
, m_cbNext(cbNext)
, m_cbIsEndOfInput(cbIsEndOfInput)
, m_cbGetPosition(cbGetPosition)
, m_cbSetPosition(cbSetPosition)
{
}
~ZydisCustomInput() override
{
if (m_cbDestructor)
{
m_cbDestructor(m_userData);
}
}
public:
bool isEndOfInput() const override
{
return m_cbIsEndOfInput(m_userData);
}
uint64_t getPosition() const override
{
return m_cbGetPosition(m_userData);
}
bool setPosition(uint64_t position) override
{
return m_cbSetPosition(m_userData, position);
}
};
ZydisInputContext* ZydisCreateCustomInput(void* userData,
ZydisCustomInputPeekT cbPeek, ZydisCustomInputNextT cbNext,
ZydisCustomInputIsEndOfInputT cbIsEndOfInput, ZydisCustomInputGetPositionT cbGetPosition,
ZydisCustomInputSetPositionT cbSetPosition, ZydisCustomDestructorT cbDestructor)
{
if (!cbPeek || !cbNext || !cbIsEndOfInput || !cbGetPosition || !cbSetPosition)
{
ZydisSetLastError(ZYDIS_ERROR_INVALID_PARAMETER);
return nullptr;
}
return ZydisCreateContext<ZydisInputContext, ZydisCustomInput>(ZYDIS_CONTEXT_INPUT_CUSTOM,
userData, cbPeek, cbNext, cbIsEndOfInput, cbGetPosition, cbSetPosition, cbDestructor);
}
ZydisInputContext* ZydisCreateMemoryInput(const void* buffer, size_t bufferLen)
{
return ZydisCreateContext<ZydisInputContext, Zydis::MemoryInput>(
ZYDIS_CONTEXT_INPUT_MEMORY, buffer, bufferLen);
}
bool ZydisIsEndOfInput(const ZydisInputContext* input, bool* isEndOfInput)
{
Zydis::BaseInput* instance =
ZydisRetrieveInstance<ZydisInputContext, Zydis::BaseInput>(ZYDIS_CONTEXT_INPUT, input);
if (!instance)
{
return false;
}
*isEndOfInput = instance->isEndOfInput();
return true;
}
bool ZydisGetInputPosition(const ZydisInputContext* input, uint64_t* position)
{
Zydis::BaseInput* instance =
ZydisRetrieveInstance<ZydisInputContext, Zydis::BaseInput>(ZYDIS_CONTEXT_INPUT, input);
if (!instance)
{
return false;
}
*position = instance->getPosition();
return true;
}
bool ZydisSetInputPosition(const ZydisInputContext* input, uint64_t position)
{
Zydis::BaseInput* instance =
ZydisRetrieveInstance<ZydisInputContext, Zydis::BaseInput>(ZYDIS_CONTEXT_INPUT, input);
if (!instance)
{
return false;
}
ZydisSetLastError(ZYDIS_ERROR_SUCCESS);
return instance->setPosition(position);
}
bool ZydisFreeInput(const ZydisInputContext* input)
{
return ZydisFreeContext<ZydisInputContext, Zydis::BaseInput>(ZYDIS_CONTEXT_INPUT, input);
}
/* InstructionDecoder =========================================================================== */
ZydisInstructionDecoderContext* ZydisCreateInstructionDecoder()
{
return ZydisCreateContext<ZydisInstructionDecoderContext, Zydis::InstructionDecoder>(
ZYDIS_CONTEXT_INSTRUCTIONDECODER);
}
ZydisInstructionDecoderContext* ZydisCreateInstructionDecoderEx(
const ZydisInputContext* input, ZydisDisassemblerMode disassemblerMode,
ZydisInstructionSetVendor preferredVendor, uint64_t instructionPointer)
{
Zydis::BaseInput* object =
ZydisRetrieveInstance<ZydisInputContext, Zydis::BaseInput>(ZYDIS_CONTEXT_INPUT, input);
if (!object)
{
return nullptr;
}
return ZydisCreateContext<ZydisInstructionDecoderContext, Zydis::InstructionDecoder>(
ZYDIS_CONTEXT_INSTRUCTIONDECODER, object,
static_cast<Zydis::DisassemblerMode>(disassemblerMode),
static_cast<Zydis::InstructionSetVendor>(preferredVendor), instructionPointer);
}
bool ZydisDecodeInstruction(const ZydisInstructionDecoderContext* decoder,
ZydisInstructionInfo* info)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
ZydisSetLastError(ZYDIS_ERROR_SUCCESS);
return instance->decodeInstruction(*reinterpret_cast<Zydis::InstructionInfo*>(info));
}
bool ZydisGetDataSource(const ZydisInstructionDecoderContext* decoder,
ZydisInputContext** input)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
*input = reinterpret_cast<ZydisInputContext*>(instance->getDataSource());
if (!input)
{
return false;
}
return true;
}
bool ZydisSetDataSource(const ZydisInstructionDecoderContext* decoder,
ZydisInputContext* input)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
Zydis::BaseInput* object =
ZydisRetrieveInstance<ZydisInputContext, Zydis::BaseInput>(ZYDIS_CONTEXT_INPUT, input);
if (!object)
{
return false;
}
instance->setDataSource(object);
return true;
}
bool ZydisGetDisassemblerMode(const ZydisInstructionDecoderContext* decoder,
ZydisDisassemblerMode* disassemblerMode)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
*disassemblerMode = static_cast<ZydisDisassemblerMode>(instance->getDisassemblerMode());
return true;
}
bool ZydisSetDisassemblerMode(const ZydisInstructionDecoderContext* decoder,
ZydisDisassemblerMode disassemblerMode)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
instance->setDisassemblerMode(static_cast<Zydis::DisassemblerMode>(disassemblerMode));
return true;
}
bool ZydisGetPreferredVendor(const ZydisInstructionDecoderContext* decoder,
ZydisInstructionSetVendor* preferredVendor)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
*preferredVendor = static_cast<ZydisInstructionSetVendor>(instance->getPreferredVendor());
return true;
}
bool ZydisSetPreferredVendor(const ZydisInstructionDecoderContext* decoder,
ZydisInstructionSetVendor preferredVendor)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
instance->setPreferredVendor(static_cast<Zydis::InstructionSetVendor>(preferredVendor));
return true;
}
bool ZydisGetInstructionPointer(const ZydisInstructionDecoderContext* decoder,
uint64_t* instructionPointer)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
*instructionPointer = instance->getInstructionPointer();
return true;
}
bool ZydisSetInstructionPointer(const ZydisInstructionDecoderContext* decoder,
uint64_t instructionPointer)
{
Zydis::InstructionDecoder* instance =
ZydisRetrieveInstance<ZydisInstructionDecoderContext,
Zydis::InstructionDecoder>(ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
if (!instance)
{
return false;
}
instance->setInstructionPointer(instructionPointer);
return true;
}
bool ZydisFreeInstructionDecoder(const ZydisInstructionDecoderContext* decoder)
{
return ZydisFreeContext<ZydisInstructionDecoderContext, Zydis::InstructionDecoder>(
ZYDIS_CONTEXT_INSTRUCTIONDECODER, decoder);
}
/* InstructionFormatter ========================================================================= */
ZydisInstructionFormatterContext* ZydisCreateCustomInstructionFormatter(/* TODO */)
{
return nullptr;
}
ZydisInstructionFormatterContext* ZydisCreateIntelInstructionFormatter()
{
return ZydisCreateContext<ZydisInstructionFormatterContext,
Zydis::IntelInstructionFormatter>(ZYDIS_CONTEXT_INSTRUCTIONFORMATTER_INTEL);
}
bool ZydisFormatInstruction(const ZydisInstructionFormatterContext* formatter,
const ZydisInstructionInfo* info, const char** instructionText)
{
Zydis::BaseInstructionFormatter* instance =
ZydisRetrieveInstance<ZydisInstructionFormatterContext,
Zydis::BaseInstructionFormatter>(ZYDIS_CONTEXT_INSTRUCTIONFORMATTER, formatter);
if (!instance)
{
return false;
}
*instructionText =
instance->formatInstruction(*reinterpret_cast<const Zydis::InstructionInfo*>(info));
return true;
}
bool ZydisGetSymbolResolver(const ZydisInstructionFormatterContext* formatter,
ZydisSymbolResolverContext** resolver)
{
Zydis::BaseInstructionFormatter* instance =
ZydisRetrieveInstance<ZydisInstructionFormatterContext,
Zydis::BaseInstructionFormatter>(ZYDIS_CONTEXT_INSTRUCTIONFORMATTER, formatter);
if (!instance)
{
return false;
}
*resolver = reinterpret_cast<ZydisSymbolResolverContext*>(instance->getSymbolResolver());
if (!resolver)
{
return false;
}
return true;
}
bool ZydisSetSymbolResolver(const ZydisInstructionFormatterContext* formatter,
ZydisSymbolResolverContext* resolver)
{
Zydis::BaseInstructionFormatter* instance =
ZydisRetrieveInstance<ZydisInstructionFormatterContext,
Zydis::BaseInstructionFormatter>(ZYDIS_CONTEXT_INSTRUCTIONFORMATTER, formatter);
if (!instance)
{
return false;
}
Zydis::BaseSymbolResolver* object =
ZydisRetrieveInstance<ZydisSymbolResolverContext,
Zydis::BaseSymbolResolver>(ZYDIS_CONTEXT_SYMBOLRESOLVER, resolver);
if (!object)
{
return false;
}
instance->setSymbolResolver(object);
return true;
}
bool ZydisFreeInstructionFormatter(const ZydisInstructionFormatterContext* formatter)
{
return ZydisFreeContext<ZydisInstructionFormatterContext, Zydis::BaseInstructionFormatter>(
ZYDIS_CONTEXT_INSTRUCTIONFORMATTER, formatter);
}
/* SymbolResolver =============================================================================== */
ZydisSymbolResolverContext* ZydisCreateCustomSymbolResolver(/*TODO*/)
{
return nullptr;
}
ZydisSymbolResolverContext* ZydisCreateExactSymbolResolver()
{
return ZydisCreateContext<ZydisSymbolResolverContext, Zydis::ExactSymbolResolver>(
ZYDIS_CONTEXT_SYMBOLRESOLVER_EXACT);
}
bool ZydisResolveSymbol(const ZydisSymbolResolverContext* resolver,
const ZydisInstructionInfo* info, uint64_t address, const char** symbol, uint64_t* offset)
{
Zydis::BaseSymbolResolver* instance =
ZydisRetrieveInstance<ZydisSymbolResolverContext,
Zydis::BaseSymbolResolver>(ZYDIS_CONTEXT_SYMBOLRESOLVER, resolver);
if (!instance)
{
return false;
}
*symbol = instance->resolveSymbol(*reinterpret_cast<const Zydis::InstructionInfo*>(info),
address, *offset);
return true;
}
bool ZydisExactSymbolResolverContainsSymbol(
const ZydisSymbolResolverContext* resolver, uint64_t address, bool* containsSymbol)
{
Zydis::ExactSymbolResolver* instance =
ZydisRetrieveInstance<ZydisSymbolResolverContext,
Zydis::ExactSymbolResolver>(ZYDIS_CONTEXT_SYMBOLRESOLVER_EXACT, resolver);
if (!instance)
{
return false;
}
*containsSymbol = instance->containsSymbol(address);
return true;
}
bool ZydisExactSymbolResolverSetSymbol(const ZydisSymbolResolverContext* resolver,
uint64_t address, const char* name)
{
Zydis::ExactSymbolResolver* instance =
ZydisRetrieveInstance<ZydisSymbolResolverContext,
Zydis::ExactSymbolResolver>(ZYDIS_CONTEXT_SYMBOLRESOLVER_EXACT, resolver);
if (!instance)
{
return false;
}
instance->setSymbol(address, name);
return true;
}
bool ZydisExactSymbolResolverRemoveSymbol(const ZydisSymbolResolverContext* resolver,
uint64_t address)
{
Zydis::ExactSymbolResolver* instance =
ZydisRetrieveInstance<ZydisSymbolResolverContext,
Zydis::ExactSymbolResolver>(ZYDIS_CONTEXT_SYMBOLRESOLVER_EXACT, resolver);
if (!instance)
{
return false;
}
instance->removeSymbol(address);
return true;
}
bool ZydisExactSymbolResolverClear(const ZydisSymbolResolverContext* resolver)
{
Zydis::ExactSymbolResolver* instance =
ZydisRetrieveInstance<ZydisSymbolResolverContext,
Zydis::ExactSymbolResolver>(ZYDIS_CONTEXT_SYMBOLRESOLVER_EXACT, resolver);
if (!instance)
{
return false;
}
instance->clear();
return true;
}
bool ZydisFreeSymbolResolver(const ZydisSymbolResolverContext* resolver)
{
return ZydisFreeContext<ZydisSymbolResolverContext, Zydis::BaseSymbolResolver>(
ZYDIS_CONTEXT_SYMBOLRESOLVER, resolver);
}
/* ============================================================================================== */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,728 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief Instruction decoder classes.
*/
#ifndef _ZYDIS_INSTRUCTIONDECODER_HPP_
#define _ZYDIS_INSTRUCTIONDECODER_HPP_
#include <type_traits>
#include <istream>
#include "ZydisTypes.hpp"
namespace Zydis
{
/* BaseInput ==================================================================================== */
/**
* @brief The base class for all data-source implementations.
*/
class BaseInput
{
friend class InstructionDecoder;
private:
uint8_t m_currentInput;
private:
/**
* @brief Reads the next byte from the data source. This method does NOT increase the
* current input position or the @c length field of the @c info parameter.
* @param info The instruction info.
* @return The current input byte. If the result is zero, you should always check the
* @c flags field of the @c info parameter for error flags.
* Possible error values are @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH.
*/
uint8_t inputPeek(InstructionInfo& info);
/**
* @brief Reads the next byte from the data source. This method increases the current
* input position and the @c length field of the @c info parameter.
* This method also appends the new byte to to @c data field of the @c info
* parameter.
* @param info The instruction info.
* @return The current input byte. If the result is zero, you should always check the
* @c flags field of the @c info parameter for error flags.
* Possible error values are @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH.
*/
uint8_t inputNext(InstructionInfo& info);
/**
* @brief Reads the next byte(s) from the data source. This method increases the current
* input position and the @c length field of the @c info parameter.
* This method also appends the new byte(s) to to @c data field of the @c info
* parameter.
* @param info The instruction info.
* @return The current input data. If the result is zero, you should always check the
* @c flags field of the @c info parameter for error flags.
* Possible error values are @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH.
*/
template <typename T>
T inputNext(InstructionInfo& info);
/**
* @brief Returns the current input byte. The current input byte is set everytime the
* @c inputPeek or @c inputNext method is called.
* @return The current input byte.
*/
uint8_t inputCurrent() const;
protected:
/**
* @brief Override this method in your custom data source implementations.
* Reads the next byte from the data source. This method increases the current
* input position by one.
* @return The current input byte.
*/
virtual uint8_t internalInputPeek() = 0;
/**
* @brief Override this method in your custom data source implementations.
* Reads the next byte from the data source. This method does NOT increase the
* current input position.
* @return The current input byte.
*/
virtual uint8_t internalInputNext() = 0;
protected:
/**
* @brief Default constructor.
*/
BaseInput() { };
public:
/**
* @brief Destructor.
*/
virtual ~BaseInput() { };
public:
/**
* @brief Override this method in your custom data source implementations.
* Signals, if the end of the data source is reached.
* @return True if end of input, false if not.
*/
virtual bool isEndOfInput() const = 0;
/**
* @brief Override this method in your custom data source implementations.
* Returns the current input position.
* @return The current input position.
*/
virtual uint64_t getPosition() const = 0;
/**
* @brief Override this method in your custom data source implementations.
* Sets a new input position.
* @param position The new input position.
* @return Returns false, if the new position exceeds the maximum input length.
*/
virtual bool setPosition(uint64_t position) = 0;
};
inline uint8_t BaseInput::inputPeek(InstructionInfo& info)
{
if (info.length == 15)
{
info.flags |= IF_ERROR_LENGTH;
return 0;
}
if (isEndOfInput())
{
info.flags |= IF_ERROR_END_OF_INPUT;
return 0;
}
m_currentInput = internalInputPeek();
return m_currentInput;
}
inline uint8_t BaseInput::inputNext(InstructionInfo& info)
{
if (info.length == 15)
{
info.flags |= IF_ERROR_LENGTH;
return 0;
}
if (isEndOfInput())
{
info.flags |= IF_ERROR_END_OF_INPUT;
return 0;
}
m_currentInput = internalInputNext();
info.data[info.length] = m_currentInput;
info.length++;
return m_currentInput;
}
template <typename T>
inline T BaseInput::inputNext(InstructionInfo& info)
{
static_assert(std::is_integral<T>::value, "integral type required");
T result = 0;
for (unsigned i = 0; i < (sizeof(T) / sizeof(uint8_t)); ++i)
{
T b = inputNext(info);
if (!b && (info.flags & IF_ERROR_MASK))
{
return 0;
}
result |= (b << (i * 8));
}
return result;
}
inline uint8_t BaseInput::inputCurrent() const
{
return m_currentInput;
}
/* MemoryInput ================================================================================== */
/**
* @brief A memory-buffer based data source for the @c InstructionDecoder class.
*/
class MemoryInput : public BaseInput
{
private:
const void* m_inputBuffer;
uint64_t m_inputBufferLen;
uint64_t m_inputBufferPos;
protected:
/**
* @brief Reads the next byte from the data source. This method increases the current
* input position by one.
* @return The current input byte.
*/
uint8_t internalInputPeek() override;
/**
* @brief Reads the next byte from the data source. This method does NOT increase the
* current input position.
* @return The current input byte.
*/
uint8_t internalInputNext() override;
public:
/**
* @brief Constructor.
* @param buffer The input buffer.
* @param bufferLen The length of the input buffer.
*/
MemoryInput(const void* buffer, size_t bufferLen)
: m_inputBuffer(buffer)
, m_inputBufferLen(bufferLen)
, m_inputBufferPos(0) { };
public:
/**
* @brief Signals, if the end of the data source is reached.
* @return True if end of input, false if not.
*/
bool isEndOfInput() const override;
/**
* @brief Returns the current input position.
* @return The current input position.
*/
uint64_t getPosition() const override;
/**
* @brief Sets a new input position.
* @param position The new input position.
* @return Returns false, if the new position exceeds the maximum input length.
*/
bool setPosition(uint64_t position) override;
};
inline uint8_t MemoryInput::internalInputPeek()
{
return *(static_cast<const uint8_t*>(m_inputBuffer) + m_inputBufferPos);
}
inline uint8_t MemoryInput::internalInputNext()
{
++m_inputBufferPos;
return *(static_cast<const uint8_t*>(m_inputBuffer) + m_inputBufferPos - 1);
}
inline bool MemoryInput::isEndOfInput() const
{
return (m_inputBufferPos >= m_inputBufferLen);
}
inline uint64_t MemoryInput::getPosition() const
{
return m_inputBufferPos;
}
inline bool MemoryInput::setPosition(uint64_t position)
{
m_inputBufferPos = position;
return isEndOfInput();
}
/* StreamInput ================================================================================== */
/**
* @brief A stream based data source for the @c InstructionDecoder class.
*/
class StreamInput : public BaseInput
{
private:
std::istream* m_inputStream;
protected:
/**
* @brief Reads the next byte from the data source. This method increases the current
* input position by one.
* @return The current input byte.
*/
uint8_t internalInputPeek() override;
/**
* @brief Reads the next byte from the data source. This method does NOT increase the
* current input position.
* @return The current input byte.
*/
uint8_t internalInputNext() override;
public:
/**
* @brief Constructor.
* @param stream The input stream.
*/
explicit StreamInput(std::istream* stream)
: m_inputStream(stream) { };
public:
/**
* @brief Signals, if the end of the data source is reached.
* @return True if end of input, false if not.
*/
bool isEndOfInput() const override;
/**
* @brief Returns the current input position.
* @return The current input position.
*/
uint64_t getPosition() const override;
/**
* @brief Sets a new input position.
* @param position The new input position.
* @return Returns false, if the new position exceeds the maximum input length.
*/
bool setPosition(uint64_t position) override;
};
inline uint8_t StreamInput::internalInputPeek()
{
if (!m_inputStream)
{
return 0;
}
return static_cast<uint8_t>(m_inputStream->peek());
}
inline uint8_t StreamInput::internalInputNext()
{
if (!m_inputStream)
{
return 0;
}
return static_cast<uint8_t>(m_inputStream->get());
}
inline bool StreamInput::isEndOfInput() const
{
if (!m_inputStream)
{
return true;
}
// We use good() instead of eof() to make sure the decoding will fail, if an stream internal
// error occured.
return !m_inputStream->good();
}
inline uint64_t StreamInput::getPosition() const
{
if (!m_inputStream)
{
return 0;
}
return m_inputStream->tellg();
}
inline bool StreamInput::setPosition(uint64_t position)
{
if (!m_inputStream)
{
return false;
}
m_inputStream->seekg(position);
return isEndOfInput();
}
/* Enums ======================================================================================== */
/**
* @brief Values that represent a disassembler mode.
*/
enum class DisassemblerMode : uint8_t
{
M16BIT,
M32BIT,
M64BIT
};
/**
* @brief Values that represent an instruction-set vendor.
*/
enum class InstructionSetVendor : uint8_t
{
ANY,
INTEL,
AMD
};
/* InstructionDecoder =========================================================================== */
/**
* @brief The @c InstructionDecoder class decodes x86/x86-64 assembly instructions from a
* given data source.
*/
class InstructionDecoder
{
private:
enum class RegisterClass : uint8_t
{
GENERAL_PURPOSE,
MMX,
CONTROL,
DEBUG,
SEGMENT,
XMM
};
private:
BaseInput* m_input;
DisassemblerMode m_disassemblerMode;
InstructionSetVendor m_preferredVendor;
uint64_t m_instructionPointer;
private:
/**
* @brief Reads the next byte from the data source. This method does NOT increase the
* current input position or the @c length field of the @c info parameter.
* @param info The instruction info.
* @return The current input byte. If the result is zero, you should always check the
* @c flags field of the @c info parameter for error flags.
* Possible error values are @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH.
*/
uint8_t inputPeek(InstructionInfo& info);
/**
* @brief Reads the next byte from the data source. This method increases the current
* input position and the @c length field of the @info parameter.
* This method also appends the new byte to to @c data field of the @c info
* parameter.
* @param info The instruction info.
* @return The current input byte. If the result is zero, you should always check the
* @c flags field of the @c info parameter for error flags.
* Possible error values are @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH.
*/
uint8_t inputNext(InstructionInfo& info);
/**
* @brief Reads the next byte(s) from the data source. This method increases the current
* input position and the @c length field of the @info parameter.
* This method also appends the new byte(s) to to @c data field of the @c info
* parameter.
* @param info The instruction info.
* @return The current input data. If the result is zero, you should always check the
* @c flags field of the @c info parameter for error flags.
* Possible error values are @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH.
*/
template <typename T>
T inputNext(InstructionInfo& info);
/**
* @brief Returns the current input byte. The current input byte is set everytime the
* @c inputPeek or @c inputNext method is called.
* @return The current input byte.
*/
uint8_t inputCurrent() const;
private:
/**
* @brief Decodes a register operand.
* @param info The instruction info.
* @param operand The @c OperandInfo struct that receives the decoded data.
* @param registerClass The register class to use.
* @param registerId The register id.
* @param operandSize The defined size of the operand.
* @return True if it succeeds, false if it fails.
*/
bool decodeRegisterOperand(InstructionInfo& info, OperandInfo& operand,
RegisterClass registerClass, uint8_t registerId, DefinedOperandSize operandSize) const;
/**
* @brief Decodes a register/memory operand.
* @param info The instruction info.
* @param operand The @c OperandInfo struct that receives the decoded data.
* @param registerClass The register class to use.
* @param operandSize The defined size of the operand.
* @return True if it succeeds, false if it fails.
*/
bool decodeRegisterMemoryOperand(InstructionInfo& info, OperandInfo& operand,
RegisterClass registerClass, DefinedOperandSize operandSize);
/**
* @brief Decodes an immediate operand.
* @param info The instruction info.
* @param operand The @c OperandInfo struct that receives the decoded data.
* @param operandSize The defined size of the operand.
* @return True if it succeeds, false if it fails.
*/
bool decodeImmediate(InstructionInfo& info, OperandInfo& operand,
DefinedOperandSize operandSize);
/**
* @brief Decodes a displacement operand.
* @param info The instruction info.
* @param operand The @c OperandInfo struct that receives the decoded data.
* @param size The size of the displacement data.
* @return True if it succeeds, false if it fails.
*/
bool decodeDisplacement(InstructionInfo& info, OperandInfo& operand, uint8_t size);
private:
/**
* @brief Decodes the modrm field of the instruction. This method reads an additional
* input byte.
* @param The @c InstructionInfo struct that receives the decoded data.
* @return True if it succeeds, false if it fails.
*/
bool decodeModrm(InstructionInfo& info);
/**
* @brief Decodes the sib field of the instruction. This method reads an additional
* input byte.
* @param info The @c InstructionInfo struct that receives the decoded data.
* @return True if it succeeds, false if it fails.
*/
bool decodeSIB(InstructionInfo& info);
/**
* @brief Decodes vex prefix of the instruction. This method takes the current input byte
* to determine the vex prefix type and reads one or two additional input bytes
* on demand.
* @param info The @c InstructionInfo struct that receives the decoded data.
* @return True if it succeeds, false if it fails.
*/
bool decodeVex(InstructionInfo& info);
private:
/**
* @brief Returns the effective operand size.
* @param info The instruction info.
* @param operandSize The defined operand size.
* @return The effective operand size.
*/
uint16_t getEffectiveOperandSize(const InstructionInfo& info,
DefinedOperandSize operandSize) const;
/**
* @brief Decodes all instruction operands.
* @param info The @c InstructionInfo struct that receives the decoded data.
* @return True if it succeeds, false if it fails.
*/
bool decodeOperands(InstructionInfo& info);
/**
* @brief Decodes the specified instruction operand.
* @param info The instruction info.
* @param operand The @c OperandInfo struct that receives the decoded data.
* @param operandType The defined type of the operand.
* @param operandSize The defined size of the operand.
* @return True if it succeeds, false if it fails.
*/
bool decodeOperand(InstructionInfo& info, OperandInfo& operand,
DefinedOperandType operandType, DefinedOperandSize operandSize);
private:
/**
* @brief Resolves the effective operand and address mode of the instruction.
* This method requires a non-null value in the @c instrDefinition field of the
* @c info struct.
* @param info The @c InstructionInfo struct that receives the effective operand and
* address mode.
*/
void resolveOperandAndAddressMode(InstructionInfo& info) const;
/**
* @brief Calculates the effective REX/VEX.w, r, x, b, l values.
* This method requires a non-null value in the @c instrDefinition field of the
* @c info struct.
* @param info The @c InstructionInfo struct that receives the effective operand and
* address mode.
*/
void calculateEffectiveRexVexValues(InstructionInfo& info) const;
private:
/**
* @brief Collects and decodes optional instruction prefixes.
* @param info The @c InstructionInfo struct that receives the decoded data.
* @return True if it succeeds, false if it fails.
*/
bool decodePrefixes(InstructionInfo& info);
/**
* @brief Collects and decodes the instruction opcodes using the opcode tree.
* @param info The @c InstructionInfo struct that receives the decoded data.
* @return True if it succeeds, false if it fails.
*/
bool decodeOpcode(InstructionInfo& info);
public:
/**
* @brief Default constructor.
*/
InstructionDecoder();
/**
* @brief Constructor.
* @param input A reference to the input data source.
* @param disassemblerMode The disasasembler mode.
* @param preferredVendor The preferred instruction-set vendor.
* @param instructionPointer The initial instruction pointer.
*/
explicit InstructionDecoder(BaseInput* input,
DisassemblerMode disassemblerMode = DisassemblerMode::M32BIT,
InstructionSetVendor preferredVendor = InstructionSetVendor::ANY,
uint64_t instructionPointer = 0);
public:
/**
* @brief Decodes the next instruction from the input data source.
* @param info The @c InstructionInfo struct that receives the information about the
* decoded instruction.
* @return This method returns false, if the current position has exceeded the maximum input
* length.
* In all other cases (valid and invalid instructions) the return value is true.
*/
bool decodeInstruction(InstructionInfo& info);
public:
/**
* @brief Returns a pointer to the current data source.
* @return A pointer to the current data source.
*/
BaseInput* getDataSource() const;
/**
* @brief Sets a new data source.
* @param input A reference to the new input data source.
*/
void setDataSource(BaseInput* input);
/**
* @brief Returns the current disassembler mode.
* @return The current disassembler mode.
*/
DisassemblerMode getDisassemblerMode() const;
/**
* @brief Sets the current disassembler mode.
* @param disassemblerMode The new disassembler mode.
*/
void setDisassemblerMode(DisassemblerMode disassemblerMode);
/**
* @brief Returns the preferred instruction-set vendor.
* @return The preferred instruction-set vendor.
*/
InstructionSetVendor getPreferredVendor() const;
/**
* @brief Sets the preferred instruction-set vendor.
* @param preferredVendor The new preferred instruction-set vendor.
*/
void setPreferredVendor(InstructionSetVendor preferredVendor);
/**
* @brief Returns the current instruction pointer.
* @return The current instruction pointer.
*/
uint64_t getInstructionPointer() const;
/**
* @brief Sets a new instruction pointer.
* @param instructionPointer The new instruction pointer.
*/
void setInstructionPointer(uint64_t instructionPointer);
};
inline uint8_t InstructionDecoder::inputPeek(InstructionInfo& info)
{
if (!m_input)
{
info.flags |= IF_ERROR_END_OF_INPUT;
return 0;
}
return m_input->inputPeek(info);
}
inline uint8_t InstructionDecoder::inputNext(InstructionInfo& info)
{
if (!m_input)
{
info.flags |= IF_ERROR_END_OF_INPUT;
return 0;
}
return m_input->inputNext(info);
}
template <typename T>
inline T InstructionDecoder::inputNext(InstructionInfo& info)
{
if (!m_input)
{
info.flags |= IF_ERROR_END_OF_INPUT;
return 0;
}
return m_input->inputNext<T>(info);
}
inline uint8_t InstructionDecoder::inputCurrent() const
{
if (!m_input)
{
return 0;
}
return m_input->inputCurrent();
}
inline BaseInput *InstructionDecoder::getDataSource() const
{
return m_input;
}
inline void InstructionDecoder::setDataSource(BaseInput* input)
{
m_input = input;
}
inline DisassemblerMode InstructionDecoder::getDisassemblerMode() const
{
return m_disassemblerMode;
}
inline void InstructionDecoder::setDisassemblerMode(DisassemblerMode disassemblerMode)
{
m_disassemblerMode = disassemblerMode;
}
inline InstructionSetVendor InstructionDecoder::getPreferredVendor() const
{
return m_preferredVendor;
}
inline void InstructionDecoder::setPreferredVendor(InstructionSetVendor preferredVendor)
{
m_preferredVendor = preferredVendor;
}
inline uint64_t InstructionDecoder::getInstructionPointer() const
{
return m_instructionPointer;
}
inline void InstructionDecoder::setInstructionPointer(uint64_t instructionPointer)
{
m_instructionPointer = instructionPointer;
}
/* ============================================================================================== */
}
#endif /* _ZYDIS_INSTRUCTIONDECODER_HPP_ */

View File

@ -1,602 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include "ZydisInstructionFormatter.hpp"
#include "ZydisUtils.hpp"
#include <cstdarg>
#include <cctype>
#include <cstdio>
#include <cstring>
namespace Zydis
{
/* BaseInstructionFormatter ================================================================ */
const char* BaseInstructionFormatter::m_registerStrings[] =
{
/* 8 bit general purpose registers */
"al", "cl", "dl", "bl",
"ah", "ch", "dh", "bh",
"spl", "bpl", "sil", "dil",
"r8b", "r9b", "r10b", "r11b",
"r12b", "r13b", "r14b", "r15b",
/* 16 bit general purpose registers */
"ax", "cx", "dx", "bx",
"sp", "bp", "si", "di",
"r8w", "r9w", "r10w", "r11w",
"r12w", "r13w", "r14w", "r15w",
/* 32 bit general purpose registers */
"eax", "ecx", "edx", "ebx",
"esp", "ebp", "esi", "edi",
"r8d", "r9d", "r10d", "r11d",
"r12d", "r13d", "r14d", "r15d",
/* 64 bit general purpose registers */
"rax", "rcx", "rdx", "rbx",
"rsp", "rbp", "rsi", "rdi",
"r8", "r9", "r10", "r11",
"r12", "r13", "r14", "r15",
/* segment registers */
"es", "cs", "ss",
"ds", "fs", "gs",
/* control registers */
"cr0", "cr1", "cr2", "cr3",
"cr4", "cr5", "cr6", "cr7",
"cr8", "cr9", "cr10", "cr11",
"cr12", "cr13", "cr14", "cr15",
/* debug registers */
"dr0", "dr1", "dr2", "dr3",
"dr4", "dr5", "dr6", "dr7",
"dr8", "dr9", "dr10", "dr11",
"dr12", "dr13", "dr14", "dr15",
/* mmx registers */
"mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7",
/* x87 registers */
"st0", "st1", "st2", "st3",
"st4", "st5", "st6", "st7",
/* extended multimedia registers */
"xmm0", "xmm1", "xmm2", "xmm3",
"xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11",
"xmm12", "xmm13", "xmm14", "xmm15",
/* 256 bit multimedia registers */
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm8", "ymm9", "ymm10", "ymm11",
"ymm12", "ymm13", "ymm14", "ymm15",
/* instruction pointer register */
"rip"
};
void BaseInstructionFormatter::internalFormatInstruction(const InstructionInfo& /*info*/)
{
// Nothing to do here
}
BaseInstructionFormatter::BaseInstructionFormatter()
: m_symbolResolver(nullptr)
, m_outputStringLen(0)
, m_outputUppercase(false)
{
}
BaseInstructionFormatter::BaseInstructionFormatter(
BaseSymbolResolver *symbolResolver)
: m_symbolResolver(symbolResolver)
, m_outputStringLen(0)
, m_outputUppercase(false)
{
}
const char* BaseInstructionFormatter::formatInstruction(const InstructionInfo& info)
{
// Clears the internal string buffer
outputClear();
// Calls the virtual format method that actually formats the instruction
internalFormatInstruction(info);
if (m_outputBuffer.size() == 0)
{
// The basic instruction formatter only returns the instruction menmonic.
return Internal::GetInstructionMnemonicString(info.mnemonic);
}
// Return the formatted instruction string
return outputString();
}
BaseInstructionFormatter::~BaseInstructionFormatter()
{
}
void BaseInstructionFormatter::outputClear()
{
m_outputStringLen = 0;
}
char const *BaseInstructionFormatter::outputString()
{
return& m_outputBuffer[0];
}
void BaseInstructionFormatter::outputAppend(char const* text)
{
// Get the string length including the null-terminator char
size_t strLen = strlen(text) + 1;
// Get the buffer size
size_t bufLen = m_outputBuffer.size();
// Decrease the offset by one, to exclude already existing null-terminator chars in the
// output buffer
size_t offset = (m_outputStringLen) ? m_outputStringLen - 1 : 0;
// Resize capacity of the output buffer on demand and add some extra space to improve the
// performance
if (bufLen <= (m_outputStringLen + strLen))
{
m_outputBuffer.resize(bufLen + strLen + 512);
}
// Write the text to the output buffer
memcpy(&m_outputBuffer[offset], text, strLen);
// Increase the string length
m_outputStringLen = offset + strLen;
// Convert to uppercase
if (m_outputUppercase)
{
for (size_t i = offset; i < m_outputStringLen - 1; ++i)
{
m_outputBuffer[i] = static_cast<char>(toupper(m_outputBuffer[i]));
}
}
}
void BaseInstructionFormatter::outputAppendFormatted(char const* format, ...)
{
va_list arguments;
va_start(arguments, format);
// Get the buffer size
size_t bufLen = m_outputBuffer.size();
// Decrease the offset by one, to exclude already existing null-terminator chars in the
// output buffer
size_t offset = (m_outputStringLen) ? m_outputStringLen - 1 : 0;
// Resize the output buffer on demand and add some extra space to improve the performance
if ((bufLen - m_outputStringLen) < 256)
{
bufLen = bufLen + 512;
m_outputBuffer.resize(bufLen);
}
int strLen = 0;
do
{
// If the formatted text did not fit in the output buffer, resize it, and try again
if (strLen < 0)
{
m_outputBuffer.resize(bufLen + 512);
return outputAppendFormatted(format, arguments);
}
// Write the formatted text to the output buffer
assert((bufLen - offset) > 0);
strLen = std::vsnprintf(&m_outputBuffer[offset], bufLen - offset, format, arguments);
} while (strLen < 0);
// Increase the string length
m_outputStringLen = offset + strLen + 1;
// Convert to uppercase
if (m_outputUppercase)
{
for (size_t i = offset; i < m_outputStringLen - 1; ++i)
{
m_outputBuffer[i] = static_cast<char>(toupper(m_outputBuffer[i]));
}
}
va_end(arguments);
}
void BaseInstructionFormatter::outputAppendAddress(const InstructionInfo& info,
uint64_t address, bool resolveSymbols)
{
uint64_t offset = 0;
const char *name = nullptr;
if (resolveSymbols)
{
name = resolveSymbol(info, address, offset);
}
if (name)
{
if (offset)
{
outputAppendFormatted("%s+%.2llX", name, offset);
} else
{
outputAppend(name);
}
} else
{
if (info.flags & IF_DISASSEMBLER_MODE_16)
{
outputAppendFormatted("%.4X", address);
} else if (info.flags & IF_DISASSEMBLER_MODE_32)
{
outputAppendFormatted("%.8lX", address);
} else if (info.flags & IF_DISASSEMBLER_MODE_64)
{
outputAppendFormatted("%.16llX", address);
} else
{
assert(0);
}
}
}
void BaseInstructionFormatter::outputAppendImmediate(const InstructionInfo& info,
const OperandInfo& operand, bool resolveSymbols)
{
assert(operand.type == OperandType::IMMEDIATE);
uint64_t value = 0;
if (operand.signed_lval&& (operand.size != info.operand_mode))
{
if (operand.size == 8)
{
value = static_cast<int64_t>(operand.lval.sbyte);
} else
{
assert(operand.size == 32);
value = static_cast<int64_t>(operand.lval.sdword);
}
if (info.operand_mode < 64)
{
value = value& ((1ull << info.operand_mode) - 1ull);
}
} else
{
switch (operand.size)
{
case 8:
value = operand.lval.ubyte;
break;
case 16:
value = operand.lval.uword;
break;
case 32:
value = operand.lval.udword;
break;
case 64:
value = operand.lval.uqword;
break;
default:
assert(0);
}
}
uint64_t offset = 0;
const char* name = nullptr;
if (resolveSymbols)
{
name = resolveSymbol(info, value, offset);
}
if (name)
{
if (offset)
{
outputAppendFormatted("%s+%.2llX", name, offset);
} else
{
outputAppend(name);
}
} else
{
outputAppendFormatted("%.2llX", value);
}
}
void BaseInstructionFormatter::outputAppendDisplacement(const OperandInfo& operand)
{
assert(operand.offset > 0);
if ((operand.base == Register::NONE) && (operand.index == Register::NONE))
{
// Assume the displacement value is unsigned
assert(operand.scale == 0);
assert(operand.offset != 8);
uint64_t value = 0;
switch (operand.offset)
{
case 16:
value = operand.lval.uword;
break;
case 32:
value = operand.lval.udword;
break;
case 64:
value = operand.lval.uqword;
break;
default:
assert(0);
}
outputAppendFormatted("%.2llX", value);
} else
{
// The displacement value might be negative
assert(operand.offset != 64);
int64_t value = 0;
switch (operand.offset)
{
case 8:
value = operand.lval.sbyte;
break;
case 16:
value = operand.lval.sword;
break;
case 32:
value = operand.lval.sdword;
break;
default:
assert(0);
}
if (value < 0)
{
outputAppendFormatted("-%.2lX", -value);
} else
{
outputAppendFormatted("%s%.2lX", (operand.base != Register::NONE ||
operand.index != Register::NONE) ? "+" : "", value);
}
}
}
/* IntelInstructionFormatter =============================================================== */
void IntelInstructionFormatter::outputAppendOperandCast(const OperandInfo& operand)
{
switch(operand.size)
{
case 8:
outputAppend("byte ptr " );
break;
case 16:
outputAppend("word ptr " );
break;
case 32:
outputAppend("dword ptr ");
break;
case 64:
outputAppend("qword ptr ");
break;
case 80:
outputAppend("tword ptr ");
break;
case 128:
outputAppend("oword ptr ");
break;
case 256:
outputAppend("yword ptr ");
break;
default:
break;
}
}
void IntelInstructionFormatter::formatOperand(const InstructionInfo& info,
const OperandInfo& operand)
{
switch (operand.type)
{
case OperandType::REGISTER:
outputAppend(registerToString(operand.base));
break;
case OperandType::MEMORY:
if (info.flags & IF_PREFIX_SEGMENT)
{
outputAppendFormatted("%s:", registerToString(info.segment));
}
outputAppend("[");
if (operand.base == Register::RIP)
{
// TODO: Add option
outputAppendAddress(info, CalcAbsoluteTarget(info, operand), true);
} else
{
if (operand.base != Register::NONE)
{
outputAppend(registerToString(operand.base));
}
if (operand.index != Register::NONE)
{
outputAppendFormatted("%s%s", operand.base != Register::NONE ? "+" : "",
registerToString(operand.index));
if (operand.scale)
{
outputAppendFormatted("*%d", operand.scale);
}
}
if (operand.offset)
{
outputAppendDisplacement(operand);
}
}
outputAppend("]");
break;
case OperandType::POINTER:
// TODO: resolve symbols
switch (operand.size)
{
case 32:
outputAppendFormatted("word %.4X:%.4X", operand.lval.ptr.seg,
operand.lval.ptr.off& 0xFFFF);
break;
case 48:
outputAppendFormatted("dword %.4X:%.8lX", operand.lval.ptr.seg, operand.lval.ptr.off);
break;
default:
assert(0);
}
break;
case OperandType::IMMEDIATE:
{
outputAppendImmediate(info, operand, true);
}
break;
case OperandType::REL_IMMEDIATE:
{
if (operand.size == 8)
{
outputAppend("short ");
}
outputAppendAddress(info, CalcAbsoluteTarget(info, operand), true);
}
break;
case OperandType::CONSTANT:
outputAppendFormatted("%.2X", operand.lval.udword);
break;
default:
assert(0);
break;
}
}
void IntelInstructionFormatter::internalFormatInstruction(const InstructionInfo& info)
{
// Append string prefixes
if (info.flags & IF_PREFIX_LOCK)
{
outputAppend("lock ");
}
if (info.flags & IF_PREFIX_REP)
{
outputAppend("rep ");
} else if (info.flags & IF_PREFIX_REPNE)
{
outputAppend("repne ");
}
// Append the instruction mnemonic
outputAppend(Internal::GetInstructionMnemonicString(info.mnemonic));
// Append the first operand
if (info.operand[0].type != OperandType::NONE)
{
outputAppend(" ");
bool cast = false;
if (info.operand[0].type == OperandType::MEMORY)
{
if (info.operand[1].type == OperandType::IMMEDIATE ||
info.operand[1].type == OperandType::CONSTANT ||
info.operand[1].type == OperandType::NONE ||
(info.operand[0].size != info.operand[1].size))
{
cast = true;
} else if (info.operand[1].type == OperandType::REGISTER &&
info.operand[1].base == Register::CL)
{
switch (info.mnemonic)
{
case InstructionMnemonic::RCL:
case InstructionMnemonic::ROL:
case InstructionMnemonic::ROR:
case InstructionMnemonic::RCR:
case InstructionMnemonic::SHL:
case InstructionMnemonic::SHR:
case InstructionMnemonic::SAR:
cast = true;
break;
default:
break;
}
}
}
if (cast)
{
outputAppendOperandCast(info.operand[0]);
}
formatOperand(info, info.operand[0]);
}
// Append the second operand
if (info.operand[1].type != OperandType::NONE)
{
outputAppend(", ");
bool cast = false;
if (info.operand[1].type == OperandType::MEMORY &&
info.operand[0].size != info.operand[1].size &&
((info.operand[0].type != OperandType::REGISTER) ||
((info.operand[0].base != Register::ES) &&
(info.operand[0].base != Register::CS) &&
(info.operand[0].base != Register::SS) &&
(info.operand[0].base != Register::DS) &&
(info.operand[0].base != Register::FS) &&
(info.operand[0].base != Register::GS))))
{
cast = true;
}
if (cast)
{
outputAppendOperandCast(info.operand[1]);
}
formatOperand(info, info.operand[1]);
}
// Append the third operand
if (info.operand[2].type != OperandType::NONE)
{
outputAppend(", ");
bool cast = false;
if (info.operand[2].type == OperandType::MEMORY &&
(info.operand[2].size != info.operand[1].size))
{
cast = true;
}
if (cast)
{
outputAppendOperandCast(info.operand[2]);
}
formatOperand(info, info.operand[2]);
}
// Append the fourth operand
if (info.operand[3].type != OperandType::NONE)
{
outputAppend(", ");
formatOperand(info, info.operand[3]);
}
}
IntelInstructionFormatter::IntelInstructionFormatter()
: BaseInstructionFormatter()
{
}
IntelInstructionFormatter::IntelInstructionFormatter(
BaseSymbolResolver *symbolResolver)
: BaseInstructionFormatter(symbolResolver)
{
}
IntelInstructionFormatter::~IntelInstructionFormatter()
{
}
/* ============================================================================================== */
}

View File

@ -1,250 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief Instruction formatting classes.
*/
#ifndef _ZYDIS_INSTRUCTIONFORMATTER_HPP_
#define _ZYDIS_INSTRUCTIONFORMATTER_HPP_
#include <vector>
#include "ZydisTypes.hpp"
#include "ZydisSymbolResolver.hpp"
namespace Zydis
{
/* BaseInstructionFormatter ===================================================================== */
/**
* @brief Base class for all instruction formatter implementations.
*/
class BaseInstructionFormatter
{
private:
static const char* m_registerStrings[];
BaseSymbolResolver* m_symbolResolver;
std::vector<char> m_outputBuffer;
size_t m_outputStringLen;
bool m_outputUppercase;
protected:
/**
* @brief Clears the output string buffer.
*/
void outputClear();
/**
* @brief Returns the content of the output string buffer.
* @return Pointer to the content of the ouput string buffer.
*/
const char* outputString();
/**
* @brief Appends text to the ouput string buffer.
* @param text The text.
*/
void outputAppend(const char* text);
/**
* @brief Appends formatted text to the output string buffer.
* @param format The format string.
*/
void outputAppendFormatted(const char* format, ...);
/**
* @brief Changes automatic conversion of characters to uppercase.
* @param uppercase Set true to enable automatic uppercase conversion.
*/
void outputSetUppercase(bool uppercase);
/**
* @brief Appends a formatted address to the output string buffer.
* @param info The instruction info.
* @param address The address.
* @param resolveSymbols If this parameter is true, the method will try to display a
* smybol name instead of the numeric value.
*/
void outputAppendAddress(const InstructionInfo& info, uint64_t address,
bool resolveSymbols = true);
/**
* @brief Appends a formatted immediate value to the output string buffer.
* @param info The instruction info.
* @param operand The immediate operand.
* @param resolveSymbols If this parameter is true, the method will try to display a
* smybol name instead of the numeric value.
*/
void outputAppendImmediate(const InstructionInfo& info, const OperandInfo& operand,
bool resolveSymbols = false);
/**
* @brief Appends a formatted memory displacement value to the output string buffer.
* @param operand The memory operand.
*/
void outputAppendDisplacement(const OperandInfo& operand);
protected:
/**
* @brief Returns the string representation of a given register.
* @param reg The register.
* @return The string representation of the given register.
*/
const char *registerToString(Register reg) const;
/**
* @brief Resolves a symbol.
* @param info The instruction info.
* @param address The address.
* @param offset Reference to an unsigned 64 bit integer that receives an offset
* relative to the base address of the symbol.
* @return The name of the symbol, if the symbol was found, @c NULL if not.
*/
const char* resolveSymbol(const InstructionInfo& info, uint64_t address,
uint64_t& offset) const;
protected:
/**
* @brief Override this method to implement a custom disassembly syntax. Use the
* @c outputAppend and @c outputAppendFormatted methods to fill the internal
* string buffer.
* @param info The instruction info.
*/
virtual void internalFormatInstruction(const InstructionInfo& info);
/**
* @brief Default constructor.
*/
BaseInstructionFormatter();
/**
* @brief Constructor.
* @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol
* resolver should be used.
*/
explicit BaseInstructionFormatter(BaseSymbolResolver* symbolResolver);
public:
/**
* @brief Destructor.
*/
virtual ~BaseInstructionFormatter();
public:
/**
* @brief Formats a decoded instruction.
* @param info The instruction info.
* @return Pointer to the formatted instruction string.
*/
const char* formatInstruction(const InstructionInfo& info);
public:
/**
* @brief Returns a pointer to the current symbol resolver.
* @return Pointer to the current symbol resolver or @c NULL, if no symbol resolver is used.
*/
BaseSymbolResolver* getSymbolResolver() const;
/**
* @brief Sets a new symbol resolver.
* @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol
* resolver should be used.
*/
void setSymbolResolver(BaseSymbolResolver* symbolResolver);
};
inline void BaseInstructionFormatter::outputSetUppercase(bool uppercase)
{
m_outputUppercase = uppercase;
}
inline char const* BaseInstructionFormatter::registerToString(Register reg) const
{
if (reg == Register::NONE)
{
return "error";
}
return m_registerStrings[static_cast<uint16_t>(reg) - 1];
}
inline char const* BaseInstructionFormatter::resolveSymbol(const InstructionInfo& info,
uint64_t address, uint64_t& offset) const
{
if (m_symbolResolver)
{
return m_symbolResolver->resolveSymbol(info, address, offset);
}
return nullptr;
}
inline BaseSymbolResolver* BaseInstructionFormatter::getSymbolResolver() const
{
return m_symbolResolver;
}
inline void BaseInstructionFormatter::setSymbolResolver(
BaseSymbolResolver* symbolResolver)
{
m_symbolResolver = symbolResolver;
}
/* IntelInstructionFormatter ==================================================================== */
/**
* @brief Intel syntax instruction formatter.
*/
class IntelInstructionFormatter : public BaseInstructionFormatter
{
private:
/**
* @brief Appends an operand cast to the output string buffer.
* @param operand The operand.
*/
void outputAppendOperandCast(const OperandInfo& operand);
/**
* @brief Formats the specified operand and appends the resulting string to the output
* buffer.
* @param info The instruction info.
* @param operand The operand.
*/
void formatOperand(const InstructionInfo& info, const OperandInfo& operand);
protected:
/**
* @brief Fills the internal string buffer with an intel style formatted instruction string.
* @param info The instruction info.
*/
void internalFormatInstruction(const InstructionInfo& info) override;
public:
/**
* @brief Default constructor.
*/
IntelInstructionFormatter();
/**
* @brief Constructor.
* @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol
* resolver should be used.
*/
explicit IntelInstructionFormatter(BaseSymbolResolver* symbolResolver);
/**
* @brief Destructor.
*/
~IntelInstructionFormatter() override;
};
/* ============================================================================================== */
}
#endif /* _ZYDIS_INSTRUCTIONFORMATTER_HPP_ */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,91 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include "ZydisSymbolResolver.hpp"
namespace Zydis
{
/* BaseSymbolResolver ====================================================================== */
BaseSymbolResolver::~BaseSymbolResolver()
{
}
const char* BaseSymbolResolver::resolveSymbol(const InstructionInfo& /*info*/,
uint64_t /*address*/, uint64_t& /*offset*/)
{
return nullptr;
}
/* ExactSymbolResolver ===================================================================== */
ExactSymbolResolver::~ExactSymbolResolver()
{
}
const char* ExactSymbolResolver::resolveSymbol(const InstructionInfo& /*info*/,
uint64_t address, uint64_t& offset)
{
std::unordered_map<uint64_t, std::string>::const_iterator iterator = m_symbolMap.find(address);
if (iterator != m_symbolMap.cend())
{
offset = 0;
return iterator->second.c_str();
}
return nullptr;
}
bool ExactSymbolResolver::containsSymbol(uint64_t address) const
{
std::unordered_map<uint64_t, std::string>::const_iterator iterator = m_symbolMap.find(address);
return (iterator != m_symbolMap.end());
}
void ExactSymbolResolver::setSymbol(uint64_t address, const char *name)
{
m_symbolMap[address].assign(name);
}
void ExactSymbolResolver::removeSymbol(uint64_t address)
{
m_symbolMap.erase(address);
}
void ExactSymbolResolver::clear()
{
m_symbolMap.clear();
}
/* ============================================================================================== */
}

View File

@ -1,125 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief Classes for symbol resolving in the disassembly.
*/
#ifndef _ZYDIS_SYMBOLRESOLVER_HPP_
#define _ZYDIS_SYMBOLRESOLVER_HPP_
#include <string>
#include <unordered_map>
#include "ZydisTypes.hpp"
namespace Zydis
{
/* BaseSymbolResolver =========================================================================== */
/**
* @brief Base class for all symbol resolver implementations.
*/
class BaseSymbolResolver
{
public:
/**
* @brief Destructor.
*/
virtual ~BaseSymbolResolver();
public:
/**
* @brief Resolves a symbol.
* @param info The instruction info.
* @param address The address.
* @param offset Reference to an unsigned 64 bit integer that receives an offset
* relative to the base address of the symbol.
* @return The name of the symbol, if the symbol was found, @c NULL if not.
*/
virtual const char* resolveSymbol(const InstructionInfo& info, uint64_t address,
uint64_t& offset);
};
/* ExactSymbolResolver ========================================================================== */
/**
* @brief Simple symbol resolver that only matches exact addresses.
*/
class ExactSymbolResolver : public BaseSymbolResolver
{
private:
std::unordered_map<uint64_t, std::string> m_symbolMap;
public:
/**
* @brief Destructor.
*/
~ExactSymbolResolver() override;
public:
/**
* @brief Resolves a symbol.
* @param info The instruction info.
* @param address The address.
* @param offset Reference to an unsigned 64 bit integer that receives an offset
* relative to the base address of the symbol.
* @return The name of the symbol, if the symbol was found, @c NULL if not.
*/
const char* resolveSymbol(const InstructionInfo& info, uint64_t address,
uint64_t& offset) override;
public:
/**
* @brief Query if the given address is a known symbol.
* @param address The address.
* @return True if the address is known, false if not.
*/
bool containsSymbol(uint64_t address) const;
/**
* @brief Adds or changes a symbol.
* @param address The address.
* @param name The symbol name.
*/
void setSymbol(uint64_t address, const char* name);
/**
* @brief Removes the symbol described by address. This will invalidate all char pointers
* to the specific symbol name.
* @param address The address.
*/
void removeSymbol(uint64_t address);
/**
* @brief Clears the symbol tree.
*/
void clear();
};
/* ============================================================================================== */
}
#endif /* _ZYDIS_SYMBOLRESOLVER_HPP_ */

View File

@ -1,543 +0,0 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Original Author : Florian Bernd
Modifications : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef _ZYDIS_TYPES_HPP_
#define _ZYDIS_TYPES_HPP_
#include <stdint.h>
#include "ZydisOpcodeTable.hpp"
namespace Zydis
{
/* InstructionFlags ============================================================================= */
/**
* @brief Values that represent additional flags of a decoded instruction.
*/
enum InstructionFlags : uint32_t
{
IF_NONE = 0x00000000,
/**
* @brief The instruction was decoded in 16 bit disassembler mode.
*/
IF_DISASSEMBLER_MODE_16 = 0x00000001,
/**
* @brief The instruction was decoded in 32 bit disassembler mode.
*/
IF_DISASSEMBLER_MODE_32 = 0x00000002,
/**
* @brief The instruction was decoded in 64 bit disassembler mode.
*/
IF_DISASSEMBLER_MODE_64 = 0x00000004,
/**
* @brief The instruction has a segment prefix (0x26, 0x2E, 0x36, 0x3E, 0x64, 0x65).
*/
IF_PREFIX_SEGMENT = 0x00000008,
/**
* @brief The instruction has a lock prefix (0xF0).
*/
IF_PREFIX_LOCK = 0x00000010,
/**
* @brief The instruction has a repne prefix (0xF2).
*/
IF_PREFIX_REPNE = 0x00000020,
/**
* @brief The instruction has a rep prefix (0xF3).
*/
IF_PREFIX_REP = 0x00000040,
/**
* @brief The instruction has an operand size prefix (0x66).
*/
IF_PREFIX_OPERAND_SIZE = 0x00000080,
/**
* @brief The instruction has an address size prefix (0x67).
*/
IF_PREFIX_ADDRESS_SIZE = 0x00000100,
/**
* @brief The instruction has a rex prefix (0x40 - 0x4F).
*/
IF_PREFIX_REX = 0x00000200,
/**
* @brief The instruction has a vex prefix (0xC4 or 0xC5).
*/
IF_PREFIX_VEX = 0x00000400,
/**
* @brief The instruction has a modrm byte.
*/
IF_MODRM = 0x00000800,
/**
* @brief The instruction has a sib byte.
*/
IF_SIB = 0x00001000,
/**
* @brief The instruction has an operand with a relative address.
*/
IF_RELATIVE = 0x00002000,
/**
* @brief An error occured while decoding the instruction.
*/
IF_ERROR_MASK = 0xFFF00000,
/**
* @brief End of input reached while decoding the instruction.
*/
IF_ERROR_END_OF_INPUT = 0x00100000,
/**
* @brief The instruction length has exceeded the maximum of 15 bytes.
*/
IF_ERROR_LENGTH = 0x00200000,
/**
* @brief The instruction is invalid.
*/
IF_ERROR_INVALID = 0x00400000,
/**
* @brief The instruction is invalid in 64 bit mode.
*/
IF_ERROR_INVALID_64 = 0x00800000,
/**
* @brief An error occured while decoding the instruction operands.
*/
IF_ERROR_OPERAND = 0x01000000
};
/* Register ===================================================================================== */
/**
* @brief Values that represent a cpu register.
*/
enum class Register : uint16_t
{
NONE,
/* 8 bit general purpose registers */
AL, CL, DL, BL,
AH, CH, DH, BH,
SPL, BPL, SIL, DIL,
R8B, R9B, R10B, R11B,
R12B, R13B, R14B, R15B,
/* 16 bit general purpose registers */
AX, CX, DX, BX,
SP, BP, SI, DI,
R8W, R9W, R10W, R11W,
R12W, R13W, R14W, R15W,
/* 32 bit general purpose registers */
EAX, ECX, EDX, EBX,
ESP, EBP, ESI, EDI,
R8D, R9D, R10D, R11D,
R12D, R13D, R14D, R15D,
/* 64 bit general purpose registers */
RAX, RCX, RDX, RBX,
RSP, RBP, RSI, RDI,
R8, R9, R10, R11,
R12, R13, R14, R15,
/* segment registers */
ES, CS, SS,
DS, FS, GS,
/* control registers */
CR0, CR1, CR2, CR3,
CR4, CR5, CR6, CR7,
CR8, CR9, CR10, CR11,
CR12, CR13, CR14, CR15,
/* debug registers */
DR0, DR1, DR2, DR3,
DR4, DR5, DR6, DR7,
DR8, DR9, DR10, DR11,
DR12, DR13, DR14, DR15,
/* mmx registers */
MM0, MM1, MM2, MM3,
MM4, MM5, MM6, MM7,
/* x87 registers */
ST0, ST1, ST2, ST3,
ST4, ST5, ST6, ST7,
/* extended multimedia registers */
XMM0, XMM1, XMM2, XMM3,
XMM4, XMM5, XMM6, XMM7,
XMM8, XMM9, XMM10, XMM11,
XMM12, XMM13, XMM14, XMM15,
/* 256 bit multimedia registers */
YMM0, YMM1, YMM2, YMM3,
YMM4, YMM5, YMM6, YMM7,
YMM8, YMM9, YMM10, YMM11,
YMM12, YMM13, YMM14, YMM15,
/* instruction pointer register */
RIP
};
/* OperandType ================================================================================== */
/**
* @brief Values that represent the type of a decoded operand.
*/
enum class OperandType : uint8_t
{
/**
* @brief The operand is not used.
*/
NONE,
/**
* @brief The operand is a register operand.
*/
REGISTER,
/**
* @brief The operand is a memory operand.
*/
MEMORY,
/**
* @brief The operand is a pointer operand.
*/
POINTER,
/**
* @brief The operand is an immediate operand.
*/
IMMEDIATE,
/**
* @brief The operand is a relative immediate operand.
*/
REL_IMMEDIATE,
/**
* @brief The operand is a constant value.
*/
CONSTANT
};
/* ZydisOperandAccessMode ============================================================================ */
/**
* @brief Values that represent the operand access mode.
*/
enum class OperandAccessMode : uint8_t
{
NA,
/**
* @brief The operand is accessed in read-only mode.
*/
READ,
/**
* @brief The operand is accessed in write mode.
*/
WRITE,
/**
* @brief The operand is accessed in read-write mode.
*/
READWRITE
};
/* OperandInfo ================================================================================== */
/**
* @brief This struct holds information about a decoded operand.
*/
struct OperandInfo
{
/**
* @brief The type of the operand.
*/
OperandType type;
/**
* @brief The size of the operand.
*/
uint16_t size;
/**
* @brief The operand access mode.
*/
OperandAccessMode access_mode;
/**
* @brief The base register.
*/
Register base;
/**
* @brief The index register.
*/
Register index;
/**
* @brief The scale factor.
*/
uint8_t scale;
/**
* @brief The lvalue offset. If the @c offset is zero and the operand @c type is not
* @c CONSTANT, no lvalue is present.
*/
uint8_t offset;
/**
* @brief Signals, if the lval is signed.
*/
bool signed_lval;
/**
* @brief The lvalue.
*/
union {
int8_t sbyte;
uint8_t ubyte;
int16_t sword;
uint16_t uword;
int32_t sdword;
uint32_t udword;
int64_t sqword;
uint64_t uqword;
struct {
uint16_t seg;
uint32_t off;
} ptr;
} lval;
};
/* InstructionInfo ============================================================================== */
/**
* @brief This struct holds information about a decoded instruction.
*/
struct InstructionInfo
{
/**
* @brief The instruction flags.
*/
uint32_t flags;
/**
* @brief The instruction mnemonic.
*/
InstructionMnemonic mnemonic;
/**
* @brief The total length of the instruction.
*/
uint8_t length;
/**
* @brief Contains all bytes of the instruction.
*/
uint8_t data[15];
/**
* @brief The length of the instruction opcodes.
*/
uint8_t opcode_length;
/**
* @brief The instruction opcodes.
*/
uint8_t opcode[3];
/**
* @brief The operand mode.
*/
uint8_t operand_mode;
/**
* @brief The address mode.
*/
uint8_t address_mode;
/**
* @brief The decoded operands.
*/
OperandInfo operand[4];
/**
* @brief The segment register. This value will default to @c NONE, if no segment register
* prefix is present.
*/
Register segment;
/**
* @brief The rex prefix byte.
*/
uint8_t rex;
/**
* @brief When 1, a 64-bit operand size is used. Otherwise, when 0, the default operand size
* is used.
*/
uint8_t rex_w;
/**
* @brief This 1-bit value is an extension to the MODRM.reg field.
*/
uint8_t rex_r;
/**
* @brief This 1-bit value is an extension to the SIB.index field.
*/
uint8_t rex_x;
/**
* @brief This 1-bit value is an extension to the MODRM.rm field or the SIB.base field.
*/
uint8_t rex_b;
/**
* @brief The modrm byte.
*/
uint8_t modrm;
/**
* @brief The modrm modus bits. When this field is b11, then register-direct addressing mode
* is used; otherwise register-indirect addressing mode is used.
*/
uint8_t modrm_mod;
/**
* @brief The modrm register bits. The REX.R, VEX.~R or XOP.~R field can extend this field
* with 1 most-significant bit to 4 bits total.
*/
uint8_t modrm_reg;
/**
* @brief The extended modrm register bits. If the instruction definition does not have the
* @c IDF_ACCEPTS_REXR flag set, this value defaults to the normal @c modrm_reg
* field.
*/
uint8_t modrm_reg_ext;
/**
* @brief The modrm register/memory bits. Specifies a direct or indirect register operand,
* optionally with a displacement. The REX.B, VEX.~B or XOP.~B field can extend this
* field with 1 most-significant bit to 4 bits total.
*/
uint8_t modrm_rm;
/**
* @brief The extended modrm register/memory bits. If the instruction definition does not
* have the @c IDF_ACCEPTS_REXB flag set, this value defaults to the normal
* @c modrm_rm field.
*/
uint8_t modrm_rm_ext;
/**
* @brief The sib byte.
*/
uint8_t sib;
/**
* @brief This field indicates the scaling factor of SIB.index.
*/
uint8_t sib_scale;
/**
* @brief The index register to use. The REX.X, VEX.~X or XOP.~X field can extend this field
* with 1 most-significant bit to 4 bits total.
*/
uint8_t sib_index;
/**
* @brief The extended index register. If the instruction definition does not have the
* @c IDF_ACCEPTS_REXX flag set, this value defaults to the normal @c sib_index
* field.
*/
uint8_t sib_index_ext;
/**
* @brief The base register to use. The REX.B, VEX.~B or XOP.~B field can extend this field
* with 1 most-significant bit to 4 bits total.
*/
uint8_t sib_base;
/**
* @brief The extended base register. If the instruction definition does not have the
* @c IDF_ACCEPTS_REXB flag set, this value defaults to the normal @c sib_index
* field.
*/
uint8_t sib_base_ext;
/**
* @brief The primary vex prefix byte.
*/
uint8_t vex_op;
/**
* @brief The second vex prefix byte.
*/
uint8_t vex_b1;
/**
* @brief The third vex prefix byte.
*/
uint8_t vex_b2;
/**
* @brief This 1-bit value is an 'inverted' extension to the MODRM.reg field. The inverse of
* REX.R.
*/
uint8_t vex_r;
/**
* @brief This 1-bit value is an 'inverted' extension to the SIB.index field. The inverse of
* REX.X.
*/
uint8_t vex_x;
/**
* @brief This 1-bit value is an 'inverted' extension to the MODRM.rm field or the SIB.base
* field. The inverse of REX.B.
*/
uint8_t vex_b;
/**
* @brief Specifies the opcode map to use.
* 00 = 0x0F
* 01 = 0x0F 0x38
* 02 = 0x0F 0x3A
*/
uint8_t vex_m_mmmm;
/**
* @brief For integer instructions: when 1, a 64-bit operand size is used; otherwise,
* when 0, the default operand size is used (equivalent with REX.W). For non-integer
* instructions, this bit is a general opcode extension bit.
*/
uint8_t vex_w;
/**
* @brief An additional operand for the instruction. The value of the XMM or YMM register
* is 'inverted'.
*/
uint8_t vex_vvvv;
/**
* @brief When 0, a 128-bit vector lengh is used. Otherwise, when 1, a 256-bit vector length
* is used.
*/
uint8_t vex_l;
/**
* @brief Specifies an implied mandatory prefix for the opcode.
* 00 = none
* 01 = 0x66
* 10 = 0xF3
* 11 = 0xF2
*/
uint8_t vex_pp;
/**
* @brief The effectively used REX/VEX.w value. If the instruction definition does not have
* the @c IDF_ACCEPTS_REXW flag set, this value defaults to zero.
*/
uint8_t eff_rexvex_w;
/**
* @brief The effectively used REX/VEX.r value. If the instruction definition does not have
* the @c IDF_ACCEPTS_REXR flag set, this value defaults to zero.
*/
uint8_t eff_rexvex_r;
/**
* @brief The effectively used REX/VEX.x value. If the instruction definition does not have
* the @c IDF_ACCEPTS_REXX flag set, this value defaults to zero.
*/
uint8_t eff_rexvex_x;
/**
* @brief The effectively used REX/VEX.b value. If the instruction definition does not have
* the @c IDF_ACCEPTS_REXB flag set, this value defaults to zero.
*/
uint8_t eff_rexvex_b;
/**
* @brief The effectively used VEX.l value. If the instruction definition does not have
* the @c IDF_ACCEPTS_VEXL flag set, this value defaults to zero.
*/
uint8_t eff_vex_l;
/**
* @brief The instruction definition.
*/
const InstructionDefinition* instrDefinition;
/**
* @brief The instruction address points to the current instruction (relative to the
* initial instruction pointer).
*/
uint64_t instrAddress;
/**
* @brief The instruction pointer points to the address of the next instruction (relative
* to the initial instruction pointer).
* This field is used to properly format relative instructions.
*/
uint64_t instrPointer;
};
}
#endif /* _ZYDIS_TYPES_HPP_ */

57
assets/InstructionEditor/.gitignore vendored Normal file
View File

@ -0,0 +1,57 @@
# Uncomment these types if you want even more clean repository. But be careful.
# It can make harm to an existing project source. Read explanations below.
#
# Resource files are binaries containing manifest, project icon and version info.
# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
#*.res
#
# Type library file (binary). In old Delphi versions it should be stored.
# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
#*.tlb
#
# Diagram Portfolio file. Used by the diagram editor up to Delphi 7.
# Uncomment this if you are not using diagrams or use newer Delphi version.
#*.ddp
#
# Visual LiveBindings file. Added in Delphi XE2.
# Uncomment this if you are not using LiveBindings Designer.
#*.vlb
#
# Deployment Manager configuration file for your project. Added in Delphi XE2.
# Uncomment this if it is not mobile development and you do not use remote debug feature.
#*.deployproj
#
# Delphi compiler-generated binaries (safe to delete)
*.exe
*.dll
*.bpl
*.bpi
*.dcp
*.so
*.apk
*.drc
*.map
*.dres
*.rsm
*.tds
*.dcu
*.lib
# Delphi autogenerated files (duplicated info)
*.cfg
*Resource.rc
# Delphi local files (user-specific info)
*.local
*.identcache
*.projdata
*.tvsconfig
*.dsk
# Delphi history and backups
__history/
*.~*
# Castalia statistics file
*.stat

View File

@ -0,0 +1,324 @@
object frmEditorCPUIDFeatureFlags: TfrmEditorCPUIDFeatureFlags
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'frmEditorCPUIDFeatureFlags'
ClientHeight = 371
ClientWidth = 544
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object GroupBox: TGroupBox
AlignWithMargins = True
Left = 3
Top = 329
Width = 538
Height = 39
Margins.Top = 0
Align = alBottom
TabOrder = 1
ExplicitTop = 279
ExplicitWidth = 488
DesignSize = (
538
39)
object btnCancel: TButton
Left = 418
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Cancel'
ImageIndex = 1
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 1
OnClick = btnCancelClick
ExplicitLeft = 368
end
object btnApply: TButton
Left = 300
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Apply'
ImageIndex = 0
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 0
OnClick = btnApplyClick
ExplicitLeft = 250
end
end
object VirtualTreeView: TVirtualStringTree
AlignWithMargins = True
Left = 3
Top = 3
Width = 538
Height = 323
Align = alClient
Header.AutoSizeIndex = -1
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.MainColumn = -1
Images = imgTreeView
TabOrder = 0
TreeOptions.MiscOptions = [toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toShowHorzGridLines, toShowTreeLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines, toAlwaysHideSelection, toUseBlendedSelection]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnChecked = VirtualTreeViewChecked
OnCollapsing = VirtualTreeViewCollapsing
OnFreeNode = VirtualTreeViewFreeNode
OnGetText = VirtualTreeViewGetText
OnGetImageIndex = VirtualTreeViewGetImageIndex
ExplicitWidth = 488
ExplicitHeight = 273
Columns = <>
end
object imgIcons16: TcxImageList
FormatVersion = 1
DesignInfo = 2097208
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
20000000000000040000000000000000000000000000000000000000001B0000
0033000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000001B00000000004B29A00089
49FF008747FF008747FF008747FF008747FF008747FF008747FF008747FF0087
47FF008747FF008747FF008747FF008949FF004B29A000000000008949FF07E4
A4FF07E5A5FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4
A4FF07E4A4FF07E4A4FF07E5A5FF07E4A4FF008949FF00000000008747FF13E7
AAFF00DB9BFF00DA9AFF00DA99FF00DA99FF00DA99FF00DA99FF00DA9AFF00DA
9AFF00DA9AFF00DA9AFF00DB9BFF13E7AAFF008747FF00000000008746FF1EE7
AEFF00D699FF00D698FF00D495FF00D391FF00D391FF00D495FF00D698FF00D6
99FF00D699FF00D699FF00D699FF1EE7AEFF008746FF00000000008746FF2AE9
B3FF00D299FF00D095FF00CC8DFFFFFFFFFFFFFFFFFF00CC8DFF00D096FF00D2
99FF00D29AFF00D29AFF00D29AFF2AE9B3FF008746FF00000000008746FF35EA
B7FF00CD96FF00C98DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C98DFF00CD
96FF00CF99FF00CF9AFF00CF9AFF36EAB8FF008746FF00000000008745FF3EEB
BBFF00C692FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C4
8DFF00C995FF00CA99FF00CA99FF41ECBDFF008745FF00000000008745FF4BED
BFFF00C393FFFFFFFFFFFFFFFFFF00C08BFF00BF8BFFFFFFFFFFFFFFFFFFFFFF
FFFF00C18EFF00C596FF00C699FF4DEDC0FF008745FF00000000008744FF58EF
C5FF00C197FF00BF93FF00C093FF00C196FF00C196FF00BC8EFFFFFFFFFFFFFF
FFFFFFFFFFFF00BC8EFF00C096FF58EFC5FF008744FF00000000008744FF64F1
CAFF00BE99FF00C099FF00C09AFF00C19BFF00C19AFF00BE97FF00B98EFFFFFF
FFFFFFFFFFFFFFFFFFFF00BA92FF62F0C9FF008744FF00000000008744FF71F2
CFFF00BB99FF00BD9AFF00BE9BFF00BE9BFF00BE9BFF00BE9AFF00BB96FF00B6
8EFFFFFFFFFFFFFFFFFF00B792FF6EF2CDFF008744FF00000000008744FF7BF4
D3FF00B699FF00B89AFF00B99BFF00B99BFF00B99BFF00B99BFF00B89AFF00B7
98FF00B494FF00B493FF00B496FF7AF3D3FF008744FF00000000008744FF86F5
D8FF00B198FF00B299FF00B399FF00B399FF00B399FF00B399FF00B399FF00B2
99FF00B298FF00B297FF00B197FF86F5D8FF008744FF00000000008946FF8AF2
D9FF92F6DEFF93F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6
DDFF94F6DDFF93F6DDFF92F6DEFF8AF2D9FF008946FF00000000004B29880089
46FF008743FF008643FF008643FF008643FF008643FF008643FF008643FF0086
43FF008643FF008643FF008743FF008946FF004B298800000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0013000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000003300000013000000001117
487E2D3CC0FF2B3BBEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3A
BEFF2A3ABEFF2A3ABEFF2A3ABEFF2B3BBEFF2D3CC0FF1117487E000000002D3D
C0FF6172FAFF6A7DFFFF697CFFFF6D80FFFF7485FFFF7788FFFF7788FFFF7788
FFFF7485FFFF6D7FFFFF697CFFFF6A7DFFFF6172FAFF2D3DC0FF000000002B3B
BEFF6578FFFF5F73FEFF6F80FFFF7989FFFF5868E6FF3E4ED0FF3F4FD1FF3E4E
D0FF5767E5FF7887FEFF6E7FFFFF5F73FEFF6578FFFF2B3BBEFF000000002B3B
BEFF5D72FFFF697BFEFF7785F8FF3949CAFF1E2A89B70B0F303F07091D26070A
1F552636B9FF5A6FFDFF576CFAFF687AFCFF5D71FFFF2B3BBEFF000000002C3B
BFFF586EFEFF8593FFFF3B4BCAFF0E143F530000000000000000000000332B3A
BDFF5970FEFF546AFBFF7F8FFFFF8290FDFF586EFEFF2C3BBFFF000000002C3C
BFFF536BFCFF707CE7FF1E2A89BB0000000000000000000000332C3BBEFF546B
FBFF5067F8FF8796FFFF3B4BCDFF6D79E5FF536AFCFF2C3CBFFF000000002D3D
BFFF4F68FBFF4E5BD1FF0B0F304500000000000000332C3BBEFF4E66F9FF4A63
F6FF8C99FFFF2737BCFF07091F314D5AD0FF4F68FBFF2D3DBFFF000000002E3D
C0FF4A64F9FF3446CDFF07091D2D000000332D3CBEFF4862F7FF445DF4FF8E9C
FFFF2838BDFF0000000007091D313446CDFF4A64F9FF2E3DC0FF000000002E3D
C0FF4660F7FF3445CCFF080A20552D3CBEFF445DF4FF3F59F1FF929FFFFF2838
BDFF00000000000000000C0F305B3445CDFF4660F7FF2E3DC0FF000000002E3E
C0FF405BF3FF384DDBFF2E3CBCFF3E59F2FF3954EFFF95A2FFFF2838BDFF0000
00000000000000000011222D8AC5384EDCFF405BF3FF2E3EC0FF000000002F3E
C0FF3955F0FF3951EAFF3954EEFF3651EDFF9AA5FFFF2838BDFF000000080000
000D0000002510153F753041C8FF3A53EBFF3A55F0FF2F3EC0FF000000002E3D
BFFF3A54EFFF324DE9FF334DE9FF324DEBFF2A39BCFF070A1F5507091D510B0F
3065212D8AC52F41C8FF314CE4FF324DEBFF3A54EFFF2E3DBFFF000000002B3B
BFFF6A7DFDFF334EE8FF2643E4FF2642E3FF253CD4FF2739C7FF273AC8FF273A
C8FF263DD5FF2743E5FF2643E6FF334EE9FF6A7DFDFF2B3BBFFF000000002B3B
C0FF929DFCFFAAB3FFFFAAB3FFFFAAB3FFFFAAB4FFFFAAB4FFFFAAB4FFFFAAB4
FFFFAAB4FFFFAAB3FFFFAAB3FFFFAAB3FFFF929DFCFF2B3BC0FF000000001117
485E2A3AC0FF2838BFFF2737BEFF2737BEFF2737BEFF2737BFFF2737BFFF2737
BFFF2737BEFF2737BEFF2737BEFF2838BFFF2A3AC0FF1117485E}
end>
end
object imgTreeView: TcxImageList
FormatVersion = 1
DesignInfo = 2097288
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000300000
0033000000330000003300000033000000330000003300000033000000330000
00330000003300000033000000330000002F00000000000000004190C6F24398
D2FF4094D0FF3E92CFFF3E92CEFF3F92CEFF3F92CEFF3F92CEFF3F92CEFF3F92
CEFF3F92CEFF3F92CEFF3F93CFFF3D8BC2F00000000E000000004499D2FF3F94
D0FFABFBFFFF9BF3FFFF92F1FFFF93F1FFFF93F1FFFF93F1FFFF93F1FFFF93F1
FFFF93F1FFFF93F1FFFFA6F8FFFF65B8E3FF122A3A5F000000004398D2FF4FA6
D9FF8EDAF5FFA2EEFFFF82E5FEFF84E5FEFF84E5FEFF85E6FEFF85E6FEFF85E6
FEFF85E6FEFF84E6FEFF96EBFFFF8CD8F5FF296088B8000000004296D1FF6BBE
E8FF6DBDE6FFBBF2FFFF75DEFDFF77DEFCFF78DEFCFF7BDFFCFF7DDFFCFF7DDF
FCFF7DDFFCFF7CDFFCFF80E0FDFFADF0FFFF4D9DD3FF0000000E4095D0FF8AD7
F5FF44A1D8FFDDFDFFFFDAFAFFFFDBFAFFFFDEFAFFFF74DCFCFF76DBFAFF75DA
FAFF74DAFAFF74DAFAFF72D9FAFFA1E8FFFF7CBFE6FF12293A5E3E94D0FFABF0
FFFF449DD6FF368CCBFF368CCBFF368CCBFF378BCBFF5CBEEAFF6FD9FBFF6AD6
FAFF68D5F9FF67D4F9FF66D4F9FF82DEFCFFAAE0F6FF296088B93D92CFFFB9F4
FFFF73DBFBFF6BCCF2FF6CCDF3FF6CCEF3FF6DCEF3FF479CD4FF56BAE9FFDAF8
FFFFD7F6FFFFD6F6FFFFD5F6FFFFD5F7FFFFDBFCFFFF3E94D0FF3C92CFFFC0F3
FFFF71DAFBFF74DBFBFF75DBFCFF75DBFCFF76DCFCFF73DAFAFF449CD4FF378C
CBFF368CCBFF358CCCFF348DCCFF3890CEFF3D94D0FF3E8CC2EB3B92CFFFCAF6
FFFF69D5F9FF6CD5F9FF6BD5F9FF69D5F9FF69D5FAFF6AD7FBFF68D4FAFF5EC7
F1FF5EC7F2FF5DC8F2FFB4E3F8FF3D94D0FF1A3B5269000000003B92CFFFD5F7
FFFF60D1F9FF61D0F8FFB4EBFDFFD9F6FFFFDAF8FFFFDAF8FFFFDBF9FFFFDCFA
FFFFDCFAFFFFDCFBFFFFE0FFFFFF3E95D0FF0E1F2A33000000003D94D0FFDCFC
FFFFD8F7FFFFD8F7FFFFDBFAFFFF358ECDFF3991CEFF3A92CFFF3A92CFFF3A92
CFFF3A92CFFF3B92CFFF3D94D0FF3880B1D700000000000000002E6991B03D94
D0FF3A92CFFF3A92CFFF3D94D0FF367CACD20000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000002200000033000000330000
0033000000330000003300000033000000330000002300000000000000000000
0030000000330000003300000033000000337B5426B9B78241FFB68142FFB681
42FFB68141FFB68142FFB68142FFB78343FF805C2FC00000000000000000A8A8
A6F2AFAFADFFAEAEABFFAEAFADFFAEB3B8FFB67C35FFF8CB85FFF4C47AFFF3C3
77FFF3C174FFF3C377FFF4C47AFFF9CC87FFB78243FF0000000000000000B0B0
ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB27730FFF2C787FFEAB76CFFE9B3
65FFFFFFFFFFE9B365FFEAB76CFFF2C98AFFB68141FF0000000000000000AEAE
ABFFFFFFFFFFFDFDFCFFFDFEFEFFFFFFFFFFB0752EFFEEC78EFFE2AE61FFE0A9
58FFFFFFFFFFE0A958FFE2AE61FFEEC990FFB68141FF0000000000000000ADAD
ABFFFFFFFFFFF8F8F8FFF9FAFBFFFEFFFFFFB0752DFFEBC994FFDAA252FFD89D
47FFFFFFFFFFD89D47FFDAA252FFECCA97FFB68140FF0000000000000000ADAD
ABFFFFFFFFFFF6F5F5FFF7F7F8FFFCFFFFFFB0752CFFEACA9CFFF3E4CEFFFFFF
FFFFFFFFFFFFFFFFFFFFF3E4CEFFEBCC9FFFB7813FFF0000000000000000ADAD
ABFFFFFFFFFFF3F2F2FFF4F3F4FFF8FBFFFFB0742AFFE8CA9EFFE6C79AFFE4C4
95FFE4C494FFE5C595FFE6C89BFFEACEA4FFB88241FF0000000000000000ADAD
ABFFFFFFFFFFF0F0EFFFF0F1F0FFF3F6F9FFCAA578FFB1742BFFB1752CFFB175
2BFFB1742BFFB2762DFFB57A33FFB8803CFF8F6634C40000000000000000ADAD
ABFFFFFFFFFFEEECEBFFEEEDECFFEFEFEFFFF1F3F5FFF1F5F9FFF2F5FBFFF2F6
FBFFF2F6FBFFFFFFFFFFAEB6BDFF00000000000000000000000000000000ADAD
ABFFFFFFFFFFEAE9E9FFEBEAEAFFEBEAEAFFEAE9EAFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFAEB0B1FF00000000000000000000000000000000ADAD
ABFFFFFFFFFFE7E7E6FFE8E8E7FFE8E8E7FFE6E6E5FFFFFFFFFFCBCBCAFFA6A6
A4FFA5A5A2FFFFFFFFFFAFAFADFF00000000000000000000000000000000AEAE
ABFFFFFFFFFFE4E3E2FFE5E4E3FFE5E4E3FFE4E3E2FFFFFFFFFFA6A6A4FFFBFB
FAFFFFFFFFFFE9E9E9FF777775AC00000000000000000000000000000000AEAE
ACFFFFFFFFFFE0DFDEFFE1DFDEFFE1DFDEFFE0DFDEFFFFFFFFFFA5A5A2FFFFFF
FFFFE7E7E8FF737371A70000000000000000000000000000000000000000AFAF
ADFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9E9
E9FF717170A6000000000000000000000000000000000000000000000000A8A8
A6EFB0B0ADFFAEAEACFFAEAEABFFAEAEABFFADAEABFFAEAEABFFAFAFADFFA2A2
A0EA000000000000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0023000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000230000000000000000000000006042
1FC08A5E2BFF895E2BFF895D2AFF895D2AFF895D29FF895C29FF895D29FF895D
2AFF895D2AFF895E2BFF8A5E2BFF60421FC00000000000000000000000008A5E
2BFFAE8D5BFFAA8653FFA98551FFA7824DFFA6814BFFA57F49FFA6814BFFA782
4DFFA98551FFAA8653FFAE8D5BFF8A5E2BFF000000000000000000000000895D
2AFFB18E5CFFA27E4AFF9E7841FFD8C8B1FF966D32FFFFFFFFFF966D32FFD8C8
B1FF9E7841FFA27E4AFFB18E5CFF895D2AFF000000000000000000000000895D
2AFFB3925EFF9E7742FFD7C6B0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFD7C6B0FF9E7742FFB3925EFF895D2AFF000000000000000000000000885C
29FFB69562FF9A723DFF91652AFFFFFFFFFFCFBBA0FF916429FFCFBBA0FFFFFF
FFFF91652AFF9A723DFFB69562FF885C29FF000000000000000000000000885C
29FFBA9865FF956D37FFFFFFFFFFFFFFFFFF8D6125FF936931FF8D6125FFFFFF
FFFFFFFFFFFF956D37FFBA9865FF885C29FF000000000000000000000000885C
29FFBC9C6AFF946B36FF8B5E23FFFFFFFFFFCBB89DFF8A5D21FFCBB89DFFFFFF
FFFF8B5E23FF946B36FFBC9C6AFF885C29FF000000000000000000000000885C
29FFC1A06EFF936934FFD2C0AAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFD1BFAAFF926833FFC1A06EFF885C29FF000000000000000000000000885C
29FFC4A373FF916834FF8E632DFFD2C0A9FF86581DFFFFFFFFFF84551AFFCEBC
A5FF8B5F29FF8E6530FFC3A271FF875C28FF000000000000000000000000875C
28FFC8A777FF906633FF916833FF906631FF8F642FFF8C602AFF9F7843FFC3A0
6DFFC4A270FFC4A271FFC6A474FF875B28FF000000000000000000000000875B
28FFCAAB7BFF8E6330FF916734FF926734FF916633FF8D622FFFC9A978FF9A72
3EFF7E4F18FF7D4E18FFC8A876FF875B28FF000000000000000000000000875B
28FFCEAF7EFF8A5F2CFF8D6330FF8E6431FF8D6330FF8A5F2CFFCCAD7BFF7E4F
18FFF6FFFFFFFFFFFFFFAF8956FF5C3E1CAC000000000000000000000000875B
28FFD1B181FF845824FF875B27FF885C28FF875B27FF845724FFCEAD7DFF7C4D
16FFFFFFFFFFAE8651FF573A17A700000000000000000000000000000000885C
29FFD5B687FFD4B585FFD4B586FFD5B586FFD4B586FFD3B485FFD1B282FFD1B2
81FFB38E59FF573917A600000000000000000000000000000000000000008159
29EF885C29FF875B28FF875B28FF875B28FF875B28FF865B27FF865A27FF875B
27FF7D5426EA0000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000230000
0033000000330000003300000033000000330000003300000033000000330000
00330000003300000033000000230000000000000000000000007B7B7AC0AFAF
ADFFAEAEACFFAEAEACFFAEAFADFFAFB0AEFFAFB0AFFFAFB0AEFFAFAFAEFFAFAF
ADFFAFAFADFFB0B0AEFF7B7B79BF000000000000000000000000B0B0ADFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFB1B1AEFF000000330000003300000023AEAEABFFFFFF
FFFFFFFFFFFFF7F3EFFFC38450FFA54800FFA64900FFA74900FFAA6B37FFACA8
A2FFABAFB0FFABACAAFFADADABFFAFAFADFFB0B1AEFF7B7B7AC0AEAEACFFFFFF
FFFFF5EFECFFAB5308FFC8843EFFE4B270FFE3AF6DFFE5B271FFCB8741FFAF57
0DFFEFE9E6FFF5F7FAFFF4F5F6FFF6F7F8FFFFFFFFFFB0B1AEFFAEAFADFFFFFF
FFFFC1844EFFC67F38FFDEA865FFDAA15BFFFFFFFFFFDAA25BFFDEA966FFC881
3AFFBE814DFFFFFFFFFFFFFFFFFFB48C75FFFFFFFFFFAFB0AEFFAFAFAEFFFFFF
FFFFA64900FFD89F5AFFD69C57FFD3944CFFFFFFFFFFD3944CFFD69C57FFD9A0
5BFFA94E00FFB89687FFB7907CFFB68E79FFFFFFFFFFAFAFADFFAFB0AFFFFFFF
FFFFA74A00FFDCAB71FFD19149FFCF8C41FFFFFFFFFFCF8C41FFD19149FFDDAB
72FFA94D00FFDEE8EFFFDCE0E2FFDCDFDFFFFFFFFFFFAFAFADFFAFAFAEFFFFFF
FFFFA64800FFE8CAA5FFCB8639FFCA8436FFC88130FFCA8436FFCB8639FFE9CB
A6FFA84B00FFFFFFFFFFFFFFFFFFB58D76FFFFFFFFFFAFAFADFFAEAFADFFFFFF
FFFFBD7E48FFCF9763FFE0B789FFC88236FFFFFFFFFFC88236FFE0B78AFFD099
65FFB47641FFB79381FFB68E7AFFB68D77FFFFFFFFFFAFB0AEFFAEAEACFFFFFF
FFFFE5DFDBFFAA5206FFCC945EFFE9CBAAFFE8C9A7FFE9CBABFFCE9660FFAF56
0BFFF8F4F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0B0AEFFAEAEABFFFFFF
FFFFE9ECEEFFE4DEDAFFBD7E47FFA74800FFA74900FFA84900FFAC6D37FFAEA9
A2FFACAFB0FFACADACFFAEAFADFFAFAFADFFB0B0AEFF7C7C7AB0AEAEABFFFFFF
FFFFE3E5E4FFE6E9EAFFE8EDF1FFE9F0F5FFE8F0F5FFFFFFFFFFAAB0B2FFEDF0
F1FFFFFFFFFFEBEBECFF727271A4000000000000000000000000AEAEACFFFFFF
FFFFE0DFDEFFE1E0DFFFE1E1E1FFE1E2E1FFE1E1E1FFFFFFFFFFA6A7A5FFFFFF
FFFFE8E8E8FF737371A700000000000000000000000000000000AFAFADFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9E9
E9FF717170A60000000000000000000000000000000000000000A8A8A6EFB0B0
ADFFAEAEACFFAEAEABFFAEAEABFFAEAEABFFADAEABFFAEAEABFFAFAFADFFA2A2
A0EA000000000000000000000000000000000000000000000000}
end>
end
end

View File

@ -0,0 +1,192 @@
unit formEditorCPUIDFeatureFlags;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, System.UITypes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxOI, Vcl.StdCtrls, System.ImageList,
Vcl.ImgList, cxGraphics, VirtualTrees, Zydis.InstructionEditor;
type
TfrmEditorCPUIDFeatureFlags = class(TForm)
GroupBox: TGroupBox;
btnCancel: TButton;
imgIcons16: TcxImageList;
btnApply: TButton;
VirtualTreeView: TVirtualStringTree;
imgTreeView: TcxImageList;
procedure btnApplyClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure VirtualTreeViewChecked(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure VirtualTreeViewCollapsing(Sender: TBaseVirtualTree; Node: PVirtualNode;
var Allowed: Boolean);
procedure VirtualTreeViewFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure VirtualTreeViewGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode;
Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean;
var ImageIndex: System.UITypes.TImageIndex);
procedure VirtualTreeViewGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
strict private
FApplyChanges: Boolean;
FFeatureFlags: TCPUIDFeatureFlagSet;
strict private
procedure SetFeatureFlags(const Value: TCPUIDFeatureFlagSet);
public
property ApplyChanges: Boolean read FApplyChanges;
property FeatureFlags: TCPUIDFeatureFlagSet read FFeatureFlags write SetFeatureFlags;
end;
var
frmEditorCPUIDFeatureFlags: TfrmEditorCPUIDFeatureFlags;
implementation
uses
System.TypInfo;
{$R *.dfm}
type
PNodeData = ^TNodeData;
TNodeData = record
public
Text: String;
Value: TCPUIDFeatureFlag;
end;
procedure TfrmEditorCPUIDFeatureFlags.btnApplyClick(Sender: TObject);
begin
FApplyChanges := true;
Close;
end;
procedure TfrmEditorCPUIDFeatureFlags.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TfrmEditorCPUIDFeatureFlags.FormCreate(Sender: TObject);
var
Root,
Node: PVirtualNode;
NodeData: PNodeData;
C: TCPUIDFeatureFlag;
S: String;
begin
FFeatureFlags := [];
VirtualTreeView.NodeDataSize := SizeOf(TNodeData);
VirtualTreeView.BeginUpdate;
try
Root := VirtualTreeView.AddChild(nil);
NodeData := VirtualTreeView.GetNodeData(Root);
NodeData^.Text := 'CPUID Feature Flags';
for C := Low(TCPUIDFeatureFlag) to High(TCPUIDFeatureFlag) do
begin
Node := VirtualTreeView.AddChild(Root);
VirtualTreeView.CheckType[Node] := ctCheckBox;
NodeData := VirtualTreeView.GetNodeData(Node);
S := GetEnumName(TypeInfo(TCPUIDFeatureFlag), Ord(C));
Delete(S, 1, 2);
NodeData^.Text := S;
NodeData^.Value := C;
end;
VirtualTreeView.Expanded[Root] := true;
finally
VirtualTreeView.EndUpdate;
end;
end;
procedure TfrmEditorCPUIDFeatureFlags.SetFeatureFlags(const Value: TCPUIDFeatureFlagSet);
var
Node: PVirtualNode;
NodeData: PNodeData;
begin
VirtualTreeView.BeginUpdate;
try
Node := VirtualTreeView.GetFirst;
while (Assigned(Node)) do
begin
NodeData := VirtualTreeView.GetNodeData(Node);
if (Assigned(NodeData) and (Node.Parent <> VirtualTreeView.RootNode)) then
begin
if (NodeData^.Value in Value) then
begin
VirtualTreeView.CheckState[Node] := csCheckedNormal;
end else
begin
VirtualTreeView.CheckState[Node] := csUncheckedNormal;
end;
end;
Node := VirtualTreeView.GetNext(Node);
end;
finally
VirtualTreeView.EndUpdate;
end;
end;
procedure TfrmEditorCPUIDFeatureFlags.VirtualTreeViewChecked(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
NodeData: PNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
case Sender.CheckState[Node] of
csCheckedNormal:
FFeatureFlags := FFeatureFlags + [NodeData^.Value];
csUncheckedNormal:
FFeatureFlags := FFeatureFlags - [NodeData^.Value];
end;
end;
end;
procedure TfrmEditorCPUIDFeatureFlags.VirtualTreeViewCollapsing(Sender: TBaseVirtualTree;
Node: PVirtualNode; var Allowed: Boolean);
begin
Allowed := false;
end;
procedure TfrmEditorCPUIDFeatureFlags.VirtualTreeViewFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
NodeData: PNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
Finalize(NodeData^);
end;
end;
procedure TfrmEditorCPUIDFeatureFlags.VirtualTreeViewGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean;
var ImageIndex: System.UITypes.TImageIndex);
begin
ImageIndex := -1;
if (Kind in [ikNormal, ikSelected]) then
begin
if (Node.Parent = Sender.RootNode) then
begin
ImageIndex := 0;
end else
begin
ImageIndex := 1;
end;
end;
end;
procedure TfrmEditorCPUIDFeatureFlags.VirtualTreeViewGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
var
NodeData: PNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
CellText := NodeData^.Text;
end;
end;
end.

View File

@ -0,0 +1,244 @@
object frmEditorX86Registers: TfrmEditorX86Registers
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'frmEditorX86Registers'
ClientHeight = 471
ClientWidth = 694
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object GroupBox: TGroupBox
AlignWithMargins = True
Left = 3
Top = 429
Width = 688
Height = 39
Margins.Top = 0
Align = alBottom
TabOrder = 1
DesignSize = (
688
39)
object btnCancel: TButton
Left = 568
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Cancel'
ImageIndex = 1
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 1
OnClick = btnCancelClick
end
object btnApply: TButton
Left = 450
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Apply'
ImageIndex = 0
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 0
OnClick = btnApplyClick
end
end
object VirtualTreeView: TVirtualStringTree
AlignWithMargins = True
Left = 3
Top = 3
Width = 688
Height = 423
Align = alClient
Header.AutoSizeIndex = -1
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.MainColumn = -1
Images = imgTreeView
TabOrder = 0
TreeOptions.MiscOptions = [toCheckSupport, toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toShowHorzGridLines, toShowTreeLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines, toAlwaysHideSelection, toUseBlendedSelection]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnChecked = VirtualTreeViewChecked
OnCollapsing = VirtualTreeViewCollapsing
OnFreeNode = VirtualTreeViewFreeNode
OnGetText = VirtualTreeViewGetText
OnGetImageIndex = VirtualTreeViewGetImageIndex
Columns = <>
end
object imgIcons16: TcxImageList
FormatVersion = 1
DesignInfo = 2097208
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
20000000000000040000000000000000000000000000000000000000001B0000
0033000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000001B00000000004B29A00089
49FF008747FF008747FF008747FF008747FF008747FF008747FF008747FF0087
47FF008747FF008747FF008747FF008949FF004B29A000000000008949FF07E4
A4FF07E5A5FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4
A4FF07E4A4FF07E4A4FF07E5A5FF07E4A4FF008949FF00000000008747FF13E7
AAFF00DB9BFF00DA9AFF00DA99FF00DA99FF00DA99FF00DA99FF00DA9AFF00DA
9AFF00DA9AFF00DA9AFF00DB9BFF13E7AAFF008747FF00000000008746FF1EE7
AEFF00D699FF00D698FF00D495FF00D391FF00D391FF00D495FF00D698FF00D6
99FF00D699FF00D699FF00D699FF1EE7AEFF008746FF00000000008746FF2AE9
B3FF00D299FF00D095FF00CC8DFFFFFFFFFFFFFFFFFF00CC8DFF00D096FF00D2
99FF00D29AFF00D29AFF00D29AFF2AE9B3FF008746FF00000000008746FF35EA
B7FF00CD96FF00C98DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C98DFF00CD
96FF00CF99FF00CF9AFF00CF9AFF36EAB8FF008746FF00000000008745FF3EEB
BBFF00C692FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C4
8DFF00C995FF00CA99FF00CA99FF41ECBDFF008745FF00000000008745FF4BED
BFFF00C393FFFFFFFFFFFFFFFFFF00C08BFF00BF8BFFFFFFFFFFFFFFFFFFFFFF
FFFF00C18EFF00C596FF00C699FF4DEDC0FF008745FF00000000008744FF58EF
C5FF00C197FF00BF93FF00C093FF00C196FF00C196FF00BC8EFFFFFFFFFFFFFF
FFFFFFFFFFFF00BC8EFF00C096FF58EFC5FF008744FF00000000008744FF64F1
CAFF00BE99FF00C099FF00C09AFF00C19BFF00C19AFF00BE97FF00B98EFFFFFF
FFFFFFFFFFFFFFFFFFFF00BA92FF62F0C9FF008744FF00000000008744FF71F2
CFFF00BB99FF00BD9AFF00BE9BFF00BE9BFF00BE9BFF00BE9AFF00BB96FF00B6
8EFFFFFFFFFFFFFFFFFF00B792FF6EF2CDFF008744FF00000000008744FF7BF4
D3FF00B699FF00B89AFF00B99BFF00B99BFF00B99BFF00B99BFF00B89AFF00B7
98FF00B494FF00B493FF00B496FF7AF3D3FF008744FF00000000008744FF86F5
D8FF00B198FF00B299FF00B399FF00B399FF00B399FF00B399FF00B399FF00B2
99FF00B298FF00B297FF00B197FF86F5D8FF008744FF00000000008946FF8AF2
D9FF92F6DEFF93F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6
DDFF94F6DDFF93F6DDFF92F6DEFF8AF2D9FF008946FF00000000004B29880089
46FF008743FF008643FF008643FF008643FF008643FF008643FF008643FF0086
43FF008643FF008643FF008743FF008946FF004B298800000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0013000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000003300000013000000001117
487E2D3CC0FF2B3BBEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3A
BEFF2A3ABEFF2A3ABEFF2A3ABEFF2B3BBEFF2D3CC0FF1117487E000000002D3D
C0FF6172FAFF6A7DFFFF697CFFFF6D80FFFF7485FFFF7788FFFF7788FFFF7788
FFFF7485FFFF6D7FFFFF697CFFFF6A7DFFFF6172FAFF2D3DC0FF000000002B3B
BEFF6578FFFF5F73FEFF6F80FFFF7989FFFF5868E6FF3E4ED0FF3F4FD1FF3E4E
D0FF5767E5FF7887FEFF6E7FFFFF5F73FEFF6578FFFF2B3BBEFF000000002B3B
BEFF5D72FFFF697BFEFF7785F8FF3949CAFF1E2A89B70B0F303F07091D26070A
1F552636B9FF5A6FFDFF576CFAFF687AFCFF5D71FFFF2B3BBEFF000000002C3B
BFFF586EFEFF8593FFFF3B4BCAFF0E143F530000000000000000000000332B3A
BDFF5970FEFF546AFBFF7F8FFFFF8290FDFF586EFEFF2C3BBFFF000000002C3C
BFFF536BFCFF707CE7FF1E2A89BB0000000000000000000000332C3BBEFF546B
FBFF5067F8FF8796FFFF3B4BCDFF6D79E5FF536AFCFF2C3CBFFF000000002D3D
BFFF4F68FBFF4E5BD1FF0B0F304500000000000000332C3BBEFF4E66F9FF4A63
F6FF8C99FFFF2737BCFF07091F314D5AD0FF4F68FBFF2D3DBFFF000000002E3D
C0FF4A64F9FF3446CDFF07091D2D000000332D3CBEFF4862F7FF445DF4FF8E9C
FFFF2838BDFF0000000007091D313446CDFF4A64F9FF2E3DC0FF000000002E3D
C0FF4660F7FF3445CCFF080A20552D3CBEFF445DF4FF3F59F1FF929FFFFF2838
BDFF00000000000000000C0F305B3445CDFF4660F7FF2E3DC0FF000000002E3E
C0FF405BF3FF384DDBFF2E3CBCFF3E59F2FF3954EFFF95A2FFFF2838BDFF0000
00000000000000000011222D8AC5384EDCFF405BF3FF2E3EC0FF000000002F3E
C0FF3955F0FF3951EAFF3954EEFF3651EDFF9AA5FFFF2838BDFF000000080000
000D0000002510153F753041C8FF3A53EBFF3A55F0FF2F3EC0FF000000002E3D
BFFF3A54EFFF324DE9FF334DE9FF324DEBFF2A39BCFF070A1F5507091D510B0F
3065212D8AC52F41C8FF314CE4FF324DEBFF3A54EFFF2E3DBFFF000000002B3B
BFFF6A7DFDFF334EE8FF2643E4FF2642E3FF253CD4FF2739C7FF273AC8FF273A
C8FF263DD5FF2743E5FF2643E6FF334EE9FF6A7DFDFF2B3BBFFF000000002B3B
C0FF929DFCFFAAB3FFFFAAB3FFFFAAB3FFFFAAB4FFFFAAB4FFFFAAB4FFFFAAB4
FFFFAAB4FFFFAAB3FFFFAAB3FFFFAAB3FFFF929DFCFF2B3BC0FF000000001117
485E2A3AC0FF2838BFFF2737BEFF2737BEFF2737BEFF2737BFFF2737BFFF2737
BFFF2737BEFF2737BEFF2737BEFF2838BFFF2A3AC0FF1117485E}
end>
end
object imgTreeView: TcxImageList
FormatVersion = 1
DesignInfo = 2097288
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000300000
0033000000330000003300000033000000330000003300000033000000330000
00330000003300000033000000330000002F00000000000000004190C6F24398
D2FF4094D0FF3E92CFFF3E92CEFF3F92CEFF3F92CEFF3F92CEFF3F92CEFF3F92
CEFF3F92CEFF3F92CEFF3F93CFFF3D8BC2F00000000E000000004499D2FF3F94
D0FFABFBFFFF9BF3FFFF92F1FFFF93F1FFFF93F1FFFF93F1FFFF93F1FFFF93F1
FFFF93F1FFFF93F1FFFFA6F8FFFF65B8E3FF122A3A5F000000004398D2FF4FA6
D9FF8EDAF5FFA2EEFFFF82E5FEFF84E5FEFF84E5FEFF85E6FEFF85E6FEFF85E6
FEFF85E6FEFF84E6FEFF96EBFFFF8CD8F5FF296088B8000000004296D1FF6BBE
E8FF6DBDE6FFBBF2FFFF75DEFDFF77DEFCFF78DEFCFF7BDFFCFF7DDFFCFF7DDF
FCFF7DDFFCFF7CDFFCFF80E0FDFFADF0FFFF4D9DD3FF0000000E4095D0FF8AD7
F5FF44A1D8FFDDFDFFFFDAFAFFFFDBFAFFFFDEFAFFFF74DCFCFF76DBFAFF75DA
FAFF74DAFAFF74DAFAFF72D9FAFFA1E8FFFF7CBFE6FF12293A5E3E94D0FFABF0
FFFF449DD6FF368CCBFF368CCBFF368CCBFF378BCBFF5CBEEAFF6FD9FBFF6AD6
FAFF68D5F9FF67D4F9FF66D4F9FF82DEFCFFAAE0F6FF296088B93D92CFFFB9F4
FFFF73DBFBFF6BCCF2FF6CCDF3FF6CCEF3FF6DCEF3FF479CD4FF56BAE9FFDAF8
FFFFD7F6FFFFD6F6FFFFD5F6FFFFD5F7FFFFDBFCFFFF3E94D0FF3C92CFFFC0F3
FFFF71DAFBFF74DBFBFF75DBFCFF75DBFCFF76DCFCFF73DAFAFF449CD4FF378C
CBFF368CCBFF358CCCFF348DCCFF3890CEFF3D94D0FF3E8CC2EB3B92CFFFCAF6
FFFF69D5F9FF6CD5F9FF6BD5F9FF69D5F9FF69D5FAFF6AD7FBFF68D4FAFF5EC7
F1FF5EC7F2FF5DC8F2FFB4E3F8FF3D94D0FF1A3B5269000000003B92CFFFD5F7
FFFF60D1F9FF61D0F8FFB4EBFDFFD9F6FFFFDAF8FFFFDAF8FFFFDBF9FFFFDCFA
FFFFDCFAFFFFDCFBFFFFE0FFFFFF3E95D0FF0E1F2A33000000003D94D0FFDCFC
FFFFD8F7FFFFD8F7FFFFDBFAFFFF358ECDFF3991CEFF3A92CFFF3A92CFFF3A92
CFFF3A92CFFF3B92CFFF3D94D0FF3880B1D700000000000000002E6991B03D94
D0FF3A92CFFF3A92CFFF3D94D0FF367CACD20000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000330000000000000033000000000000003300000000000000330000
000000000033000000000000003300000000000000330000000C000000000000
0000519DD5FF00000005519DD3FF00000005519DD3FF00000005519DD3FF0000
0005519DD3FF00000005519DD3FF000000055299CBFF14253046000000000000
002E50A0D9FF0A090947509FD8FF0A090947509FD8FF0A090947509FD8FF0A09
0947509FD8FF0A090947509FD8FF0A090947519CD2FF0F1D2755000000005C5B
5AEC666361FF676462FF676461FF676462FF676461FF676462FF676461FF6764
62FF676461FF676462FF676461FF676361FF67625EFF5D5653EA000000006565
65FF625F5DFF585554FF585554FF585554FF585554FF585554FF585554FF5855
54FF585554FF585654FF595655FF585554FF625E5DFF656564FF000000006565
65FF6E6C6BFF52504FFF4F4D4CFF4E4C4BFF4F4C4BFF4F4D4CFF4F4D4CFF4F4D
4CFF4F4D4CFF514F4EFF545251FF545251FF6F6C6BFF656565FF000000006364
64FF7B7A79FF4A4847FFC1C0C0FFB1B0AFFFA7A6A6FF878585FFCECDCDFFAAA9
A9FF939291FFC5C4C4FF4E4C4AFF504E4DFF7C7C7AFF636464FF000000006363
63FF888686FF424040FFDCDCDCFFD5D6D6FFC0C0C0FFBAB9B9FF3A3838FFBBBA
BBFF747373FFCDCCCCFF494747FF4C4A4AFF8A8888FF636363FF000000006262
62FF969595FF403E3EFFE1E0E0FFCFCECEFFC5C4C4FFA5A3A3FFA7A7A5FFC9C8
C8FFBEBDBDFF9F9F9FFF484646FF484646FF979696FF626262FF000000006161
61FFA5A4A4FF3E3C3CFF3D3B3BFF3C3A3AFF3C3A3AFF3E3C3CFF3F3D3DFF3E3B
3BFF3E3C3CFF413F3FFF444242FF423F3FFFA5A4A4FF616161FF000000006161
61FFB5B4B3FF8D8B8AFF8F8C8CFF8F8C8CFF8F8C8CFF8F8D8CFF8F8D8CFF8F8D
8CFF8F8D8CFF908D8DFF908D8DFF8E8B8BFFB5B4B3FF616161FF000000004341
40AA625F5CFF625F5CFF635F5DFF63605DFF63605DFF63605DFF63605DFF6360
5DFF63605DFF63605DFF635F5DFF625F5CFF625F5CFF535150D4000000000000
0000509CD3FF00000000509CD3FF00000000509CD3FF00000000509CD3FF0000
0000509CD3FF00000000509CD3FF00000000509CD3FF00000000000000000000
00005397C8FF000000005397C7FF000000005397C7FF000000005397C7FF0000
00005397C7FF000000005397C7FF000000005397C8FF00000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end>
end
end

View File

@ -0,0 +1,270 @@
unit formEditorX86Registers;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes,
System.UITypes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Zydis.InstructionEditor,
System.ImageList, Vcl.ImgList, cxGraphics, Vcl.StdCtrls, VirtualTrees;
type
TfrmEditorX86Registers = class(TForm)
GroupBox: TGroupBox;
btnCancel: TButton;
btnApply: TButton;
imgIcons16: TcxImageList;
VirtualTreeView: TVirtualStringTree;
imgTreeView: TcxImageList;
procedure btnApplyClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure VirtualTreeViewFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure VirtualTreeViewGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode;
Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean;
var ImageIndex: System.UITypes.TImageIndex);
procedure VirtualTreeViewGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
procedure VirtualTreeViewCollapsing(Sender: TBaseVirtualTree; Node: PVirtualNode;
var Allowed: Boolean);
procedure VirtualTreeViewChecked(Sender: TBaseVirtualTree; Node: PVirtualNode);
strict private
FApplyChanges: Boolean;
FRegisters: TX86RegisterSet;
strict private
procedure SetRegisters(const Value: TX86RegisterSet);
public
property ApplyChanges: Boolean read FApplyChanges;
property Registers: TX86RegisterSet read FRegisters write SetRegisters;
end;
var
frmEditorX86Registers: TfrmEditorX86Registers;
implementation
uses
System.TypInfo;
{$R *.dfm}
type
PNodeData = ^TNodeData;
TNodeData = record
public
IsCategory: Boolean;
Text: String;
Value: TX86Register;
end;
{ TfrmEditorX86Registers }
procedure TfrmEditorX86Registers.btnApplyClick(Sender: TObject);
begin
FApplyChanges := true;
Close;
end;
procedure TfrmEditorX86Registers.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TfrmEditorX86Registers.FormCreate(Sender: TObject);
function AddCategory(Root: PVirtualNode; const Text: String): PVirtualNode;
var
NodeData: PNodeData;
begin
Result := VirtualTreeView.AddChild(Root);
if (Assigned(Root)) then
begin
VirtualTreeView.CheckType[Result] := ctTriStateCheckBox;
end;
NodeData := VirtualTreeView.GetNodeData(Result);
NodeData^.IsCategory := true;
NodeData^.Text := Text;
end;
procedure AddRegisterRange(Root: PVirtualNode; RegisterLow, RegisterHigh: TX86Register);
var
Node: PVirtualNode;
NodeData: PNodeData;
R: TX86Register;
S: String;
begin
for R := RegisterLow to RegisterHigh do
begin
Node := VirtualTreeView.AddChild(Root);
VirtualTreeView.CheckType[Node] := ctTriStateCheckBox;
NodeData := VirtualTreeView.GetNodeData(Node);
NodeData^.IsCategory := false;
S := GetEnumName(TypeInfo(TX86Register), Ord(R));
Delete(S, 1, 3);
NodeData^.Text := S;
NodeData^.Value := R;
end;
end;
var
Root, N1, N2: PVirtualNode;
begin
FRegisters := [];
VirtualTreeView.NodeDataSize := SizeOf(TNodeData);
VirtualTreeView.BeginUpdate;
try
Root := AddCategory(nil, 'Root');
N1 := AddCategory(Root, 'General Purpose Registers');
N2 := AddCategory(N1, '64-bit');
AddRegisterRange(N2, regRAX, regR15);
N2 := AddCategory(N1, '32-bit');
AddRegisterRange(N2, regEAX, regR15D);
N2 := AddCategory(N1, '16-bit');
AddRegisterRange(N2, regAX, regR15W);
N2 := AddCategory(N1, '8-bit');
AddRegisterRange(N2, regAL, regR15B);
VirtualTreeView.Expanded[N1] := true;
N1 := AddCategory(Root, 'Floating Point Registers');
N2 := AddCategory(N1, 'Legacy');
AddRegisterRange(N2, regST0, regST7);
N2 := AddCategory(N1, 'Multimedia');
AddRegisterRange(N2, regMM0, regMM7);
VirtualTreeView.Expanded[N1] := true;
N1 := AddCategory(Root, 'Vector Registers');
N2 := AddCategory(N1, '512-bit');
AddRegisterRange(N2, regZMM0, regZMM31);
N2 := AddCategory(N1, '256-bit');
AddRegisterRange(N2, regYMM0, regYMM31);
N2 := AddCategory(N1, '128-bit');
AddRegisterRange(N2, regXMM0, regXMM31);
VirtualTreeView.Expanded[N1] := true;
N1 := AddCategory(Root, 'Special Registers');
AddRegisterRange(N1, regRFLAGS, regXCR0);
N1 := AddCategory(Root, 'Segment Registers');
AddRegisterRange(N1, regES, regFS);
N1 := AddCategory(Root, 'Table Registers');
AddRegisterRange(N1, regGDTR, regTR);
N1 := AddCategory(Root, 'Test Registers');
AddRegisterRange(N1, regTR0, regTR7);
N1 := AddCategory(Root, 'Control Registers');
AddRegisterRange(N1, regCR0, regCR15);
N1 := AddCategory(Root, 'Debug Registers');
AddRegisterRange(N1, regDR0, regDR15);
N1 := AddCategory(Root, 'Mask Registers');
AddRegisterRange(N1, regK0, regK7);
N1 := AddCategory(Root, 'Bound Registers');
AddRegisterRange(N1, regBND0, regBNDSTATUS);
VirtualTreeView.Expanded[Root] := true;
finally
VirtualTreeView.EndUpdate;
end;
end;
procedure TfrmEditorX86Registers.VirtualTreeViewChecked(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
NodeData: PNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData) and (not NodeData^.IsCategory)) then
begin
case Sender.CheckState[Node] of
csCheckedNormal:
FRegisters := FRegisters + [NodeData^.Value];
csUncheckedNormal:
FRegisters := FRegisters - [NodeData^.Value];
end;
end;
end;
procedure TfrmEditorX86Registers.VirtualTreeViewCollapsing(Sender: TBaseVirtualTree;
Node: PVirtualNode; var Allowed: Boolean);
begin
Allowed := (Node.Parent <> Sender.RootNode);
end;
procedure TfrmEditorX86Registers.VirtualTreeViewFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
NodeData: PNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
Finalize(NodeData^);
end;
end;
procedure TfrmEditorX86Registers.VirtualTreeViewGetImageIndex(Sender: TBaseVirtualTree;
Node: PVirtualNode; Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean;
var ImageIndex: System.UITypes.TImageIndex);
var
NodeData: PNodeData;
begin
ImageIndex := -1;
if (Kind in [ikNormal, ikSelected]) then
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
if (NodeData^.IsCategory) then
begin
ImageIndex := 0;
end else
begin
ImageIndex := 1;
end;
end;
end;
end;
procedure TfrmEditorX86Registers.VirtualTreeViewGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
var
NodeData: PNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
CellText := NodeData^.Text;
end;
end;
procedure TfrmEditorX86Registers.SetRegisters(const Value: TX86RegisterSet);
var
Node: PVirtualNode;
NodeData: PNodeData;
begin
VirtualTreeView.BeginUpdate;
try
Node := VirtualTreeView.GetFirst;
while (Assigned(Node)) do
begin
NodeData := VirtualTreeView.GetNodeData(Node);
if (Assigned(NodeData) and (not NodeData^.IsCategory)) then
begin
if (NodeData^.Value in Value) then
begin
VirtualTreeView.CheckState[Node] := csCheckedNormal;
end else
begin
VirtualTreeView.CheckState[Node] := csUncheckedNormal;
end;
end;
Node := VirtualTreeView.GetNext(Node);
end;
finally
VirtualTreeView.EndUpdate;
end;
end;
end.

View File

@ -0,0 +1,203 @@
object frmCodeGenerator: TfrmCodeGenerator
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'Code Generator'
ClientHeight = 204
ClientWidth = 449
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object GroupBox: TGroupBox
AlignWithMargins = True
Left = 3
Top = 162
Width = 443
Height = 39
Margins.Top = 0
Align = alBottom
TabOrder = 0
DesignSize = (
443
39)
object btnClose: TButton
Left = 323
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Close'
ImageIndex = 1
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 1
OnClick = btnCloseClick
end
object btnGenerate: TButton
Left = 205
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Generate'
ImageIndex = 0
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 0
OnClick = btnGenerateClick
end
end
object PageControl1: TPageControl
AlignWithMargins = True
Left = 3
Top = 3
Width = 443
Height = 156
ActivePage = TabSheet1
Align = alClient
TabOrder = 1
object TabSheet1: TTabSheet
Caption = 'Code Generator'
object GroupBox1: TGroupBox
AlignWithMargins = True
Left = 3
Top = 3
Width = 429
Height = 122
Align = alClient
TabOrder = 0
DesignSize = (
429
122)
object Label1: TLabel
Left = 16
Top = 16
Width = 73
Height = 13
Caption = 'Total Progress:'
end
object Label2: TLabel
Left = 16
Top = 64
Width = 92
Height = 13
Caption = 'Current Operation:'
end
object lblOperationName: TLabel
Left = 114
Top = 64
Width = 3
Height = 13
end
object pbTotalProgress: TProgressBar
Left = 16
Top = 35
Width = 398
Height = 17
Anchors = [akLeft, akTop, akRight]
ParentShowHint = False
ShowHint = False
TabOrder = 0
end
object pbCurrentOperation: TProgressBar
Left = 16
Top = 83
Width = 398
Height = 17
Anchors = [akLeft, akTop, akRight]
ParentShowHint = False
ShowHint = False
TabOrder = 1
end
end
end
end
object imgIcons16: TcxImageList
FormatVersion = 1
DesignInfo = 524392
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
20000000000000040000000000000000000000000000000000000000001B0000
0033000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000001B00000000004B29A00089
49FF008747FF008747FF008747FF008747FF008747FF008747FF008747FF0087
47FF008747FF008747FF008747FF008949FF004B29A000000000008949FF07E4
A4FF07E5A5FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4
A4FF07E4A4FF07E4A4FF07E5A5FF07E4A4FF008949FF00000000008747FF13E7
AAFF00DB9BFF00DA9AFF00DA99FF00DA99FF00DA99FF00DA99FF00DA9AFF00DA
9AFF00DA9AFF00DA9AFF00DB9BFF13E7AAFF008747FF00000000008746FF1EE7
AEFF00D699FF00D698FF00D495FF00D391FF00D391FF00D495FF00D698FF00D6
99FF00D699FF00D699FF00D699FF1EE7AEFF008746FF00000000008746FF2AE9
B3FF00D299FF00D095FF00CC8DFFFFFFFFFFFFFFFFFF00CC8DFF00D096FF00D2
99FF00D29AFF00D29AFF00D29AFF2AE9B3FF008746FF00000000008746FF35EA
B7FF00CD96FF00C98DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C98DFF00CD
96FF00CF99FF00CF9AFF00CF9AFF36EAB8FF008746FF00000000008745FF3EEB
BBFF00C692FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C4
8DFF00C995FF00CA99FF00CA99FF41ECBDFF008745FF00000000008745FF4BED
BFFF00C393FFFFFFFFFFFFFFFFFF00C08BFF00BF8BFFFFFFFFFFFFFFFFFFFFFF
FFFF00C18EFF00C596FF00C699FF4DEDC0FF008745FF00000000008744FF58EF
C5FF00C197FF00BF93FF00C093FF00C196FF00C196FF00BC8EFFFFFFFFFFFFFF
FFFFFFFFFFFF00BC8EFF00C096FF58EFC5FF008744FF00000000008744FF64F1
CAFF00BE99FF00C099FF00C09AFF00C19BFF00C19AFF00BE97FF00B98EFFFFFF
FFFFFFFFFFFFFFFFFFFF00BA92FF62F0C9FF008744FF00000000008744FF71F2
CFFF00BB99FF00BD9AFF00BE9BFF00BE9BFF00BE9BFF00BE9AFF00BB96FF00B6
8EFFFFFFFFFFFFFFFFFF00B792FF6EF2CDFF008744FF00000000008744FF7BF4
D3FF00B699FF00B89AFF00B99BFF00B99BFF00B99BFF00B99BFF00B89AFF00B7
98FF00B494FF00B493FF00B496FF7AF3D3FF008744FF00000000008744FF86F5
D8FF00B198FF00B299FF00B399FF00B399FF00B399FF00B399FF00B399FF00B2
99FF00B298FF00B297FF00B197FF86F5D8FF008744FF00000000008946FF8AF2
D9FF92F6DEFF93F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6
DDFF94F6DDFF93F6DDFF92F6DEFF8AF2D9FF008946FF00000000004B29880089
46FF008743FF008643FF008643FF008643FF008643FF008643FF008643FF0086
43FF008643FF008643FF008743FF008946FF004B298800000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0013000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000003300000013000000001117
487E2D3CC0FF2B3BBEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3A
BEFF2A3ABEFF2A3ABEFF2A3ABEFF2B3BBEFF2D3CC0FF1117487E000000002D3D
C0FF6172FAFF6A7DFFFF697CFFFF6D80FFFF7485FFFF7788FFFF7788FFFF7788
FFFF7485FFFF6D7FFFFF697CFFFF6A7DFFFF6172FAFF2D3DC0FF000000002B3B
BEFF6578FFFF5F73FEFF6F80FFFF7989FFFF5868E6FF3E4ED0FF3F4FD1FF3E4E
D0FF5767E5FF7887FEFF6E7FFFFF5F73FEFF6578FFFF2B3BBEFF000000002B3B
BEFF5D72FFFF697BFEFF7785F8FF3949CAFF1E2A89B70B0F303F07091D26070A
1F552636B9FF5A6FFDFF576CFAFF687AFCFF5D71FFFF2B3BBEFF000000002C3B
BFFF586EFEFF8593FFFF3B4BCAFF0E143F530000000000000000000000332B3A
BDFF5970FEFF546AFBFF7F8FFFFF8290FDFF586EFEFF2C3BBFFF000000002C3C
BFFF536BFCFF707CE7FF1E2A89BB0000000000000000000000332C3BBEFF546B
FBFF5067F8FF8796FFFF3B4BCDFF6D79E5FF536AFCFF2C3CBFFF000000002D3D
BFFF4F68FBFF4E5BD1FF0B0F304500000000000000332C3BBEFF4E66F9FF4A63
F6FF8C99FFFF2737BCFF07091F314D5AD0FF4F68FBFF2D3DBFFF000000002E3D
C0FF4A64F9FF3446CDFF07091D2D000000332D3CBEFF4862F7FF445DF4FF8E9C
FFFF2838BDFF0000000007091D313446CDFF4A64F9FF2E3DC0FF000000002E3D
C0FF4660F7FF3445CCFF080A20552D3CBEFF445DF4FF3F59F1FF929FFFFF2838
BDFF00000000000000000C0F305B3445CDFF4660F7FF2E3DC0FF000000002E3E
C0FF405BF3FF384DDBFF2E3CBCFF3E59F2FF3954EFFF95A2FFFF2838BDFF0000
00000000000000000011222D8AC5384EDCFF405BF3FF2E3EC0FF000000002F3E
C0FF3955F0FF3951EAFF3954EEFF3651EDFF9AA5FFFF2838BDFF000000080000
000D0000002510153F753041C8FF3A53EBFF3A55F0FF2F3EC0FF000000002E3D
BFFF3A54EFFF324DE9FF334DE9FF324DEBFF2A39BCFF070A1F5507091D510B0F
3065212D8AC52F41C8FF314CE4FF324DEBFF3A54EFFF2E3DBFFF000000002B3B
BFFF6A7DFDFF334EE8FF2643E4FF2642E3FF253CD4FF2739C7FF273AC8FF273A
C8FF263DD5FF2743E5FF2643E6FF334EE9FF6A7DFDFF2B3BBFFF000000002B3B
C0FF929DFCFFAAB3FFFFAAB3FFFFAAB3FFFFAAB4FFFFAAB4FFFFAAB4FFFFAAB4
FFFFAAB4FFFFAAB3FFFFAAB3FFFFAAB3FFFF929DFCFF2B3BC0FF000000001117
485E2A3AC0FF2838BFFF2737BEFF2737BEFF2737BEFF2737BFFF2737BFFF2737
BFFF2737BEFF2737BEFF2737BEFF2838BFFF2A3AC0FF1117485E}
end>
end
end

View File

@ -0,0 +1,115 @@
unit formCodeGenerator;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, System.ImageList, Vcl.ImgList, cxGraphics, Vcl.StdCtrls,
Vcl.ComCtrls, Zydis.InstructionEditor;
type
TfrmCodeGenerator = class(TForm)
GroupBox: TGroupBox;
btnClose: TButton;
btnGenerate: TButton;
imgIcons16: TcxImageList;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
GroupBox1: TGroupBox;
pbTotalProgress: TProgressBar;
Label1: TLabel;
pbCurrentOperation: TProgressBar;
Label2: TLabel;
lblOperationName: TLabel;
procedure btnCloseClick(Sender: TObject);
procedure btnGenerateClick(Sender: TObject);
strict private
FEditor: TInstructionEditor;
strict private
procedure GeneratorWorkStart(Sender: TObject; const OperationName: String;
OperationCount, OperationNumber: Integer; MinWorkCount, MaxWorkCount: Integer);
procedure GeneratorWork(Sender: TObject; WorkCount: Integer);
procedure GeneratorWorkEnd(Sender: TObject);
public
property Editor: TInstructionEditor read FEditor write FEditor;
end;
var
frmCodeGenerator: TfrmCodeGenerator;
implementation
uses
Zydis.CodeGenerator, untHelperClasses;
{$R *.dfm}
{ TfrmGenerator }
procedure TfrmCodeGenerator.btnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmCodeGenerator.btnGenerateClick(Sender: TObject);
var
Generator: TCodeGenerator;
Statistics: TCodeGeneratorStatistics;
begin
pbTotalProgress.Min := 0;
pbTotalProgress.Max := 0;
pbTotalProgress.Position := 0;
Generator := TCodeGenerator.Create;
try
Generator.OnWorkStart := GeneratorWorkStart;
Generator.OnWork := GeneratorWork;
Generator.OnWorkEnd := GeneratorWorkEnd;
Generator.GenerateCode(FEditor, 'F:\Development\GitHub\zyan-disassembler-engine\', Statistics);
// TODO: Display statistics
finally
Generator.Free;
end;
end;
procedure TfrmCodeGenerator.GeneratorWork(Sender: TObject; WorkCount: Integer);
begin
pbTotalProgress.Position := pbTotalProgress.Max - pbCurrentOperation.Max + WorkCount;
pbCurrentOperation.Position := WorkCount;
if ((WorkCount mod pbCurrentOperation.Tag) = 0) then
begin
Application.ProcessMessages;
end;
end;
procedure TfrmCodeGenerator.GeneratorWorkEnd(Sender: TObject);
begin
lblOperationName.Caption := '';
pbTotalProgress.Position := pbTotalProgress.Max;
pbCurrentOperation.Position := pbCurrentOperation.Max;
Application.ProcessMessages;
end;
procedure TfrmCodeGenerator.GeneratorWorkStart(Sender: TObject; const OperationName: String;
OperationCount, OperationNumber: Integer; MinWorkCount, MaxWorkCount: Integer);
begin
lblOperationName.Caption := OperationName;
pbTotalProgress.Position := pbTotalProgress.Max;
pbTotalProgress.Min := pbTotalProgress.Min + MinWorkCount;
pbTotalProgress.Max := pbTotalProgress.Max + MaxWorkCount;
pbCurrentOperation.Position := MinWorkCount;
pbCurrentOperation.Min := MinWorkCount;
pbCurrentOperation.Max := MaxWorkCount;
if ((MaxWorkCount - MinWorkCount) > 1000) then
begin
pbCurrentOperation.Tag := 100;
end else if ((MaxWorkCount - MinWorkCount) > 100) then
begin
pbCurrentOperation.Tag := 10;
end else
begin
pbCurrentOperation.Tag := 1;
end;
Application.ProcessMessages;
end;
end.

View File

@ -0,0 +1,157 @@
object frmCreateDefinition: TfrmCreateDefinition
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'Create Definition'
ClientHeight = 446
ClientWidth = 644
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object GroupBox: TGroupBox
AlignWithMargins = True
Left = 3
Top = 404
Width = 638
Height = 39
Margins.Top = 0
Align = alBottom
TabOrder = 1
DesignSize = (
638
39)
object btnCancel: TButton
Left = 518
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Cancel'
ImageIndex = 1
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 1
OnClick = btnCancelClick
end
object btnApply: TButton
Left = 400
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Ok'
ImageIndex = 0
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 0
OnClick = btnApplyClick
end
end
object Inspector: TcxRTTIInspector
AlignWithMargins = True
Left = 3
Top = 3
Width = 638
Height = 398
Align = alClient
Constraints.MinWidth = 350
InspectedObject = Owner
LookAndFeel.NativeStyle = True
OptionsView.PaintStyle = psdotNet
OptionsView.RowHeaderMinWidth = 120
OptionsView.RowHeaderWidth = 260
OptionsView.ShowReadOnlyProperties = True
OptionsView.Sorted = False
TabOrder = 0
Version = 1
end
object imgIcons16: TcxImageList
FormatVersion = 1
DesignInfo = 2097208
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
20000000000000040000000000000000000000000000000000000000001B0000
0033000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000001B00000000004B29A00089
49FF008747FF008747FF008747FF008747FF008747FF008747FF008747FF0087
47FF008747FF008747FF008747FF008949FF004B29A000000000008949FF07E4
A4FF07E5A5FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4
A4FF07E4A4FF07E4A4FF07E5A5FF07E4A4FF008949FF00000000008747FF13E7
AAFF00DB9BFF00DA9AFF00DA99FF00DA99FF00DA99FF00DA99FF00DA9AFF00DA
9AFF00DA9AFF00DA9AFF00DB9BFF13E7AAFF008747FF00000000008746FF1EE7
AEFF00D699FF00D698FF00D495FF00D391FF00D391FF00D495FF00D698FF00D6
99FF00D699FF00D699FF00D699FF1EE7AEFF008746FF00000000008746FF2AE9
B3FF00D299FF00D095FF00CC8DFFFFFFFFFFFFFFFFFF00CC8DFF00D096FF00D2
99FF00D29AFF00D29AFF00D29AFF2AE9B3FF008746FF00000000008746FF35EA
B7FF00CD96FF00C98DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C98DFF00CD
96FF00CF99FF00CF9AFF00CF9AFF36EAB8FF008746FF00000000008745FF3EEB
BBFF00C692FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C4
8DFF00C995FF00CA99FF00CA99FF41ECBDFF008745FF00000000008745FF4BED
BFFF00C393FFFFFFFFFFFFFFFFFF00C08BFF00BF8BFFFFFFFFFFFFFFFFFFFFFF
FFFF00C18EFF00C596FF00C699FF4DEDC0FF008745FF00000000008744FF58EF
C5FF00C197FF00BF93FF00C093FF00C196FF00C196FF00BC8EFFFFFFFFFFFFFF
FFFFFFFFFFFF00BC8EFF00C096FF58EFC5FF008744FF00000000008744FF64F1
CAFF00BE99FF00C099FF00C09AFF00C19BFF00C19AFF00BE97FF00B98EFFFFFF
FFFFFFFFFFFFFFFFFFFF00BA92FF62F0C9FF008744FF00000000008744FF71F2
CFFF00BB99FF00BD9AFF00BE9BFF00BE9BFF00BE9BFF00BE9AFF00BB96FF00B6
8EFFFFFFFFFFFFFFFFFF00B792FF6EF2CDFF008744FF00000000008744FF7BF4
D3FF00B699FF00B89AFF00B99BFF00B99BFF00B99BFF00B99BFF00B89AFF00B7
98FF00B494FF00B493FF00B496FF7AF3D3FF008744FF00000000008744FF86F5
D8FF00B198FF00B299FF00B399FF00B399FF00B399FF00B399FF00B399FF00B2
99FF00B298FF00B297FF00B197FF86F5D8FF008744FF00000000008946FF8AF2
D9FF92F6DEFF93F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6
DDFF94F6DDFF93F6DDFF92F6DEFF8AF2D9FF008946FF00000000004B29880089
46FF008743FF008643FF008643FF008643FF008643FF008643FF008643FF0086
43FF008643FF008643FF008743FF008946FF004B298800000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0013000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000003300000013000000001117
487E2D3CC0FF2B3BBEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3A
BEFF2A3ABEFF2A3ABEFF2A3ABEFF2B3BBEFF2D3CC0FF1117487E000000002D3D
C0FF6172FAFF6A7DFFFF697CFFFF6D80FFFF7485FFFF7788FFFF7788FFFF7788
FFFF7485FFFF6D7FFFFF697CFFFF6A7DFFFF6172FAFF2D3DC0FF000000002B3B
BEFF6578FFFF5F73FEFF6F80FFFF7989FFFF5868E6FF3E4ED0FF3F4FD1FF3E4E
D0FF5767E5FF7887FEFF6E7FFFFF5F73FEFF6578FFFF2B3BBEFF000000002B3B
BEFF5D72FFFF697BFEFF7785F8FF3949CAFF1E2A89B70B0F303F07091D26070A
1F552636B9FF5A6FFDFF576CFAFF687AFCFF5D71FFFF2B3BBEFF000000002C3B
BFFF586EFEFF8593FFFF3B4BCAFF0E143F530000000000000000000000332B3A
BDFF5970FEFF546AFBFF7F8FFFFF8290FDFF586EFEFF2C3BBFFF000000002C3C
BFFF536BFCFF707CE7FF1E2A89BB0000000000000000000000332C3BBEFF546B
FBFF5067F8FF8796FFFF3B4BCDFF6D79E5FF536AFCFF2C3CBFFF000000002D3D
BFFF4F68FBFF4E5BD1FF0B0F304500000000000000332C3BBEFF4E66F9FF4A63
F6FF8C99FFFF2737BCFF07091F314D5AD0FF4F68FBFF2D3DBFFF000000002E3D
C0FF4A64F9FF3446CDFF07091D2D000000332D3CBEFF4862F7FF445DF4FF8E9C
FFFF2838BDFF0000000007091D313446CDFF4A64F9FF2E3DC0FF000000002E3D
C0FF4660F7FF3445CCFF080A20552D3CBEFF445DF4FF3F59F1FF929FFFFF2838
BDFF00000000000000000C0F305B3445CDFF4660F7FF2E3DC0FF000000002E3E
C0FF405BF3FF384DDBFF2E3CBCFF3E59F2FF3954EFFF95A2FFFF2838BDFF0000
00000000000000000011222D8AC5384EDCFF405BF3FF2E3EC0FF000000002F3E
C0FF3955F0FF3951EAFF3954EEFF3651EDFF9AA5FFFF2838BDFF000000080000
000D0000002510153F753041C8FF3A53EBFF3A55F0FF2F3EC0FF000000002E3D
BFFF3A54EFFF324DE9FF334DE9FF324DEBFF2A39BCFF070A1F5507091D510B0F
3065212D8AC52F41C8FF314CE4FF324DEBFF3A54EFFF2E3DBFFF000000002B3B
BFFF6A7DFDFF334EE8FF2643E4FF2642E3FF253CD4FF2739C7FF273AC8FF273A
C8FF263DD5FF2743E5FF2643E6FF334EE9FF6A7DFDFF2B3BBFFF000000002B3B
C0FF929DFCFFAAB3FFFFAAB3FFFFAAB3FFFFAAB4FFFFAAB4FFFFAAB4FFFFAAB4
FFFFAAB4FFFFAAB3FFFFAAB3FFFFAAB3FFFF929DFCFF2B3BC0FF000000001117
485E2A3AC0FF2838BFFF2737BEFF2737BEFF2737BEFF2737BFFF2737BFFF2737
BFFF2737BEFF2737BEFF2737BEFF2838BFFF2A3AC0FF1117485E}
end>
end
end

View File

@ -0,0 +1,50 @@
unit formCreateDefinition;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, cxStyles, cxEdit, dxSkinsCore, cxInplaceContainer, cxVGrid, cxOI,
System.ImageList, Vcl.ImgList, Vcl.StdCtrls, dxSkinSeven;
type
TfrmCreateDefinition = class(TForm)
GroupBox: TGroupBox;
btnCancel: TButton;
btnApply: TButton;
imgIcons16: TcxImageList;
Inspector: TcxRTTIInspector;
procedure btnCancelClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnApplyClick(Sender: TObject);
private
FCanceled: Boolean;
public
property Canceled: Boolean read FCanceled;
end;
var
frmCreateDefinition: TfrmCreateDefinition;
implementation
{$R *.dfm}
procedure TfrmCreateDefinition.btnApplyClick(Sender: TObject);
begin
Close;
end;
procedure TfrmCreateDefinition.btnCancelClick(Sender: TObject);
begin
FCanceled := true;
Close;
end;
procedure TfrmCreateDefinition.FormCreate(Sender: TObject);
begin
FCanceled := false;
end;
end.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,29 @@
program InstructionEditor;
uses
Vcl.Forms,
formMain in 'Forms\formMain.pas' {frmMain},
Zydis.InstructionEditor in 'Zydis.InstructionEditor.pas',
Zydis.InstructionFilters in 'Zydis.InstructionFilters.pas',
untHelperClasses in 'untHelperClasses.pas',
formEditorCPUIDFeatureFlags in 'Forms\Editors\formEditorCPUIDFeatureFlags.pas' {frmEditorCPUIDFeatureFlags},
Vcl.Themes,
Vcl.Styles,
untPropertyHints in 'untPropertyHints.pas',
formCreateDefinition in 'Forms\formCreateDefinition.pas' {frmCreateDefinition},
formEditorX86Registers in 'Forms\Editors\formEditorX86Registers.pas' {frmEditorX86Registers},
formCodeGenerator in 'Forms\formCodeGenerator.pas' {frmCodeGenerator},
Zydis.CodeGenerator in 'Zydis.CodeGenerator.pas',
untPropertyEditors in 'untPropertyEditors.pas';
{$R *.res}
begin
{$IFDEF DEBUG}
ReportMemoryLeaksOnShutdown := true;
{$ENDIF}
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.

View File

@ -0,0 +1,590 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{33BB8B7D-4980-458D-8786-1256495555AE}</ProjectGuid>
<ProjectVersion>18.1</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>InstructionEditor.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>3</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win64)'!=''">
<Cfg_1_Win64>true</Cfg_1_Win64>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
<Cfg_2_Win64>true</Cfg_2_Win64>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<VerInfo_Locale>1031</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Keys>CompanyName=zYantific.com;FileDescription=Instruction Definition Editor;FileVersion=1.0.0.0;InternalName=;LegalCopyright=Copyright © 2015 by zYantific.com;LegalTrademarks=;OriginalFilename=;ProductName=Instruction Definition Editor;ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
<SanitizedProjectName>InstructionEditor</SanitizedProjectName>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
<Icon_MainIcon>InstructionEditor.ico</Icon_MainIcon>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_UsePackage>dxBarRS22;JvGlobus;JvMM;JvManagedThreads;dxSkinsdxRibbonPainterRS22;dxSkinOffice2010BlackRS22;FireDACPgDriver;dxPScxVGridLnkRS22;JvCrypt;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;JvNet;dxWizardControlRS22;JvDotNetCtrls;DbxCommonDriver;vclimg;dbxcds;dxServerModeRS22;DatasnapConnectorsFreePascal;appanalytics;JvXPCtrls;vcldb;dxSkinDarkRoomRS22;dxSkinSilverRS22;dxGDIPlusRS22;CustomIPTransport;dxSkinOffice2010SilverRS22;dsnap;IndyIPServer;IndyCore;dxSkinSummer2008RS22;CloudService;dxSkinLondonLiquidSkyRS22;FireDACIBDriver;JvDB;JvRuntimeDesign;tmsdXE7;dxPScxPivotGridLnkRS22;dxComnRS22;cxPivotGridChartRS22;dsnapxml;dxSpellCheckerRS22;JclDeveloperTools;FireDACDb2Driver;dxPScxGridLnkRS22;dxPScxPCProdRS22;dxSkinVS2010RS22;dxorgcRS22;dxBarExtItemsRS22;dxRibbonRS22;dxSkinsdxBarPainterRS22;dxCoreRS22;cxVerticalGridRS22;bindcompfmx;dxSkinStardustRS22;dxSkinSevenClassicRS22;dxSkinsCoreRS22;dxSpreadSheetRS22;FireDACODBCDriver;RESTBackendComponents;cxSchedulerRS22;dbrtl;dxSkinDevExpressStyleRS22;FireDACCommon;bindcomp;inetdb;cxExportRS22;JvPluginSystem;dxSkinOffice2007BlackRS22;dxSkinXmas2008BlueRS22;dxSkinCoffeeRS22;DBXOdbcDriver;dxSkinscxSchedulerPainterRS22;ibmonitor;vclFireDAC;JvCmp;JvTimeFramework;xmlrtl;ibxpress;dxSkinOffice2013WhiteRS22;dxPSdxDBOCLnkRS22;cxDataRS22;FireDACCommonDriver;cxBarEditItemRS22;soaprtl;bindengine;vclactnband;bindcompvcl;dxBarExtDBItemsRS22;dxSkinOffice2010BlueRS22;Jcl;vclie;dxPSdxDBTVLnkRS22;cxPageControlRS22;dxPsPrVwAdvRS22;FireDACMSSQLDriver;DBXInformixDriver;dxSkinPumpkinRS22;dxSkinFoggyRS22;cxEditorsRS22;dxPScxExtCommonRS22;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;dxPSPrVwRibbonRS22;dxMapControlRS22;dxSkinSharpRS22;dxmdsRS22;JvPascalInterpreter;FireDACMySQLDriver;soapmidas;vclx;dxSkinOffice2007GreenRS22;dxSkinMetropolisDarkRS22;DBXSybaseASADriver;dxDockingRS22;RESTComponents;dxTabbedMDIRS22;dxdborRS22;dxSkinMoneyTwinsRS22;dbexpress;dxPScxTLLnkRS22;IndyIPClient;dxSkinSpringTimeRS22;FireDACTDataDriver;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;dxSkinHighContrastRS22;dxSkinOffice2007SilverRS22;fmx;dxPSdxFCLnkRS22;JvDlgs;IndySystem;dxLayoutControlRS22;dxSkinOffice2007PinkRS22;tethering;cxSchedulerGridRS22;dxSkinMcSkinRS22;vclib;DataSnapClient;dxSkinsdxNavBarPainterRS22;dxNavBarRS22;DataSnapProviderClient;DBXSybaseASEDriver;dxSkinGlassOceansRS22;dxSkinBlueprintRS22;dxSkinBlueRS22;vcldsnap;dxBarDBNavRS22;dxSkiniMaginaryRS22;dxPSCoreRS22;dxSkinLiquidSkyRS22;fmxFireDAC;DBXDb2Driver;dxSkinOffice2007BlueRS22;dxSkinCaramelRS22;DBXOracleDriver;cxGridRS22;JvCore;vclribbon;fmxase;vcl;DBXMSSQLDriver;IndyIPCommon;dxThemeRS22;DataSnapFireDAC;FireDACDBXDriver;dxPScxSchedulerLnkRS22;JvAppFrm;soapserver;cxPivotGridRS22;dxtrmdRS22;dxSkinscxPCPainterRS22;inetdbxpress;FireDACInfxDriver;JvDocking;adortl;tmswizdXE7;cxLibraryRS22;dxPSdxSpreadSheetLnkRS22;JvWizards;dxFireDACServerModeRS22;dxPSdxLCLnkRS22;FireDACASADriver;dxSkinOffice2013DarkGrayRS22;JvHMI;dxPScxCommonRS22;JvBands;emsclientfiredac;rtl;DbxClientDriver;dxSkinOffice2013LightGrayRS22;JclContainers;dxFlowChartRS22;dxPSLnksRS22;dxSkinSharpPlusRS22;dxSkinDarkSideRS22;JvSystem;DataSnapNativeClient;svnui;cxTreeListdxBarPopupMenuRS22;JvControls;dxSkinsdxDLPainterRS22;dxSkinValentineRS22;IndyProtocols;DBXMySQLDriver;dxSkinDevExpressDarkStyleRS22;dxPSdxOCLnkRS22;dxSkinMetropolisRS22;bindcompdbx;JvJans;JvPrintPreview;JvPageComps;JvStdCtrls;JvCustom;cxTreeListRS22;dxSkinTheAsphaltWorldRS22;FireDACADSDriver;vcltouch;dxADOServerModeRS22;emsclient;dxdbtrRS22;VclSmp;FireDAC;VCLRESTComponents;dxTileControlRS22;cxSchedulerRibbonStyleEventEditorRS22;dxSkinSevenRS22;DataSnapConnectors;dxSkinBlackRS22;fmxobj;JclVcl;dxSkinWhiteprintRS22;tmsxlsdXE7;cxPivotGridOLAPRS22;svn;cxSchedulerTreeBrowserRS22;FireDACOracleDriver;fmxdae;VirtualTreesR;FireDACMSAccDriver;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
<Icon_MainIcon>InstructionEditor.ico</Icon_MainIcon>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_UsePackage>dxBarRS22;dxSkinsdxRibbonPainterRS22;dxSkinOffice2010BlackRS22;FireDACPgDriver;dxPScxVGridLnkRS22;DBXInterBaseDriver;DataSnapServer;DataSnapCommon;dxWizardControlRS22;DbxCommonDriver;vclimg;dbxcds;dxServerModeRS22;DatasnapConnectorsFreePascal;appanalytics;vcldb;dxSkinDarkRoomRS22;dxSkinSilverRS22;dxGDIPlusRS22;CustomIPTransport;dxSkinOffice2010SilverRS22;dsnap;IndyIPServer;IndyCore;dxSkinSummer2008RS22;CloudService;dxSkinLondonLiquidSkyRS22;FireDACIBDriver;tmsdXE7;dxPScxPivotGridLnkRS22;dxComnRS22;cxPivotGridChartRS22;dsnapxml;dxSpellCheckerRS22;FireDACDb2Driver;dxPScxGridLnkRS22;dxPScxPCProdRS22;dxSkinVS2010RS22;dxorgcRS22;dxBarExtItemsRS22;dxRibbonRS22;dxSkinsdxBarPainterRS22;dxCoreRS22;cxVerticalGridRS22;bindcompfmx;dxSkinStardustRS22;dxSkinSevenClassicRS22;dxSkinsCoreRS22;dxSpreadSheetRS22;FireDACODBCDriver;RESTBackendComponents;cxSchedulerRS22;dbrtl;dxSkinDevExpressStyleRS22;FireDACCommon;bindcomp;inetdb;cxExportRS22;dxSkinOffice2007BlackRS22;dxSkinXmas2008BlueRS22;dxSkinCoffeeRS22;DBXOdbcDriver;dxSkinscxSchedulerPainterRS22;ibmonitor;vclFireDAC;xmlrtl;ibxpress;dxSkinOffice2013WhiteRS22;dxPSdxDBOCLnkRS22;cxDataRS22;FireDACCommonDriver;cxBarEditItemRS22;soaprtl;bindengine;vclactnband;bindcompvcl;dxBarExtDBItemsRS22;dxSkinOffice2010BlueRS22;vclie;dxPSdxDBTVLnkRS22;cxPageControlRS22;dxPsPrVwAdvRS22;FireDACMSSQLDriver;DBXInformixDriver;dxSkinPumpkinRS22;dxSkinFoggyRS22;cxEditorsRS22;dxPScxExtCommonRS22;DataSnapServerMidas;dsnapcon;DBXFirebirdDriver;tmsexdXE7;inet;dxPSPrVwRibbonRS22;dxMapControlRS22;dxSkinSharpRS22;dxmdsRS22;FireDACMySQLDriver;soapmidas;vclx;dxSkinOffice2007GreenRS22;dxSkinMetropolisDarkRS22;DBXSybaseASADriver;dxDockingRS22;RESTComponents;dxTabbedMDIRS22;dxdborRS22;dxSkinMoneyTwinsRS22;dbexpress;dxPScxTLLnkRS22;IndyIPClient;dxSkinSpringTimeRS22;FireDACTDataDriver;FireDACSqliteDriver;FireDACDSDriver;DBXSqliteDriver;dxSkinHighContrastRS22;dxSkinOffice2007SilverRS22;fmx;dxPSdxFCLnkRS22;IndySystem;dxLayoutControlRS22;dxSkinOffice2007PinkRS22;tethering;cxSchedulerGridRS22;dxSkinMcSkinRS22;vclib;DataSnapClient;dxSkinsdxNavBarPainterRS22;dxNavBarRS22;DataSnapProviderClient;DBXSybaseASEDriver;dxSkinGlassOceansRS22;dxSkinBlueprintRS22;dxSkinBlueRS22;vcldsnap;dxBarDBNavRS22;dxSkiniMaginaryRS22;dxPSCoreRS22;dxSkinLiquidSkyRS22;fmxFireDAC;DBXDb2Driver;dxSkinOffice2007BlueRS22;dxSkinCaramelRS22;DBXOracleDriver;cxGridRS22;vclribbon;fmxase;vcl;DBXMSSQLDriver;IndyIPCommon;dxThemeRS22;DataSnapFireDAC;FireDACDBXDriver;dxPScxSchedulerLnkRS22;soapserver;cxPivotGridRS22;dxtrmdRS22;dxSkinscxPCPainterRS22;inetdbxpress;FireDACInfxDriver;adortl;cxLibraryRS22;dxPSdxSpreadSheetLnkRS22;dxFireDACServerModeRS22;dxPSdxLCLnkRS22;FireDACASADriver;dxSkinOffice2013DarkGrayRS22;dxPScxCommonRS22;emsclientfiredac;rtl;DbxClientDriver;dxSkinOffice2013LightGrayRS22;dxFlowChartRS22;dxPSLnksRS22;dxSkinSharpPlusRS22;dxSkinDarkSideRS22;DataSnapNativeClient;cxTreeListdxBarPopupMenuRS22;dxSkinsdxDLPainterRS22;dxSkinValentineRS22;IndyProtocols;DBXMySQLDriver;dxSkinDevExpressDarkStyleRS22;dxPSdxOCLnkRS22;dxSkinMetropolisRS22;bindcompdbx;cxTreeListRS22;dxSkinTheAsphaltWorldRS22;FireDACADSDriver;vcltouch;dxADOServerModeRS22;emsclient;dxdbtrRS22;VclSmp;FireDAC;VCLRESTComponents;dxTileControlRS22;cxSchedulerRibbonStyleEventEditorRS22;dxSkinSevenRS22;DataSnapConnectors;dxSkinBlackRS22;fmxobj;dxSkinWhiteprintRS22;cxPivotGridOLAPRS22;cxSchedulerTreeBrowserRS22;FireDACOracleDriver;fmxdae;VirtualTreesR;FireDACMSAccDriver;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<Icon_MainIcon>DatabaseEditor.ico</Icon_MainIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_AssertionsAtRuntime>false</DCC_AssertionsAtRuntime>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<DCC_MapFile>3</DCC_MapFile>
<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
<VerInfo_AutoGenVersion>true</VerInfo_AutoGenVersion>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Forms\formMain.pas">
<Form>frmMain</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="Zydis.InstructionEditor.pas"/>
<DCCReference Include="Zydis.InstructionFilters.pas"/>
<DCCReference Include="untHelperClasses.pas"/>
<DCCReference Include="Forms\Editors\formEditorCPUIDFeatureFlags.pas">
<Form>frmEditorCPUIDFeatureFlags</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="untPropertyHints.pas"/>
<DCCReference Include="Forms\formCreateDefinition.pas">
<Form>frmCreateDefinition</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="Forms\Editors\formEditorX86Registers.pas">
<Form>frmEditorX86Registers</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="Forms\formCodeGenerator.pas">
<Form>frmCodeGenerator</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="Zydis.CodeGenerator.pas"/>
<DCCReference Include="untPropertyEditors.pas"/>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType>Application</Borland.ProjectType>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">InstructionEditor.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k240.bpl">Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp240.bpl">Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="Win32\Debug\InstructionEditor.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>InstructionEditor.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="ProjectiOSDeviceResourceRules">
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClassesDexFile">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="Win32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch768">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch640">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeX86File"/>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1024">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch320">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSInfoPList">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch1536">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch640x1136">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2048">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
</DeployClass>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">True</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

View File

@ -0,0 +1,55 @@
[ExpressSkins]
Default=1
ShowNotifications=1
Enabled=1
dxSkinBlack=0
dxSkinBlue=0
dxSkinBlueprint=0
dxSkinCaramel=0
dxSkinCoffee=0
dxSkinDarkRoom=0
dxSkinDarkSide=0
dxSkinDevExpressDarkStyle=0
dxSkinDevExpressStyle=0
dxSkinFoggy=0
dxSkinGlassOceans=0
dxSkinHighContrast=0
dxSkiniMaginary=0
dxSkinLiquidSky=0
dxSkinLondonLiquidSky=0
dxSkinMcSkin=0
dxSkinMetropolis=0
dxSkinMetropolisDark=0
dxSkinMoneyTwins=0
dxSkinOffice2007Black=0
dxSkinOffice2007Blue=0
dxSkinOffice2007Green=0
dxSkinOffice2007Pink=0
dxSkinOffice2007Silver=0
dxSkinOffice2010Black=0
dxSkinOffice2010Blue=0
dxSkinOffice2010Silver=0
dxSkinOffice2013DarkGray=0
dxSkinOffice2013LightGray=0
dxSkinOffice2013White=0
dxSkinPumpkin=0
dxSkinSeven=0
dxSkinSevenClassic=0
dxSkinSharp=0
dxSkinSharpPlus=0
dxSkinSilver=0
dxSkinSpringTime=0
dxSkinStardust=0
dxSkinSummer2008=0
dxSkinTheAsphaltWorld=0
dxSkinsDefaultPainters=0
dxSkinValentine=0
dxSkinVS2010=0
dxSkinWhiteprint=0
dxSkinXmas2008Blue=0
dxSkinLilian=0
dxSkinOffice2016Colorful=0
dxSkinOffice2016Dark=0
dxSkinVisualStudio2013Blue=0
dxSkinVisualStudio2013Dark=0
dxSkinVisualStudio2013Light=0

View File

@ -0,0 +1,26 @@
Zydis Instruction Editor
========================
The Zydis Instruction Editor was created to easily edit the Zydis instruction database.
:warning: A standalone table-generator written in Phython is on our todo-list and will be released soon.
## Features ##
- Shows all instruction definitions in an opcode tree.
- Provides an graphical interface with the functionality to add, change or remove instruction definitions.
- Compiles the instruction definitions into optimized disassembler-tables which are used by the Zyan Disassembler Engine (Zydis).
## Screenshot ##
![Zydis Instruction Editor](/assets/InstructionEditor/screenshot.png?raw=true "Zydis Instruction Editor")
## Compilation ##
The Zydis Instruction Editor requires a minimum version of Delphi XE8 and the following third-party component packages:
- VirtualTreeView
- DevExpress VCL Controls (commercial)
## License ##
The Zydis Instruction Editor is licensed under the MIT License. Dependencies are under their respective licenses.

View File

@ -0,0 +1,129 @@
{
This file is part of Synopse mORMot framework.
Synopse mORMot framework. Copyright (C) 2016 Arnaud Bouchez
Synopse Informatique - http://synopse.info
*** BEGIN LICENSE BLOCK *****
Version: MPL 1.1/GPL 2.0/LGPL 2.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.
The Original Code is Synopse mORMot framework.
The Initial Developer of the Original Code is Arnaud Bouchez.
Portions created by the Initial Developer are Copyright (C) 2016
the Initial Developer. All Rights Reserved.
Contributor(s):
Alternatively, the contents of this file may be used under the terms of
either the GNU General Public License Version 2 or later (the "GPL"), or
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
in which case the provisions of the GPL or the LGPL are applicable instead
of those above. If you wish to allow use of your version of this file only
under the terms of either the GPL or the LGPL, and not to allow others to
use your version of this file under the terms of the MPL, indicate your
decision by deleting the provisions above and replace them with the notice
and other provisions required by the GPL or the LGPL. If you do not delete
the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
***** END LICENSE BLOCK *****
Version 1.18
- first public release, corresponding to mORMot Framework 1.18
}
{$ifdef FPC}
{.$MODE DELPHI} // we need e.g. auto-dereferenced pointers, as in Delphi
{$INLINE ON}
{$MINENUMSIZE 1}
{$PACKSET 1}
{$PACKENUM 1}
{$define HASINLINE}
{$define USEOBJECTINSTEADOFRECORD}
{$Q-} // disable overflow checking
{$R-} // disable range checking
{$ifdef VER2_7_1}
{$define ISFPC271}
// defined if the http://mantis.freepascal.org/view.php?id=26773 bug is fixed
// you should use 2.7.1/trunk branch in revision 28995 from 2014-11-05T22:17:54
// => this will change the TInvokeableVariantType.SetProperty() signature
{$define FPC_VARIANTSETVAR}
{$endif}
{$else}
{$ifdef DWSSCRIPT} // always defined since SMS 1.1.2
{$define ISDWS} // e.g. for SmartMobileStudio or Delphi Web Script
{$define ISSMS} // for SmartMobileStudio
{$else}
{$ifdef NEXTGEN}
{$define HASINLINE}
{$ZEROBASEDSTRINGS OFF} // we expect to share code among platforms
{$define ISDELPHI2010}
{$define ISDELPHIXE}
{$define USETMONITOR}
{$if CompilerVersion >= 29.0}
{$define ISDELPHIXE8} // e.g. for System.Net.HttpClient
{$ifend}
{$else}
{$ifdef CONDITIONALEXPRESSIONS} // Delphi 6 or newer
{$ifdef UNICODE}
{$ifdef CPUX64}
{$define CPU64}
{$endif}
{$else}
{$define USEOBJECTINSTEADOFRECORD}
{$endif}
{$ifdef VER140}
{$define ISDELPHI6}
{$endif}
{$if CompilerVersion >= 18} // Delphi 2006 or newer
{$define HASINLINE}
{$ifend}
{$if CompilerVersion >= 21.0}
{$define ISDELPHI2010}
{$ifend}
{$if CompilerVersion >= 22.0}
{$define ISDELPHIXE}
{$ifend}
{$if CompilerVersion >= 23.0}
{$define ISDELPHIXE2} // e.g. for Vcl.Graphics
{$ifndef MSWINDOWS}
{$define USETMONITOR}
{$endif}
{$ifend}
{$if CompilerVersion >= 25.0}
{$define ISDELPHIXE4}
{$ZEROBASEDSTRINGS OFF} // we expect to share code among platforms
{$warn DUPLICATE_CTOR_DTOR OFF} // avoid W1029 unneeded hints
{$ifend}
{$if CompilerVersion >= 29.0}
{$define ISDELPHIXE8} // e.g. for System.Net.HttpClient
{$ifend}
{$else}
{$define ISDELPHI5OROLDER}
{$define USEOBJECTINSTEADOFRECORD}
{$endif CONDITIONALEXPRESSIONS}
{$endif NEXTGEN}
{$Q-} // disable overflow checking
{$R-} // disable range checking
{$endif DELPHIWEBSCRIPT}
{$endif FPC}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,607 @@
unit Zydis.InstructionFilters;
interface
uses
Zydis.InstructionEditor;
type
TOpcodeFilter = class(TInstructionFilter)
public
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetDescription: String; override;
end;
TEncodingFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TVEXMapFilter = class(TInstructionFilter)
public
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TXOPMapFilter = class(TInstructionFilter)
public
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TModeFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TMandatoryPrefixFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TModrmModFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TModrmRegFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TModrmRmFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TOperandSizeFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TAddressSizeFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TRexWFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TVexLFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TEvexL2Filter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
TEvexBFilter = class(TInstructionFilter)
public
class function GetNeutralElementType: TNeutralElementType; override;
class function GetCapacity: Cardinal; override;
class function GetInsertPosition(const Definition: TInstructionDefinition): Integer; override;
class function GetItemDescription(Index: Integer): String; override;
class function GetDescription: String; override;
end;
const
InstructionFilterClasses: array[0..14] of TInstructionFilterClass =
(
TOpcodeFilter,
TEncodingFilter,
TVEXMapFilter,
TXOPMapFilter,
TModeFilter,
TMandatoryPrefixFilter,
TModrmModFilter,
TModrmRegFilter,
TModrmRmFilter,
TOperandSizeFilter,
TAddressSizeFilter,
TRexWFilter,
TVexLFilter,
TEvexL2Filter,
TEvexBFilter
);
implementation
uses
System.SysUtils, System.TypInfo;
{$REGION 'Class: TOpcodeFilter'}
class function TOpcodeFilter.GetCapacity: Cardinal;
begin
Result := 256;
end;
class function TOpcodeFilter.GetDescription: String;
begin
Result := 'Opcode';
end;
class function TOpcodeFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Result := Definition.Opcode;
end;
{$ENDREGION}
{$REGION 'Class: TEncodingFilter'}
class function TEncodingFilter.GetCapacity: Cardinal;
begin
Result := 5;
end;
class function TEncodingFilter.GetDescription: String;
begin
Result := 'Encoding';
end;
class function TEncodingFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.Encoding);
end;
class function TEncodingFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TInstructionEncoding), Index);
end;
class function TEncodingFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netValue;
end;
{$ENDREGION}
{$REGION 'Class: TVEXMapFilter'}
class function TVEXMapFilter.GetCapacity: Cardinal;
begin
Result := 16;
end;
class function TVEXMapFilter.GetDescription: String;
begin
Result := 'VEX';
end;
class function TVEXMapFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Assert(Definition.OpcodeMap < omXOP8);
Result := (Integer(Definition.OpcodeExtensions.MandatoryPrefix)) * 4 + Byte(Definition.OpcodeMap);
end;
class function TVEXMapFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
case (Index div 4) of
0: Result := '##';
1: Result := '66';
2: Result := 'F3';
3: Result := 'F2';
end;
case (Index mod 4) of
0: Result := Result + ' default';
1: Result := Result + ' 0F';
2: Result := Result + ' 0F 38';
3: Result := Result + ' 0F 3A';
end;
end;
{$ENDREGION}
{$REGION 'Class: TXOPMapFilter'}
class function TXOPMapFilter.GetCapacity: Cardinal;
begin
Result := 4;
end;
class function TXOPMapFilter.GetDescription: String;
begin
Result := 'XOP';
end;
class function TXOPMapFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Assert(Definition.Encoding = ieXOP);
Assert(Definition.OpcodeMap >= omXOP8);
Result := Integer(Definition.OpcodeMap) - Integer(omXOP8) + 1;
end;
class function TXOPMapFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
if (Index = 0) then
begin
Result := 'Non-XOP-Placeholder';
end else
begin
Result := GetEnumName(TypeInfo(TOpcodeMap), Integer(omXOP8) + Index - 1);
end;
end;
{$ENDREGION}
{$REGION 'Class: TModeFilter'}
class function TModeFilter.GetCapacity: Cardinal;
begin
Result := 3;
end;
class function TModeFilter.GetDescription: String;
begin
Result := 'Mode';
end;
class function TModeFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.Mode);
end;
class function TModeFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtInstructionMode), Index);
end;
class function TModeFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netPlaceholder;
end;
{$ENDREGION}
{$REGION 'Class: TMandatoryPrefixFilter'}
class function TMandatoryPrefixFilter.GetCapacity: Cardinal;
begin
Result := 4;
end;
class function TMandatoryPrefixFilter.GetDescription: String;
begin
Result := 'MandatoryPrefix';
end;
class function TMandatoryPrefixFilter.GetInsertPosition(
const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.MandatoryPrefix);
end;
class function TMandatoryPrefixFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtMandatoryPrefix), Index);
end;
class function TMandatoryPrefixFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netValue;
end;
{$ENDREGION}
{$REGION 'Class: TModrmModFilter'}
class function TModrmModFilter.GetCapacity: Cardinal;
begin
Result := 3;
end;
class function TModrmModFilter.GetDescription: String;
begin
Result := 'ModrmMod';
end;
class function TModrmModFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.ModrmMod);
end;
class function TModrmModFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtModrmMod), Index);
end;
class function TModrmModFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netPlaceholder;
end;
{$ENDREGION}
{$REGION 'Class: TModrmRegFilter'}
class function TModrmRegFilter.GetCapacity: Cardinal;
begin
Result := 9;
end;
class function TModrmRegFilter.GetDescription: String;
begin
Result := 'ModrmReg';
end;
class function TModrmRegFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.ModrmReg);
end;
class function TModrmRegFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtModrmReg), Index);
end;
class function TModrmRegFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netPlaceholder;
end;
{$ENDREGION}
{$REGION 'Class: TModrmRmFilter'}
class function TModrmRmFilter.GetCapacity: Cardinal;
begin
Result := 9;
end;
class function TModrmRmFilter.GetDescription: String;
begin
Result := 'ModrmRm';
end;
class function TModrmRmFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.ModrmRm);
end;
class function TModrmRmFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtModrmRm), Index);
end;
class function TModrmRmFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netPlaceholder;
end;
{$ENDREGION}
{$REGION 'Class: TOperandSizeFilter'}
class function TOperandSizeFilter.GetCapacity: Cardinal;
begin
Result := 3;
end;
class function TOperandSizeFilter.GetDescription: String;
begin
Result := 'OperandSize';
end;
class function TOperandSizeFilter.GetInsertPosition(
const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.OperandSize);
end;
class function TOperandSizeFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtOperandSize), Index);
end;
class function TOperandSizeFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netPlaceholder;
end;
{$ENDREGION}
{$REGION 'Class: TAddressSizeFilter'}
class function TAddressSizeFilter.GetCapacity: Cardinal;
begin
Result := 4;
end;
class function TAddressSizeFilter.GetDescription: String;
begin
Result := 'AddressSize';
end;
class function TAddressSizeFilter.GetInsertPosition(
const Definition: TInstructionDefinition): Integer;
begin
Result := Integer(Definition.OpcodeExtensions.AddressSize);
end;
class function TAddressSizeFilter.GetItemDescription(Index: Integer): String;
begin
Assert((Index >= 0) and (Index < Integer(GetCapacity)));
Result := GetEnumName(TypeInfo(TExtAddressSize), Index);
end;
class function TAddressSizeFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netPlaceholder;
end;
{$ENDREGION}
{$REGION 'Class: TRexWFilter'}
class function TRexWFilter.GetCapacity: Cardinal;
begin
Result := 2;
end;
class function TRexWFilter.GetDescription: String;
begin
Result := 'REXW';
end;
class function TRexWFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
if (bfRexW in Definition.OpcodeExtensions.BitFilters) then
begin
Result := 1;
end else
begin
Result := 0;
end;
end;
class function TRexWFilter.GetItemDescription(Index: Integer): String;
begin
Result := 'REX.W ' + IntToStr(Index);
end;
class function TRexWFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netValue;
end;
{$ENDREGION}
{$REGION 'Class: TVexLFilter'}
class function TVexLFilter.GetCapacity: Cardinal;
begin
Result := 2;
end;
class function TVexLFilter.GetDescription: String;
begin
Result := 'VEXL';
end;
class function TVexLFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
if (bfVexL in Definition.OpcodeExtensions.BitFilters) then
begin
Result := 1;
end else
begin
Result := 0;
end;
end;
class function TVexLFilter.GetItemDescription(Index: Integer): String;
begin
Result := 'VEX.L ' + IntToStr(Index);
end;
class function TVexLFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netValue;
end;
{$ENDREGION}
{$REGION 'Class: TEvexL2Filter'}
class function TEvexL2Filter.GetCapacity: Cardinal;
begin
Result := 2;
end;
class function TEvexL2Filter.GetDescription: String;
begin
Result := 'EVEXL2';
end;
class function TEvexL2Filter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
if (bfEvexL2 in Definition.OpcodeExtensions.BitFilters) then
begin
Result := 1;
end else
begin
Result := 0;
end;
end;
class function TEvexL2Filter.GetItemDescription(Index: Integer): String;
begin
Result := 'EVEX.L'' ' + IntToStr(Index);
end;
class function TEvexL2Filter.GetNeutralElementType: TNeutralElementType;
begin
Result := netValue;
end;
{$ENDREGION}
{$REGION 'Class: TEvexBFilter'}
class function TEvexBFilter.GetCapacity: Cardinal;
begin
Result := 2;
end;
class function TEvexBFilter.GetDescription: String;
begin
Result := 'EVEXB';
end;
class function TEvexBFilter.GetInsertPosition(const Definition: TInstructionDefinition): Integer;
begin
if (bfEvexB in Definition.OpcodeExtensions.BitFilters) then
begin
Result := 1;
end else
begin
Result := 0;
end;
end;
class function TEvexBFilter.GetItemDescription(Index: Integer): String;
begin
Result := 'EVEX.B ' + IntToStr(Index);
end;
class function TEvexBFilter.GetNeutralElementType: TNeutralElementType;
begin
Result := netValue;
end;
{$ENDREGION}
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View File

@ -0,0 +1,302 @@
unit untHelperClasses;
interface
uses
System.Classes, System.Generics.Collections, System.Generics.Defaults, SynCrossPlatformJSON;
type
TSizeFormatter = record
public
class function Format(Size: UInt64): String; static;
end;
TStringHelper = record
public
{**
* Fast alternative to the @c System.StrUtils.IndexStr function
*
* @param S The string to search for.
* @param Values The array of strings to search in.
*
* @return The index of @c S in the @c Values array or -1, if not found.
*}
class function IndexStr(const S: String; const Values: array of String): Integer; static;
{**
* Fast alternative to the @c System.SysUtils.AnsiLowerCase function
*
* @param S A reference to the target string.
*}
class procedure AnsiLowerCase(var S: String); static;
end;
TListHelper<T> = record
public
class procedure BubbleSort(var List: TList<T>; const Comparer: IComparer<T>); static;
end;
TJSONHelper = record
public
class function JSONToString(JSON: PJSONVariantData; const Ident: String = ''): String; static;
end;
TStringBuffer = class(TObject)
strict private
FBuffer: array of Char;
FPosition: Integer;
FCapacity: Integer;
FChunkSize: Cardinal;
strict private
function GetValue: String; inline;
public
procedure Append(const S: String);
procedure AppendLn(const S: String);
public
constructor Create(ChunkSize: Cardinal = 1024 * 16);
public
property Value: String read GetValue;
end;
implementation
uses
System.SysUtils, System.Variants;
{ TSizeFormatter }
class function TSizeFormatter.Format(Size: UInt64): String;
const
SZ_KB = 1024;
SZ_MB = 1024 * 1024;
SZ_GB = 1024 * 1024;
var
Format: TFormatSettings;
begin
Format := System.SysUtils.FormatSettings;
Format.DecimalSeparator := '.';
if (Size >= SZ_GB) then
begin
Result := FormatFloat('0.00 GiB', Size / SZ_GB, Format);
end else if (Size >= SZ_MB) then
begin
Result := FormatFloat('0.00 MiB', Size / SZ_MB, Format);
end else if (Size >= SZ_KB) then
begin
Result := FormatFloat('0.00 KiB', Size / SZ_KB, Format);
end else
begin
Result := FormatFloat('0.00 Byte', Size, Format);
end;
end;
{ TStringHelper }
class function TStringHelper.IndexStr(const S: String; const Values: array of String): Integer;
var
L, I, J: Integer;
B: Boolean;
begin
Result := -1;
L := Length(S);
for I := Low(Values) to High(Values) do
begin
if (L <> Length(Values[I])) then Continue;
B := true;
for J := 1 to Length(S) do
begin
if (S[J] <> Values[I][J]) then
begin
B := false;
Continue;
end;
end;
if (B) then
begin
Result := I;
Break;
end;
end;
end;
class procedure TStringHelper.AnsiLowerCase(var S: String);
const
Lower: array of Char =
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
't', 'u', 'v', 'w', 'x', 'y', 'z'];
var
I: Integer;
begin
for I := 1 to Length(S) do
begin
if (CharInSet(S[I], ['A'..'Z'])) then
begin
S[I] := Lower[Ord(S[I]) - Ord('A')];
end;
end;
end;
{ TListHelper<T> }
class procedure TListHelper<T>.BubbleSort(var List: TList<T>; const Comparer: IComparer<T>);
var
I: Integer;
Done: Boolean;
begin
repeat
Done := true;
for I := 0 to List.Count - 2 do
begin
if (Comparer.Compare(List[I], List[I + 1]) > 0) then
begin
List.Exchange(I, I + 1);
Done := false;
end;
end;
until Done;
end;
{ TJSONHelper }
class function TJSONHelper.JSONToString(JSON: PJSONVariantData; const Ident: String = ''): String;
// TODO: This helper function needs refactoring
procedure JSONToString(Buffer: TStringBuffer; JSON: PJSONVariantData; const Ident: String = '');
procedure ValueToJSON(Buffer: TStringBuffer; const Value: Variant);
var
I64: Int64;
B: Boolean;
S: String;
begin
if (TVarData(Value).VType = JSONVariantType.VarType) then
begin
JSONToString(Buffer, @TJSONVariantData(Value), Ident + ' ');
end else if (TVarData(Value).VType = varByRef or varVariant) then
begin
ValueToJSON(Buffer, PVariant(TVarData(Value).VPointer)^)
end else if (TVarData(Value).VType <= varNull) then
begin
Buffer.Append('null');
end else if (TVarData(Value).VType = varBoolean) then
begin
B := Value;
Buffer.Append(LowerCase(BoolToStr(B, true)));
end else if (VarIsOrdinal(Value)) then
begin
I64 := Value;
Buffer.Append(IntToStr(I64));
end else if (TVarData(Value).VType = varDate) then
begin
Buffer.Append(DateTimeToJSON(TVarData(Value).VDouble));
end else if (VarIsFloat(Value)) then
begin
DoubleToJSON(Value, S);
Buffer.Append(S);
end else if (VarIsStr(Value)) then
begin
Buffer.Append(StringToJSON(Value));
end else
begin
Buffer.Append(Value);
end;
end;
var
I: Integer;
begin
case JSON.Kind of
jvObject:
begin
Buffer.AppendLn('{');
for I := 0 to JSON.Count - 1 do
begin
Buffer.Append(Ident);
Buffer.Append(' ');
Buffer.Append(StringToJSON(JSON.Names[I]) + ': ');
ValueToJSON(Buffer, JSON.Values[I]);
if (I = JSON.Count - 1) then
begin
Buffer.AppendLn('');
end else
begin
Buffer.AppendLn(',');
end;
end;
Buffer.Append(Ident);
Buffer.Append('}');
end;
jvArray:
begin
Buffer.AppendLn('[');
for I := 0 to JSON.Count - 1 do
begin
Buffer.Append(Ident);
Buffer.Append(' ');
ValueToJSON(Buffer, JSON.Values[I]);
if (I = JSON.Count - 1) then
begin
Buffer.AppendLn('');
end else
begin
Buffer.AppendLn(',');
end;
end;
Buffer.Append(Ident);
Buffer.Append(']');
end else
begin
Buffer.Append('null');
end;
end;
end;
var
Buffer: TStringBuffer;
begin
Buffer := TStringBuffer.Create;
try
JSONToString(Buffer, JSON, Ident);
Result := Buffer.Value;
finally
Buffer.Free;
end;
end;
{ TStringBuffer }
procedure TStringBuffer.Append(const S: String);
var
L: Integer;
begin
L := Length(S);
while (FPosition + L > FCapacity) do
begin
Inc(FCapacity, FChunkSize);
SetLength(FBuffer, FCapacity);
end;
Move(S[1], FBuffer[FPosition], L * SizeOf(FBuffer[0]));
Inc(FPosition, L);
end;
procedure TStringBuffer.AppendLn(const S: String);
begin
Append(S);
Append(sLineBreak);
end;
constructor TStringBuffer.Create(ChunkSize: Cardinal);
begin
inherited Create;
FChunkSize := ChunkSize;
FCapacity := FChunkSize;
SetLength(FBuffer, FChunkSize);
end;
function TStringBuffer.GetValue: String;
begin
SetLength(Result, FPosition);
Move(FBuffer[0], Result[1], FPosition * SizeOf(FBuffer[0]));
end;
end.

View File

@ -0,0 +1,349 @@
unit untPropertyEditors;
interface
uses
cxOI;
type
TOpcodeByteProperty = class(TcxOrdinalProperty)
public
function GetValue: String; override;
procedure SetValue(const Value: String); override;
end;
TCPUIDFeatureFlagsProperty = class(TcxClassProperty)
public
procedure Edit; override;
function GetAttributes: TcxPropertyAttributes; override;
function GetValue: String; override;
procedure SetValue(const Value: String); override;
function IsDefaultValue: Boolean; override;
end;
TX86RegistersProperty = class(TcxClassProperty)
public
procedure Edit; override;
function GetAttributes: TcxPropertyAttributes; override;
function GetValue: String; override;
procedure SetValue(const Value: String); override;
function IsDefaultValue: Boolean; override;
end;
TInstructionOperandProperty = class(TcxClassProperty)
public
function GetAttributes: TcxPropertyAttributes; override;
function GetValue: String; override;
procedure SetValue(const Value: String); override;
function IsDefaultValue: Boolean; override;
end;
implementation
uses
System.SysUtils, System.TypInfo, System.Classes, Vcl.Forms, Zydis.InstructionEditor,
untHelperClasses, formEditorCPUIDFeatureFlags, formEditorX86Registers, cxButtonEdit;
{ TOpcodeByteProperty }
function TOpcodeByteProperty.GetValue: String;
begin
Result := IntToHex(GetOrdValue, 2);
end;
procedure TOpcodeByteProperty.SetValue(const Value: String);
var
V: Integer;
begin
if (not TryStrToInt('$' + Value, V)) then
begin
raise Exception.CreateFmt('"%s" is not a valid hexadecimal value.', [Value]);
end;
if (V < 0) or (V > 255) then
begin
raise Exception.Create('Value has to be between 0 and 255.');
end;
SetOrdValue(V);
end;
{ TCPUIDFeatureFlagsProperty }
procedure TCPUIDFeatureFlagsProperty.Edit;
var
Form: TfrmEditorCPUIDFeatureFlags;
begin
Form := TfrmEditorCPUIDFeatureFlags.Create(Application);
try
Form.Caption := GetComponent(0).GetNamePath + '.' + GetName;
Form.FeatureFlags := TCPUIDFeatureFlags(GetOrdValue).FeatureFlags;
Form.ShowModal;
if (Form.ApplyChanges) then
begin
TCPUIDFeatureFlags(GetOrdValue).FeatureFlags := Form.FeatureFlags;
PostChangedNotification;
end;
finally
Form.Free;
end;
end;
function TCPUIDFeatureFlagsProperty.GetAttributes: TcxPropertyAttributes;
begin
Result := [ipaDialog];
end;
function TCPUIDFeatureFlagsProperty.GetValue: String;
var
CPUIDFeatureFlags: TCPUIDFeatureFlagSet;
CPUIDFeatureFlag: TCPUIDFeatureFlag;
S: String;
begin
Result := 'NONE';
CPUIDFeatureFlags := TCPUIDFeatureFlags(GetOrdValue).FeatureFlags;
if (CPUIDFeatureFlags <> []) then
begin
Result := '';
for CPUIDFeatureFlag in CPUIDFeatureFlags do
begin
S := GetEnumName(TypeInfo(TCPUIDFeatureFlag), Ord(CPUIDFeatureFlag));
Delete(S, 1, 2);
Result := Result + S + ', ';
end;
if (Result <> '') then
begin
Delete(Result, Length(Result) - 1, 2);
end;
end;
end;
function TCPUIDFeatureFlagsProperty.IsDefaultValue: Boolean;
begin
Result := (TCPUIDFeatureFlags(GetOrdValue).FeatureFlags = []);
end;
procedure TCPUIDFeatureFlagsProperty.SetValue(const Value: String);
var
S: String;
I: Integer;
C: Char;
A: TArray<String>;
F: TCPUIDFeatureFlag;
FeatureFlags: TCPUIDFeatureFlagSet;
begin
if (Value = '') then
begin
TCPUIDFeatureFlags(GetOrdValue).FeatureFlags := [];
Exit;
end;
SetLength(S, Length(Value));
I := 1;
for C in Value do
begin
if (CharInSet(C, ['a'..'z', 'A'..'Z', '0'..'9', ','])) then
begin
S[I] := C;
Inc(I);
end;
end;
SetLength(S, I - 1);
TStringHelper.AnsiLowerCase(S);
A := S.Split([',']);
FeatureFlags := [];
for F := Low(TCPUIDFeatureFlag) to High(TCPUIDFeatureFlag) do
begin
S := GetEnumName(TypeInfo(TCPUIDFeatureFlag), Ord(F));
Delete(S, 1, 2);
TStringHelper.AnsiLowerCase(S);
for I := Low(A) to High(A) do
begin
if (A[I] = S) then
begin
Include(FeatureFlags, F);
end;
end;
end;
TCPUIDFeatureFlags(GetOrdValue).FeatureFlags := FeatureFlags;
end;
{ TX86RegistersProperty }
procedure TX86RegistersProperty.Edit;
var
Form: TfrmEditorX86Registers;
begin
Form := TfrmEditorX86Registers.Create(Application);
try
Form.Caption := GetComponent(0).GetNamePath + '.' + GetName;
Form.Registers := TX86Registers(GetOrdValue).Registers;
Form.ShowModal;
if (Form.ApplyChanges) then
begin
TX86Registers(GetOrdValue).Registers := Form.Registers;
PostChangedNotification;
end;
finally
Form.Free;
end;
end;
function TX86RegistersProperty.GetAttributes: TcxPropertyAttributes;
begin
Result := [ipaDialog];
end;
function TX86RegistersProperty.GetValue: String;
var
X86Registers: TX86RegisterSet;
X86Register: TX86Register;
S: String;
begin
Result := 'NONE';
X86Registers := TX86Registers(GetOrdValue).Registers;
if (TX86Registers(GetOrdValue).Registers <> []) and
(TX86Registers(GetOrdValue).Registers <> [regNone]) then
begin
Result := '';
for X86Register in X86Registers do
begin
S := GetEnumName(TypeInfo(TX86Register), Ord(X86Register));
Delete(S, 1, 3);
Result := Result + S + ', ';
end;
if (Result <> '') then
begin
Delete(Result, Length(Result) - 1, 2);
end;
end;
end;
function TX86RegistersProperty.IsDefaultValue: Boolean;
begin
Result := (TX86Registers(GetOrdValue).Registers = []) or
(TX86Registers(GetOrdValue).Registers = [regNone])
end;
procedure TX86RegistersProperty.SetValue(const Value: String);
var
S: String;
I: Integer;
C: Char;
A: TArray<String>;
R: TX86Register;
Registers: TX86RegisterSet;
begin
if (Value = '') then
begin
TX86Registers(GetOrdValue).Registers := [];
Exit;
end;
SetLength(S, Length(Value));
I := 1;
for C in Value do
begin
if (CharInSet(C, ['a'..'z', 'A'..'Z', '0'..'9', ','])) then
begin
S[I] := C;
Inc(I);
end;
end;
SetLength(S, I - 1);
TStringHelper.AnsiLowerCase(S);
A := S.Split([',']);
Registers := [];
for R := Low(TX86Register) to High(TX86Register) do
begin
S := GetEnumName(TypeInfo(TX86Register), Ord(R));
Delete(S, 1, 3);
TStringHelper.AnsiLowerCase(S);
for I := Low(A) to High(A) do
begin
if (A[I] = S) then
begin
Include(Registers, R);
end;
end;
end;
TX86Registers(GetOrdValue).Registers := Registers;
end;
{ TInstructionOperandProperty }
function TInstructionOperandProperty.GetAttributes: TcxPropertyAttributes;
begin
Result := [ipaSubProperties];
end;
function TInstructionOperandProperty.GetValue: String;
begin
Result := TInstructionOperand(GetOrdValue).GetDescription;
if (TInstructionOperand(GetOrdValue).OperandType = optUnused) then
begin
Result := 'unused';
end;
end;
function TInstructionOperandProperty.IsDefaultValue: Boolean;
begin
Result := (TInstructionOperand(GetOrdValue).OperandType = optUnused);
end;
procedure TInstructionOperandProperty.SetValue(const Value: String);
var
S, R: String;
I: Integer;
C: Char;
A: TArray<String>;
T: TOperandType;
begin
if (Value = '') then
begin
TInstructionOperand(GetOrdValue).OperandType := optUnused;
Exit;
end;
SetLength(S, Length(Value));
I := 1;
for C in Value do
begin
if (CharInSet(C, ['a'..'z', 'A'..'Z', '0'..'9', '('])) then
begin
S[I] := C;
Inc(I);
end;
end;
SetLength(S, I - 1);
TStringHelper.AnsiLowerCase(S);
A := S.Split(['(']);
for T := Low(TOperandType) to High(TOperandType) do
begin
R := GetEnumName(TypeInfo(TOperandType), Ord(T));
Delete(R, 1, 3);
TStringHelper.AnsiLowerCase(R);
if (A[0] = R) then
begin
TInstructionOperand(GetOrdValue).OperandType := T;
Break;
end;
end;
if (Length(A) >= 1) then
begin
if (A[1] = 'r') then TInstructionOperand(GetOrdValue).Action := opaRead
else if (A[1] = 'w') then TInstructionOperand(GetOrdValue).Action := opaWrite
else if (A[1] = 'rw') then TInstructionOperand(GetOrdValue).Action := opaReadWrite;
end;
end;
initialization
// Register custom property editor for hexadecimal display of TOpcodeByte values
cxRegisterPropertyEditor(TypeInfo(TOpcodeByte), nil, '', TOpcodeByteProperty);
// Register custom property editors for easy modification of the instruction-operands
cxRegisterPropertyEditor(TypeInfo(TInstructionOperand), nil, '', TInstructionOperandProperty);
// Delphi does not allow sets > 4 bytes as published values, so we have to use a wrapper class
// and a custom editor
cxRegisterPropertyEditor(TypeInfo(TCPUIDFeatureFlags), nil, '', TCPUIDFeatureFlagsProperty);
cxRegisterEditPropertiesClass(TCPUIDFeatureFlagsProperty, TcxButtonEditProperties);
cxRegisterPropertyEditor(TypeInfo(TX86Registers), nil, '', TX86RegistersProperty);
cxRegisterEditPropertiesClass(TX86RegistersProperty, TcxButtonEditProperties);
end.

View File

@ -0,0 +1,75 @@
unit untPropertyHints;
interface
function GetPropertyHint(const PropertyId: String): String;
implementation
type
TPropertyHint = record
public
PropertyId: String;
PropertyHint: String;
end;
const
PropertyHints: array[0..7] of TPropertyHint =
(
(
PropertyId : 'Filter.FilterType';
PropertyHint: 'The filter type.'
),
(
PropertyId : 'Filter.FilterFlags';
PropertyHint: 'The filter flags.'
),
(
PropertyId : 'Filter.FilterFlags.iffIsRootTable';
PropertyHint: 'This is the root table.'
),
(
PropertyId : 'Filter.FilterFlags.iffIsStaticFilter';
PropertyHint: 'This is a static filter that should not be removed.'
),
(
PropertyId : 'Filter.FilterFlags.iffIsDefinitionContainer';
PropertyHint: 'This is a definition container and not an actual filter.'
),
(
PropertyId : 'Filter.NeutralElementType';
PropertyHint: 'The neutral element type of the filter. Possible values:' + #13#10#13#10 +
'- netNotAvailable' + #13#10 +
'The neutral "zero" element is not supported.' + #13#10 +
'- netPlaceholder' + #13#10 +
'The neutral "zero" element is supported and used as a placeholder. ' +
'The filter will signal a conflict, if the neutral element AND at least one ' +
'regular value is set.' + #13#10 +
'- netValue' + #13#10 +
'The neutral "zero" element is supported and can be used as a regular value.'
),
(
PropertyId : 'Filter.Capacity';
PropertyHint: 'The maximum capacity of the filter.'
),
(
PropertyId : 'Filter.ItemCount';
PropertyHint: 'The actual number of non-empty slots in the filter.'
)
);
function GetPropertyHint(const PropertyId: String): String;
var
I: Integer;
begin
Result := 'No info text available.';
for I := Low(PropertyHints) to High(PropertyHints) do
begin
if (PropertyHints[I].PropertyId = PropertyId) then
begin
Exit(PropertyHints[I].PropertyHint);
end;
end;
end;
end.

View File

@ -0,0 +1,41 @@
#ifndef ZYDIS_EXPORT_H
#define ZYDIS_EXPORT_H
#ifdef ZYDIS_STATIC_DEFINE
# define ZYDIS_EXPORT
# define ZYDIS_NO_EXPORT
#else
# ifndef ZYDIS_EXPORT
# ifdef Zydis_EXPORTS
/* We are building this library */
# define ZYDIS_EXPORT
# else
/* We are using this library */
# define ZYDIS_EXPORT
# endif
# endif
# ifndef ZYDIS_NO_EXPORT
# define ZYDIS_NO_EXPORT
# endif
#endif
#ifndef ZYDIS_DEPRECATED
# define ZYDIS_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef ZYDIS_DEPRECATED_EXPORT
# define ZYDIS_DEPRECATED_EXPORT ZYDIS_EXPORT ZYDIS_DEPRECATED
#endif
#ifndef ZYDIS_DEPRECATED_NO_EXPORT
# define ZYDIS_DEPRECATED_NO_EXPORT ZYDIS_NO_EXPORT ZYDIS_DEPRECATED
#endif
#define DEFINE_NO_DEPRECATED 0
#if DEFINE_NO_DEPRECATED
# define ZYDIS_NO_DEPRECATED
#endif
#endif

View File

@ -0,0 +1,286 @@
/**
*
*
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "pin.H"
#include "xed-interface.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include <set>
#include <Zydis/Zydis.h>
/* ========================================================================== */
/* TLS struct */
/* ========================================================================== */
struct ThreadData
{
CONTEXT ctx;
ZydisInstructionDecoder decoder;
ThreadData()
{
ZydisDecoderInitInstructionDecoderEx(
&decoder, ZYDIS_DISASSEMBLER_MODE_64BIT, NULL, 0
);
}
};
/* ========================================================================== */
/* Global variables */
/* ========================================================================== */
TLS_KEY tls_key;
std::ostream* out = &cerr;
PIN_LOCK unique_iforms_lock;
std::set<xed_iform_enum_t> unique_iforms;
/* ========================================================================== */
/* Tables */
/* ========================================================================== */
struct RegMapping
{
REG pin;
ZydisRegister zy;
};
RegMapping reg_mapping[] = {
// 64-bit GP register
{REG_RAX, ZYDIS_REGISTER_RAX},
{REG_RBX, ZYDIS_REGISTER_RBX},
{REG_RCX, ZYDIS_REGISTER_RCX},
{REG_RDX, ZYDIS_REGISTER_RDX},
{REG_RSP, ZYDIS_REGISTER_RSP},
{REG_RBP, ZYDIS_REGISTER_RBP},
{REG_RSI, ZYDIS_REGISTER_RSI},
{REG_RDI, ZYDIS_REGISTER_RDI},
{REG_R8, ZYDIS_REGISTER_R8 },
{REG_R9, ZYDIS_REGISTER_R9 },
{REG_R10, ZYDIS_REGISTER_R10},
{REG_R11, ZYDIS_REGISTER_R11},
{REG_R12, ZYDIS_REGISTER_R12},
{REG_R13, ZYDIS_REGISTER_R13},
{REG_R14, ZYDIS_REGISTER_R14},
{REG_R15, ZYDIS_REGISTER_R15},
// Segment registers
{REG_SEG_ES, ZYDIS_REGISTER_ES},
{REG_SEG_SS, ZYDIS_REGISTER_SS},
{REG_SEG_SS, ZYDIS_REGISTER_SS},
{REG_SEG_CS, ZYDIS_REGISTER_CS},
{REG_SEG_DS, ZYDIS_REGISTER_DS},
{REG_SEG_FS, ZYDIS_REGISTER_FS},
{REG_SEG_GS, ZYDIS_REGISTER_GS},
// Mask registers
{REG_K0, ZYDIS_REGISTER_K0},
{REG_K1, ZYDIS_REGISTER_K1},
{REG_K2, ZYDIS_REGISTER_K2},
{REG_K3, ZYDIS_REGISTER_K3},
{REG_K4, ZYDIS_REGISTER_K4},
{REG_K5, ZYDIS_REGISTER_K5},
{REG_K6, ZYDIS_REGISTER_K6},
{REG_K7, ZYDIS_REGISTER_K7},
// TODO: XMM, YMM, ZMM, ST, TR
// Special registers
{REG_MXCSR, ZYDIS_REGISTER_MXCSR},
};
/* ========================================================================== */
/* Command line switches */
/* ========================================================================== */
KNOB<string> knob_out_file(
KNOB_MODE_WRITEONCE, "pintool", "o", "", "Output file name"
);
KNOB<bool> know_unique_iform(
KNOB_MODE_WRITEONCE, "pintool", "unique_iform", "0",
"Only instrument one instruction per iform"
);
KNOB<bool> omit_op_checks(
KNOB_MODE_WRITEONCE, "pintool", "omit_op_checks", "0",
"Skip verification of operand write assumptions"
);
KNOB<bool> omit_flag_checks(
KNOB_MODE_WRITEONCE, "pintool", "omit_flag_checks", "1",
"Skip verification of flag write assumptions"
);
/* ========================================================================== */
/* Instrumentation callbacks */
/* ========================================================================== */
VOID PIN_FAST_ANALYSIS_CALL pre_ins_cb(THREADID tid, const CONTEXT* ctx)
{
ThreadData *tls = static_cast<ThreadData*>(PIN_GetThreadData(tls_key, tid));
PIN_SaveContext(ctx, &tls->ctx);
}
VOID PIN_FAST_ANALYSIS_CALL post_ins_cb(THREADID tid, const CONTEXT* post_ctx)
{
ThreadData *tls = static_cast<ThreadData*>(PIN_GetThreadData(tls_key, tid));
// Get IPs.
ADDRINT pre_ip = PIN_GetContextReg(&tls->ctx, REG_INST_PTR);
ADDRINT post_ip = PIN_GetContextReg(post_ctx, REG_INST_PTR);
// If the IP didn't change, we're probably dealing with a rep.
// Skip instruction until last execution where fallthrough kicks in.
ADDRINT ip_diff = post_ip - pre_ip;
if (!ip_diff) return;
// Disassemble previously executed instruction.
ZydisMemoryInput input;
ZydisInputInitMemoryInput(&input, (void*)pre_ip, 15);
ZydisDecoderSetInput(&tls->decoder, (ZydisCustomInput*)&input);
ZydisInstructionInfo insn_info;
ZydisStatus decode_status = ZydisDecoderDecodeNextInstruction(
&tls->decoder, &insn_info
);
// Can we decode it?
if (!ZYDIS_SUCCESS(decode_status)) {
*out << "Decoding failure" << endl;
goto error;
}
// Does the length look like what we expected?
if (insn_info.length != ip_diff) {
*out << "Instruction length mismatch (expected "
<< dec << ip_diff << ", got " << (int)insn_info.length
<< ')' << endl;
goto error;
}
// Analyze operand effects.
if (!omit_op_checks) {
for (const RegMapping* map = reg_mapping
; map < reg_mapping + sizeof reg_mapping / sizeof reg_mapping[0]
; ++map) {
ADDRINT pre_reg_val = PIN_GetContextReg(&tls->ctx, map->pin);
ADDRINT post_reg_val = PIN_GetContextReg(post_ctx, map->pin);
// Did the instruction touch this register?
if (pre_reg_val != post_reg_val) {
*out << "Reg value changed ("
<< ZydisRegisterGetString(map->zy)
<< ")!" << endl;
}
}
}
// Analyze flag effects.
if (!omit_flag_checks) {
ADDRINT prev_flags = PIN_GetContextReg(&tls->ctx, REG_GFLAGS);
ADDRINT new_flags = PIN_GetContextReg(post_ctx, REG_GFLAGS);
ADDRINT changed_flags = prev_flags ^ new_flags;
if (changed_flags) {
// TODO: implement once flag infos are available.
}
}
return;
error:
// Always print raw bytes on error.
*out << "Raw bytes: ";
for (size_t i = 0; i < 15; ++i) {
*out << setfill('0') << setw(2) << hex
<< (int)((uint8_t*)pre_ip)[i] << ' ';
}
*out << endl;
}
VOID instruction(INS ins, VOID *v)
{
if (!INS_HasFallThrough(ins)) return;
xed_decoded_inst_t* xed = INS_XedDec(ins);
xed_iform_enum_t iform = xed_decoded_inst_get_iform_enum(xed);
if (know_unique_iform.Value()) {
PIN_GetLock(&unique_iforms_lock, 0);
if (unique_iforms.find(iform) != unique_iforms.end()) {
PIN_ReleaseLock(&unique_iforms_lock);
return;
}
unique_iforms.insert(iform);
*out << iform << endl;
PIN_ReleaseLock(&unique_iforms_lock);
}
INS_InsertCall(
ins, IPOINT_BEFORE, (AFUNPTR)&pre_ins_cb,
IARG_FAST_ANALYSIS_CALL, IARG_THREAD_ID, IARG_CONST_CONTEXT,
IARG_END
);
INS_InsertCall(
ins, IPOINT_AFTER, (AFUNPTR)&post_ins_cb,
IARG_FAST_ANALYSIS_CALL, IARG_THREAD_ID, IARG_CONST_CONTEXT,
IARG_END
);
}
VOID thread_start(THREADID tid, CONTEXT *ctx, INT32 flags, VOID* v)
{
ThreadData* tls = new ThreadData;
PIN_SetThreadData(tls_key, tls, tid);
}
int main(int argc, char *argv[])
{
if (PIN_Init(argc, argv)) {
cerr << KNOB_BASE::StringKnobSummary() << endl;
return 1;
}
// Open output file.
string file_name = knob_out_file.Value();
if (!file_name.empty()) {
out = new std::ofstream(file_name.c_str());
}
// Init TLS.
tls_key = PIN_CreateThreadDataKey(0);
PIN_InitLock(&unique_iforms_lock);
// Register hooks.
PIN_AddThreadStartFunction(&thread_start, NULL);
INS_AddInstrumentFunction(&instruction, NULL);
// Start the program, never returns.
PIN_StartProgram();
return 0;
}
/* ========================================================================== */

View File

@ -0,0 +1,21 @@
##############################################################
#
# DO NOT EDIT THIS FILE!
#
##############################################################
# If the tool is built out of the kit, PIN_ROOT must be specified in the make invocation and point to the kit root.
ifdef PIN_ROOT
CONFIG_ROOT := $(PIN_ROOT)/source/tools/Config
else
CONFIG_ROOT := ../Config
endif
include $(CONFIG_ROOT)/makefile.config
include makefile.rules
include $(TOOLS_ROOT)/Config/makefile.default.rules
##############################################################
#
# DO NOT EDIT THIS FILE!
#
##############################################################

View File

@ -0,0 +1,89 @@
##############################################################
#
# This file includes all the test targets as well as all the
# non-default build rules and test recipes.
#
##############################################################
##############################################################
#
# Test targets
#
##############################################################
###### Place all generic definitions here ######
# This defines tests which run tools of the same name. This is simply for convenience to avoid
# defining the test name twice (once in TOOL_ROOTS and again in TEST_ROOTS).
# Tests defined here should not be defined in TOOL_ROOTS and TEST_ROOTS.
TEST_TOOL_ROOTS := ZydisTestTool
OBJECT_ROOTS += \
zydis/src/Decoder \
zydis/src/Formatter \
zydis/src/Input \
zydis/src/InstructionDetails \
zydis/src/InstructionTable \
zydis/src/Mnemonic \
zydis/src/Register \
zydis/src/Utils \
zydis/src/Zydis
# This defines the tests to be run that were not already defined in TEST_TOOL_ROOTS.
TEST_ROOTS :=
# This defines the tools which will be run during the the tests, and were not already defined in
# TEST_TOOL_ROOTS.
TOOL_ROOTS :=
# This defines the static analysis tools which will be run during the the tests. They should not
# be defined in TEST_TOOL_ROOTS. If a test with the same name exists, it should be defined in
# TEST_ROOTS.
# Note: Static analysis tools are in fact executables linked with the Pin Static Analysis Library.
# This library provides a subset of the Pin APIs which allows the tool to perform static analysis
# of an application or dll. Pin itself is not used when this tool runs.
SA_TOOL_ROOTS :=
# This defines all the applications that will be run during the tests.
APP_ROOTS :=
# This defines any additional object files that need to be compiled.
OBJECT_ROOTS :=
# This defines any additional dlls (shared objects), other than the pintools, that need to be compiled.
DLL_ROOTS :=
# This defines any static libraries (archives), that need to be built.
LIB_ROOTS :=
###### Define the sanity subset ######
# This defines the list of tests that should run in sanity. It should include all the tests listed in
# TEST_TOOL_ROOTS and TEST_ROOTS excluding only unstable tests.
SANITY_SUBSET := $(TEST_TOOL_ROOTS) $(TEST_ROOTS)
##############################################################
#
# Test recipes
#
##############################################################
# This section contains recipes for tests other than the default.
# See makefile.default.rules for the default test rules.
# All tests in this section should adhere to the naming convention: <testname>.test
##############################################################
#
# Build rules
#
##############################################################
ADDITIONAL_INCLUDES := -Izydis/include -I.
TOOL_CFLAGS += $(ADDITIONAL_INCLUDES)
TOOL_CXXFLAGS += $(ADDITIONAL_INCLUDES)
$(OBJDIR)ZydisTestTool$(PINTOOL_SUFFIX): $(OBJDIR)ZydisTestTool$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Decoder$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Formatter$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Input$(OBJ_SUFFIX) $(OBJDIR)zydis/src/InstructionDetails$(OBJ_SUFFIX) $(OBJDIR)zydis/src/InstructionTable$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Mnemonic$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Register$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Utils$(OBJ_SUFFIX) $(OBJDIR)zydis/src/Zydis$(OBJ_SUFFIX)
$(LINKER) $(TOOL_LDFLAGS) $(LINK_EXE)$@ $^ $(TOOL_LPATHS) $(TOOL_LIBS)

262364
assets/instructions.json Normal file

File diff suppressed because it is too large Load Diff

17
assets/process.py Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env python
"""Process script copy & paste template."""
import json
import collections
import re
with open('instructions.json') as fi:
fi = fi.read()
data = json.loads(fi, object_pairs_hook=collections.OrderedDict)
defs = data['definitions']
# ... processing code here ...
with open('instructions.json', 'w') as of:
json.dump(data, of)

174
examples/FormatHelper.h Normal file
View File

@ -0,0 +1,174 @@
/***************************************************************************************************
Zyan Disassembler Engine (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_FORMATHELPER_H
#define ZYDIS_FORMATHELPER_H
#include <assert.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <ctype.h>
#include <stdio.h>
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
/* ============================================================================================== */
/* Format helper functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Enums and types */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisStringBufferAppendMode datatype.
*/
typedef uint8_t ZydisStringBufferAppendMode;
/**
* @brief Values that represent zydis string-buffer append-modes.
*/
enum ZydisStringBufferAppendModes
{
/**
* @brief Appends the string as it is.
*/
ZYDIS_STRBUF_APPEND_MODE_DEFAULT,
/**
* @brief Converts the string to lowercase characters.
*/
ZYDIS_STRBUF_APPEND_MODE_LOWERCASE,
/**
* @brief Converts the string to uppercase characters.
*/
ZYDIS_STRBUF_APPEND_MODE_UPPERCASE
};
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Appends the @c text to the given @c buffer and increases the string-buffer pointer by
* the number of chars written.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param mode The append-mode.
* @param text The text to append.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given @c text.
*/
ZYDIS_INLINE ZydisStatus ZydisStringBufferAppend(char** buffer, size_t bufferLen,
ZydisStringBufferAppendMode mode, const char* text)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen != 0);
ZYDIS_ASSERT(text);
size_t strLen = strlen(text);
if (strLen >= bufferLen)
{
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
strncpy(*buffer, text, strLen + 1);
switch (mode)
{
case ZYDIS_STRBUF_APPEND_MODE_LOWERCASE:
for (size_t i = 0; i < strLen; ++i)
{
(*buffer[i]) = (char)tolower((*buffer)[i]);
}
break;
case ZYDIS_STRBUF_APPEND_MODE_UPPERCASE:
for (size_t i = 0; i < strLen; ++i)
{
(*buffer)[i] = (char)toupper((*buffer)[i]);
}
break;
default:
break;
}
*buffer += strLen;
return ZYDIS_STATUS_SUCCESS;
}
/**
* @brief Appends formatted text to the given @c buffer and increases the string-buffer pointer
* by the number of chars written.
*
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param mode The append-mode.
* @param format The format string.
*
* @return @c ZYDIS_STATUS_SUCCESS, if the function succeeded, or
* @c ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, if the size of the buffer was not
* sufficient to append the given text.
*/
ZYDIS_INLINE ZydisStatus ZydisStringBufferAppendFormat(char** buffer, size_t bufferLen,
ZydisStringBufferAppendMode mode, const char* format, ...)
{
ZYDIS_ASSERT(buffer);
ZYDIS_ASSERT(bufferLen != 0);
ZYDIS_ASSERT(format);
va_list arglist;
va_start(arglist, format);
int w = vsnprintf(*buffer, bufferLen, format, arglist);
if ((w < 0) || ((size_t)w >= bufferLen))
{
va_end(arglist);
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
switch (mode)
{
case ZYDIS_STRBUF_APPEND_MODE_LOWERCASE:
for (size_t i = 0; i < (size_t)w; ++i)
{
(*buffer)[i] = (char)tolower((*buffer)[i]);
}
break;
case ZYDIS_STRBUF_APPEND_MODE_UPPERCASE:
for (size_t i = 0; i < (size_t)w; ++i)
{
(*buffer)[i] = (char)toupper((*buffer)[i]);
}
break;
default:
break;
}
*buffer += (size_t)w;
va_end(arglist);
return ZYDIS_STATUS_SUCCESS;
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
#endif /* ZYDIS_FORMATHELPER_H */

239
examples/FormatterHooks.c Normal file
View File

@ -0,0 +1,239 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief Demonstrates the hooking functionality of the @c ZydisInstructionFormatter class.
*
* This example demonstrates the hooking functionality of the @c ZydisInstructionFormatter class by
* rewriting the mnemonics of (V)CMPPS and (V)CMPPD to their corresponding alias-forms (based on
* the condition encoded in the immediate operand).
*/
#include <inttypes.h>
#include <Zydis/Zydis.h>
#include "FormatHelper.h"
#include <stdlib.h>
#include <time.h>
/* ============================================================================================== */
/* Static data */
/* ============================================================================================== */
/**
* @brief Static array with the condition-code strings.
*/
static const char* conditionCodeStrings[0x20] =
{
/*00*/ "eq",
/*01*/ "lt",
/*02*/ "le",
/*03*/ "unord",
/*04*/ "neq",
/*05*/ "nlt",
/*06*/ "nle",
/*07*/ "ord",
/*08*/ "eq_uq",
/*09*/ "nge",
/*0A*/ "ngt",
/*0B*/ "false",
/*0C*/ "oq",
/*0D*/ "ge",
/*0E*/ "gt",
/*0F*/ "true",
/*10*/ "eq_os",
/*11*/ "lt_oq",
/*12*/ "le_oq",
/*13*/ "unord_s",
/*14*/ "neq_us",
/*15*/ "nlt_uq",
/*16*/ "nle_uq",
/*17*/ "ord_s",
/*18*/ "eq_us",
/*19*/ "nge_uq",
/*1A*/ "ngt_uq",
/*1B*/ "false_os",
/*1C*/ "neq_os",
/*1D*/ "ge_oq",
/*1E*/ "gt_oq",
/*1F*/ "true_us"
};
/* ============================================================================================== */
/* Hook callbacks */
/* ============================================================================================== */
ZydisFormatterFormatFunc defaultPrintMnemonic;
static ZydisStatus ZydisFormatterPrintMnemonic(ZydisInstructionFormatter* formatter,
char** buffer, size_t bufferLen, ZydisInstructionInfo* info)
{
// We use the user-data field of the instruction-info to pass data to the
// @c ZydisFormatterFormatOperandImm function.
// In this case we are using a simple ordinal value, but you could pass a pointer to a
// complex datatype as well.
info->userData = (void*)1;
// Rewrite the instruction-mnemonic for the given instructions
if ((info->operandCount == 3) && (info->operands[2].type == ZYDIS_OPERAND_TYPE_IMMEDIATE))
{
uint8_t conditionCode = info->operands[2].imm.value.ubyte;
if (conditionCode < 0x08)
{
switch (info->mnemonic)
{
case ZYDIS_MNEMONIC_CMPPS:
return ZydisStringBufferAppendFormat(buffer, bufferLen,
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "cmp%sps",
conditionCodeStrings[conditionCode]);
case ZYDIS_MNEMONIC_CMPPD:
return ZydisStringBufferAppendFormat(buffer, bufferLen,
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "cmp%spd",
conditionCodeStrings[conditionCode]);
default:
break;
}
}
}
if ((info->operandCount == 4) && (info->operands[3].type == ZYDIS_OPERAND_TYPE_IMMEDIATE))
{
uint8_t conditionCode = info->operands[3].imm.value.ubyte;
if (conditionCode < 0x20)
{
switch (info->mnemonic)
{
case ZYDIS_MNEMONIC_VCMPPS:
return ZydisStringBufferAppendFormat(buffer, bufferLen,
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "vcmp%sps",
conditionCodeStrings[conditionCode]);
case ZYDIS_MNEMONIC_VCMPPD:
return ZydisStringBufferAppendFormat(buffer, bufferLen,
ZYDIS_STRBUF_APPEND_MODE_DEFAULT, "vcmp%spd",
conditionCodeStrings[conditionCode]);
default:
break;
}
}
}
// We did not rewrite the instruction-mnemonic. Signal the @c ZydisFormatterFormatOperandImm
// function not to omit the operand
info->userData = (void*)0;
// Default mnemonic printing
return defaultPrintMnemonic(formatter, buffer, bufferLen, info);
}
/* ---------------------------------------------------------------------------------------------- */
ZydisFormatterFormatOperandFunc defaultFormatOperandImm;
static ZydisStatus ZydisFormatterFormatOperandImm(ZydisInstructionFormatter* formatter,
char** buffer, size_t bufferLen, ZydisInstructionInfo* info, ZydisOperandInfo* operand)
{
// The @c ZydisFormatterFormatMnemonic sinals us to omit the immediate (condition-code)
// operand, because it got replaced by the alias-mnemonic
if ((uintptr_t)info->userData == 1)
{
// The formatter will automatically omit the operand, if the buffer remains unchanged
// after the callback returns
return ZYDIS_STATUS_SUCCESS;
}
// Default immediate formatting
return defaultFormatOperandImm(formatter, buffer, bufferLen, info, operand);
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Helper functions */
/* ============================================================================================== */
void disassembleBuffer(uint8_t* data, size_t length, ZydisBool installHooks)
{
ZydisInstructionDecoder decoder;
ZydisDecoderInitInstructionDecoder(&decoder, ZYDIS_DISASSEMBLER_MODE_64BIT);
ZydisInstructionFormatter formatter;
ZydisFormatterInitInstructionFormatterEx(&formatter, ZYDIS_FORMATTER_STYLE_INTEL,
ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE,
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_IMM_DEFAULT);
if (installHooks)
{
defaultPrintMnemonic = &ZydisFormatterPrintMnemonic;
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC,
(const void**)&defaultPrintMnemonic);
defaultFormatOperandImm = &ZydisFormatterFormatOperandImm;
ZydisFormatterSetHook(&formatter, ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM,
(const void**)&defaultFormatOperandImm);
}
uint64_t instructionPointer = 0x007FFFFFFF400000;
ZydisInstructionInfo info;
char buffer[256];
while (ZYDIS_SUCCESS(
ZydisDecoderDecodeInstruction(&decoder, data, length, instructionPointer, &info)))
{
data += info.length;
length -= info.length;
instructionPointer += info.length;
printf("%016" PRIX64 " ", info.instrAddress);
ZydisFormatterFormatInstruction(&formatter, &info, &buffer[0], sizeof(buffer));
printf(" %s\n", &buffer[0]);
}
}
/* ============================================================================================== */
/* Entry point */
/* ============================================================================================== */
int main()
{
uint8_t data[] =
{
// cmpps xmm1, xmm4, 0x03
0x0F, 0xC2, 0xCC, 0x03,
// vcmpord_spd xmm1, xmm2, xmm3
0xC5, 0xE9, 0xC2, 0xCB, 0x17,
// vcmpps k2 {k7}, zmm2, dword ptr ds:[rax + rbx*4 + 0x100] {1to16}, 0x0F
0x62, 0xF1, 0x6C, 0x5F, 0xC2, 0x54, 0x98, 0x40, 0x0F
};
disassembleBuffer(&data[0], sizeof(data), ZYDIS_FALSE);
puts("");
disassembleBuffer(&data[0], sizeof(data), ZYDIS_TRUE);
getchar();
return 0;
}
/* ============================================================================================== */

435
examples/ZydisPE.c Normal file
View File

@ -0,0 +1,435 @@
/***************************************************************************************************
Zyan Disassembler Engine (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <Windows.h>
#include <Zydis/Zydis.h>
/* ============================================================================================== */
/* Custom Symbol Resolving */
/* ============================================================================================== */
/**
* @brief Returns the name of the exported function at the given @c address.
*
* @param moduleHandle The module handle.
* @param address The function address.
*
* @return The name of the exported function at @c address or @c NULL.
*/
static const char* GetExportName(HMODULE moduleHandle, uintptr_t address)
{
if (!moduleHandle)
{
return NULL;
}
PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)moduleHandle;
if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE)
{
return NULL;
}
PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)((uint8_t*)dosHeader + dosHeader->e_lfanew);
if (ntHeaders->Signature != IMAGE_NT_SIGNATURE)
{
return NULL;
}
uintptr_t entryPoint =
(uintptr_t)((uint8_t*)moduleHandle + ntHeaders->OptionalHeader.AddressOfEntryPoint);
if (address == entryPoint)
{
return "EntryPoint";
}
if (ntHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress)
{
PIMAGE_EXPORT_DIRECTORY exportDirectory =
(PIMAGE_EXPORT_DIRECTORY)((uint8_t*)moduleHandle +
ntHeaders->OptionalHeader.DataDirectory[
IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
PDWORD exportAddresses =
(PDWORD)((uint8_t*)moduleHandle +exportDirectory->AddressOfFunctions);
PDWORD exportNames =
(PDWORD)((uint8_t*)moduleHandle + exportDirectory->AddressOfNames);
for (uint32_t i = 0; i < exportDirectory->NumberOfFunctions; ++i)
{
if (address == (uintptr_t)moduleHandle + exportAddresses[i])
{
return (const char*)moduleHandle + exportNames[i];
}
}
}
return NULL;
}
/**
* @brief Inserts formatted text into the @c buffer at the given @c offset and increases the
* @c offset by the length of the text.
*
* @param buffer A pointer to the target buffer.
* @param bufferLen The length of the buffer.
* @param offset A pointer to the buffer-offset.
* @param format The format string.
*
* @return A zydis status code.
*/
static ZydisStatus ZydisBufferAppendFormat(char* buffer, size_t bufferLen, size_t* offset,
const char* format, ...)
{
va_list arglist;
va_start(arglist, format);
size_t n = bufferLen - *offset;
int w = vsnprintf(&buffer[*offset], n, format, arglist);
if ((w < 0) || ((size_t)w >= n))
{
va_end(arglist);
return ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE;
}
*offset += (size_t)w;
va_end(arglist);
return ZYDIS_STATUS_SUCCESS;
}
/**
* @brief Inserts the name of the exported function at @c address into the @c buffer at the given
* @c offset and increases the @c offset by the length of the name.
*
* @param buffer A pointer to the target buffer.
* @param bufferLen The length of the buffer.
* @param offset A pointer to the buffer-offset.
* @param moduleHandle The module handle.
* @param address The function address.
*
* @return A zydis status code.
*/
static ZydisStatus ZydisBufferAppendExport(char* buffer, size_t bufferLen, size_t* offset,
HMODULE moduleHandle, uintptr_t address)
{
const char* exportName = GetExportName(moduleHandle, address);
if (!exportName)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
char nameBuffer[MAX_PATH];
DWORD l = GetModuleFileNameA(moduleHandle, &nameBuffer[0], MAX_PATH);
if (l == 0)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
for (int i = l - 4; i >= 0; --i)
{
if (nameBuffer[i] == '\\')
{
memcpy(&nameBuffer[0], &nameBuffer[i + 1], l - i);
nameBuffer[l - i - 4] = 0;
break;
}
}
return ZydisBufferAppendFormat(buffer, bufferLen, offset, "%s%s", &nameBuffer[0], exportName);
}
/**
* @brief Inserts the name of the imported function at @c address into the @c buffer at the given
* @c offset and increases the @c offset by the length of the name.
*
* @param buffer A pointer to the target buffer.
* @param bufferLen The length of the buffer.
* @param offset A pointer to the buffer-offset.
* @param moduleHandle The module handle.
* @param address The function address.
*
* @return A zydis status code.
*/
static ZydisStatus ZydisBufferAppendImport(char* buffer, size_t bufferLen, size_t* offset,
HMODULE moduleHandle, uintptr_t address)
{
if (!moduleHandle)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)moduleHandle;
if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)((uint8_t*)dosHeader + dosHeader->e_lfanew);
if (ntHeaders->Signature != IMAGE_NT_SIGNATURE)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
if (ntHeaders->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress)
{
PIMAGE_IMPORT_DESCRIPTOR descriptor =
(PIMAGE_IMPORT_DESCRIPTOR)((uint8_t*)moduleHandle +
ntHeaders->OptionalHeader.DataDirectory[
IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
while (descriptor->OriginalFirstThunk)
{
const char* moduleName = (char*)((uint8_t*)moduleHandle + descriptor->Name);
PIMAGE_THUNK_DATA originalThunk =
(PIMAGE_THUNK_DATA)((uint8_t*)moduleHandle + descriptor->OriginalFirstThunk);
PIMAGE_THUNK_DATA thunk =
(PIMAGE_THUNK_DATA)((uint8_t*)moduleHandle + descriptor->FirstThunk);
while (originalThunk->u1.ForwarderString)
{
if (!(originalThunk->u1.Ordinal & 0x80000000))
{
if (address == (uintptr_t)&thunk->u1.Function)
{
PIMAGE_IMPORT_BY_NAME import = (PIMAGE_IMPORT_BY_NAME)
((uint8_t*)moduleHandle + originalThunk->u1.AddressOfData);
ZydisStatus status =
ZydisBufferAppendFormat(buffer, bufferLen, offset, "%s", moduleName);
if (!ZYDIS_SUCCESS(status))
{
return status;
}
*offset -= 3;
buffer[*offset] = 0;
return ZydisBufferAppendFormat(buffer, bufferLen, offset, "%s",
import->Name);
}
}
++originalThunk;
++thunk;
}
++descriptor;
}
}
return 1337 + 1000;
}
/**
* @brief Defines the @c ZydisPESymbolResolver struct.
*/
typedef struct ZydisPESymbolResolver_
{
ZydisCustomSymbolResolver resolver;
HMODULE moduleHandle;
char buffer[256];
} ZydisPESymbolResolver;
/**
* @brief The custom symbol resolver callback function.
*
* @param context A pointer to the @c ZydisPESymbolResolver instance.
* @param info A pointer to the @c ZydisInstructionInfo struct.
* @param operand A pointer to the @c ZydisOperandInfo struct.
* @param address The address.
* @param offset A pointer to the memory that receives the optional symbol-offset.
*
* @return The name of the resolved symbol or @c NULL, if no symbol was found at the given
* @c address.
*/
static const char* ResolveSymbol(ZydisPESymbolResolver* context, const ZydisInstructionInfo* info,
const ZydisOperandInfo* operand, uint64_t address, int64_t* offset)
{
(void)context;
(void)info;
(void)operand;
(void)address;
*offset = 0;
size_t bufferOffset = 0;
if (ZYDIS_SUCCESS(ZydisBufferAppendExport(&context->buffer[0], sizeof(context->buffer),
&bufferOffset, context->moduleHandle, (uintptr_t)address)))
{
return &context->buffer[0];
}
if (ZYDIS_SUCCESS(ZydisBufferAppendImport(&context->buffer[0], sizeof(context->buffer),
&bufferOffset, context->moduleHandle, (uintptr_t)address)))
{
return &context->buffer[0];
}
return NULL;
}
/* ============================================================================================== */
/* Entry point */
/* ============================================================================================== */
int main(int argc, char** argv)
{
if (argc != 2)
{
fprintf(stderr, "Usage: %s <input file>\n", (argc > 0 ? argv[0] : "ZydisPE"));
return EXIT_FAILURE;
}
// Load PE file
HMODULE hModule = LoadLibraryExA(argv[1], 0, LOAD_LIBRARY_AS_DATAFILE);
if (!hModule)
{
fprintf(stderr, "Could not load PE file. Error code: %d\n", GetLastError());
return EXIT_FAILURE;
}
PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)hModule;
if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE)
{
fprintf(stderr, "Invalid file signature\n");
goto FatalError;
}
PIMAGE_NT_HEADERS ntHeaders = (PIMAGE_NT_HEADERS)((uint8_t*)dosHeader + dosHeader->e_lfanew);
if (ntHeaders->Signature != IMAGE_NT_SIGNATURE)
{
fprintf(stderr, "Invalid file signature\n");
goto FatalError;
}
// Determine disassembler-mode
ZydisDisassemblerMode disassemblerMode;
switch (ntHeaders->FileHeader.Machine)
{
case IMAGE_FILE_MACHINE_I386:
disassemblerMode = ZYDIS_DISASSEMBLER_MODE_32BIT;
break;
case IMAGE_FILE_MACHINE_IA64:
case IMAGE_FILE_MACHINE_AMD64:
disassemblerMode = ZYDIS_DISASSEMBLER_MODE_64BIT;
break;
default:
fprintf(stderr, "Invalid assembly format\n");
goto FatalError;
}
ZydisMemoryInput input;
ZydisInstructionDecoder decoder;
if (!ZYDIS_SUCCESS(ZydisDecoderInitInstructionDecoderEx(&decoder, disassemblerMode,
(ZydisCustomInput*)&input, ZYDIS_DECODER_FLAG_SKIP_DATA)))
{
fputs("Failed to initialize instruction-decoder\n", stderr);
goto FatalError;
}
ZydisInstructionFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FORMATTER_FLAG_ALWAYS_DISPLAY_MEMORY_SIZE |
ZYDIS_FORMATTER_FLAG_ALWAYS_DISPLAY_MEMORY_SEGMENT)))
{
fputs("Failed to initialize instruction-formatter\n", stderr);
goto FatalError;
}
// Initialize custom symbol resolver
ZydisPESymbolResolver resolver;
resolver.resolver.resolveSymbol = (ZydisResolverResolveSymbolFunc)&ResolveSymbol;
resolver.moduleHandle = hModule;
ZydisFormatterSetSymbolResolver(&formatter, (ZydisCustomSymbolResolver*)&resolver);
LARGE_INTEGER frequency;
LARGE_INTEGER t1, t2;
QueryPerformanceFrequency(&frequency);
QueryPerformanceCounter(&t1);
// Disassemble all executable PE-sections
PIMAGE_SECTION_HEADER sectionHeader = (PIMAGE_SECTION_HEADER)((uint8_t*)ntHeaders +
sizeof(IMAGE_NT_HEADERS) - sizeof(IMAGE_OPTIONAL_HEADER) +
ntHeaders->FileHeader.SizeOfOptionalHeader);
for (int i = 0; i < ntHeaders->FileHeader.NumberOfSections; ++i)
{
if (sectionHeader->SizeOfRawData == 0)
{
continue;
}
if (!(sectionHeader->Characteristics & IMAGE_SCN_CNT_CODE))
{
continue;
}
void* data = (void*)((uint8_t*)dosHeader + sectionHeader->VirtualAddress);
if (!ZYDIS_SUCCESS(ZydisDecoderSetInstructionPointer(&decoder, (uint64_t)data)))
{
fputs("Failed to set instruction-pointer\n", stderr);
goto FatalError;
}
if (!ZYDIS_SUCCESS(ZydisInputInitMemoryInput(&input, data, sectionHeader->SizeOfRawData)))
{
fputs("Failed to initialize memory-input\n", stderr);
goto FatalError;
}
char buffer[256];
ZydisInstructionInfo info;
while (ZYDIS_SUCCESS(ZydisDecoderDecodeNextInstruction(&decoder, &info)))
{
const char* symbol = GetExportName(hModule, (uintptr_t)info.instrAddress);
if (symbol)
{
printf("\n%s:\n", symbol);
}
switch (info.mode)
{
case ZYDIS_DISASSEMBLER_MODE_16BIT:
case ZYDIS_DISASSEMBLER_MODE_32BIT:
printf("%08llX ", info.instrAddress);
break;
case ZYDIS_DISASSEMBLER_MODE_64BIT:
printf("%016llX ", info.instrAddress);
break;
default:
break;
}
for (int j = 0; j < info.length; ++j)
{
printf("%02X ", info.data[j]);
}
for (int j = info.length; j < 15; ++j)
{
printf(" ");
}
if (info.instrFlags & ZYDIS_INSTRFLAG_ERROR_MASK)
{
printf(" db %02x\n", info.data[0]);
continue;
}
if (!ZYDIS_SUCCESS(ZydisFormatterFormatInstruction(&formatter, &info, &buffer[0],
sizeof(buffer))))
{
fputs("Failed to format decoded instruction\n", stderr);
goto FatalError;
}
printf(" %s\n", &buffer[0]);
}
++sectionHeader;
}
QueryPerformanceCounter(&t2);
double elapsedTime = (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
printf("\n%f", elapsedTime);
return EXIT_SUCCESS;
FatalError:
FreeLibrary(hModule);
return EXIT_FAILURE;
}
/* ============================================================================================== */

154
include/Zydis/Decoder.h Normal file
View File

@ -0,0 +1,154 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_DECODER_H
#define ZYDIS_DECODER_H
#include <Zydis/Defines.h>
#include <Zydis/Types.h>
#include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* @brief Defines the @c ZydisDecoderFlags datatype.
*/
typedef uint32_t ZydisDecoderFlags;
// TODO: Add flags to enable/disable certain decoding-steps like operands, affected flags, ..
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisInstructionDecoder struct.
*/
typedef struct ZydisInstructionDecoder_
{
/**
* @brief The current disassembler-mode.
*/
ZydisDisassemblerMode disassemblerMode;
// TODO: Remove from this struct and pass as argument
/**
* @brief The current input buffer.
*/
struct
{
const uint8_t* buffer;
size_t bufferLen;
} input;
/**
* @brief Internal field. @c TRUE, if the @c imm8 value is already initialized.
*/
ZydisBool imm8initialized;
/**
* @brief Internal field. We have to store a copy of the imm8 value for instructions that
* encode different operands in the lo and hi part of the immediate.
*/
uint8_t imm8;
/**
* @brief Internal field. The 0x66 prefix can be consumed, if it is used as mandatory-prefix.
* This field contains the prefix-byte, if the prefix is present and not already
* consumed.
*/
uint8_t hasUnusedPrefix66;
/**
* @brief Internal field. The mutally exclusive 0xF2 and 0xF3 prefixs can be consumed, if
* they are used as mandatory-prefix. This field contains the prefix-byte of the
* latest 0xF2 or 0xF3 prefix, if one of the prefixes is present and not already
* consumed.
*/
uint8_t hasUnusedPrefixF2F3;
/**
* @brief Internal field. Contains the latest (significant) segment prefix.
*/
uint8_t lastSegmentPrefix;
} ZydisInstructionDecoder;
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @brief Initializes the given @c ZydisInstructionDecoder instance.
*
* @param decoder A pointer to the @c ZydisInstructionDecoder instance.
* @param disassemblerMode The desired disassembler-mode.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisDecoderInitInstructionDecoder(ZydisInstructionDecoder* decoder,
ZydisDisassemblerMode disassemblerMode);
/**
* @brief Decodes the instruction in the given input @c buffer.
*
* @param decoder A pointer to the @c ZydisInstructionDecoder instance.
* @param buffer A pointer to the input buffer.
* @param bufferLen The length of the input buffer.
* @param instructionPointer The instruction-pointer.
* @param info A pointer to the @c ZydisInstructionInfo struct, that receives the
* details about the decoded instruction.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisDecoderDecodeInstruction(ZydisInstructionDecoder* decoder,
const void* buffer, size_t bufferLen, uint64_t instructionPointer, ZydisInstructionInfo* info);
/**
* @brief Decodes the instruction in the given input @c buffer.
*
* @param decoder A pointer to the @c ZydisInstructionDecoder instance.
* @param buffer A pointer to the input buffer.
* @param bufferLen The length of the input buffer.
* @param instructionPointer The instruction-pointer.
* @param flags Additional decoding flags.
* @param info A pointer to the @c ZydisInstructionInfo struct, that receives the
* details about the decoded instruction.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisDecoderDecodeInstructionEx(ZydisInstructionDecoder* decoder,
const void* buffer, size_t bufferLen, uint64_t instructionPointer, ZydisDecoderFlags flags,
ZydisInstructionInfo* info);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_DECODER_H */

131
include/Zydis/Defines.h Normal file
View File

@ -0,0 +1,131 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_DEFINES_H
#define ZYDIS_DEFINES_H
#include <assert.h>
#include <ZydisExportConfig.h>
/* ============================================================================================== */
/* Compiler detection */
/* ============================================================================================== */
#if defined(__clang__)
# define ZYDIS_CLANG
# define ZYDIS_GNUC
#elif defined(__ICC) || defined(__INTEL_COMPILER)
# define ZYDIS_ICC
#elif defined(__GNUC__) || defined(__GNUG__)
# define ZYDIS_GCC
# define ZYDIS_GNUC
#elif defined(_MSC_VER)
# define ZYDIS_MSVC
#elif defined(__BORLANDC__)
# define ZYDIS_BORLAND
#else
# define ZYDIS_UNKNOWN_COMPILER
#endif
/* ============================================================================================== */
/* Platform detection */
/* ============================================================================================== */
#if defined(_WIN32)
# define ZYDIS_WINDOWS
#elif defined(__APPLE__)
# define ZYDIS_APPLE
# define ZYDIS_POSIX
#elif defined(__linux)
# define ZYDIS_LINUX
# define ZYDIS_POSIX
#elif defined(__unix)
# define ZYDIS_UNIX
# define ZYDIS_POSIX
#elif defined(__posix)
# define ZYDIS_POSIX
#else
# error "Unsupported platform detected"
#endif
/* ============================================================================================== */
/* Architecture detection */
/* ============================================================================================== */
#if defined (_M_AMD64) || defined (__x86_64__)
# define ZYDIS_X64
#elif defined (_M_IX86) || defined (__i386__)
# define ZYDIS_X86
#else
# error "Unsupported architecture detected"
#endif
/* ============================================================================================== */
/* Debug/Release detection */
/* ============================================================================================== */
#if defined(ZYDIS_MSVC) || defined(ZYDIS_BORLAND)
# ifdef _DEBUG
# define ZYDIS_DEBUG
# else
# define ZYDIS_RELEASE
# endif
#elif defined(ZYDIS_GNUC) || defined(ZYDIS_ICC)
# ifdef NDEBUG
# define ZYDIS_RELEASE
# else
# define ZYDIS_DEBUG
# endif
#else
# error "Unsupported compiler detected"
#endif
/* ============================================================================================== */
/* Misc compatibility macros */
/* ============================================================================================== */
#if defined(ZYDIS_MSVC) || defined(ZYDIS_BORLAND)
# define ZYDIS_INLINE __inline
#else
# define ZYDIS_INLINE static inline
#endif
/* ============================================================================================== */
/* Debugging macros */
/* ============================================================================================== */
#define ZYDIS_ASSERT(condition) assert(condition)
#define ZYDIS_UNREACHABLE assert(0)
/* ============================================================================================== */
/* Utils */
/* ============================================================================================== */
#define ZYDIS_ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
/* ============================================================================================== */
#endif /* ZYDIS_DEFINES_H */

80
include/Zydis/Encoder.h Normal file
View File

@ -0,0 +1,80 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_ENCODER_H
#define ZYDIS_ENCODER_H
#include <Zydis/Defines.h>
#include <Zydis/Types.h>
#include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Constants */
/* ============================================================================================== */
/**
* @brief Defines a mask of attributes users may excplicitly ask for.
*/
#define ZYDIS_USER_ENCODABLE_ATTRIB_MASK ( \
ZYDIS_ATTRIB_HAS_LOCK | \
ZYDIS_ATTRIB_HAS_REP | \
ZYDIS_ATTRIB_HAS_REPE | \
ZYDIS_ATTRIB_HAS_REPNE | \
ZYDIS_ATTRIB_HAS_BOUND | \
ZYDIS_ATTRIB_HAS_XACQUIRE | \
ZYDIS_ATTRIB_HAS_XRELEASE | \
ZYDIS_ATTRIB_HAS_BRANCH_TAKEN | \
ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN \
)
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @brief Encodes the given instruction info to byte-code.
*
* @param buffer A pointer to the output buffer.
* @param bufferLen The length of the output buffer.
* @param info A pointer to the @c ZydisInstructionInfo struct to be encoded.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisEncoderEncodeInstruction(void* buffer, size_t* bufferLen,
ZydisInstructionInfo* info);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_ENCODER_H */

469
include/Zydis/Formatter.h Normal file
View File

@ -0,0 +1,469 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_FORMATTER_H
#define ZYDIS_FORMATTER_H
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* @brief Defines the @c ZydisFormatterStyle datatype.
*/
typedef uint8_t ZydisFormatterStyle;
/**
* @brief Values that represent formatter-styles.
*/
enum ZydisFormatterStyles
{
/**
* @brief Generates intel-style disassembly.
*/
ZYDIS_FORMATTER_STYLE_INTEL
};
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisFormatFlags datatype.
*/
typedef uint32_t ZydisFormatterFlags;
/**
* @brief Formats the instruction in uppercase instead of lowercase.
*/
#define ZYDIS_FMTFLAG_UPPERCASE 0x00000001
/**
* @brief Forces the formatter to always print the segment register of memory-operands, instead
* of ommiting implicit DS/SS segments.
*/
#define ZYDIS_FMTFLAG_FORCE_SEGMENTS 0x00000002
/**
* @brief Forces the formatter to always print the size of memory-operands.
*/
#define ZYDIS_FMTFLAG_FORCE_OPERANDSIZE 0x00000004
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisFormatterAddressFormat datatype.
*/
typedef uint8_t ZydisFormatterAddressFormat;
/**
* @brief Values that represent address-formats.
*/
enum ZydisFormatterAddressFormats
{
/**
* @brief Currently defaults to @c ZYDIS_FORMATTER_ADDR_ABSOLUTE.
*/
ZYDIS_FORMATTER_ADDR_DEFAULT,
/**
* @brief Displays absolute addresses instead of relative ones.
*/
ZYDIS_FORMATTER_ADDR_ABSOLUTE,
/**
* @brief Uses signed hexadecimal values to display relative addresses.
*
* Examples:
* "JMP 0x20"
* "JMP -0x20"
*/
ZYDIS_FORMATTER_ADDR_RELATIVE_SIGNED,
/**
* @brief Uses unsigned hexadecimal values to display relative addresses.
*
* Examples:
* "JMP 0x20"
* "JMP 0xE0"
*/
ZYDIS_FORMATTER_ADDR_RELATIVE_UNSIGNED,
};
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisFormatterDisplacementFormat datatype.
*/
typedef uint8_t ZydisFormatterDisplacementFormat;
/**
* @brief Values that represent displacement-formats.
*/
enum ZydisFormatterDisplacementFormats
{
/**
* @brief Currently defaults to @c ZYDIS_FORMATTER_DISP_HEX_SIGNED.
*/
ZYDIS_FORMATTER_DISP_DEFAULT,
/**
* @brief Formats displacements as signed hexadecimal values.
*
* Examples:
* "MOV EAX, DWORD PTR SS:[ESP+0x400]"
* "MOV EAX, DWORD PTR SS:[ESP-0x400]"
*/
ZYDIS_FORMATTER_DISP_HEX_SIGNED,
/**
* @brief Formats displacements as unsigned hexadecimal values.
*
* Examples:
* "MOV EAX, DWORD PTR SS:[ESP+0x400]"
* "MOV EAX, DWORD PTR SS:[ESP+0xFFFFFC00]"
*/
ZYDIS_FORMATTER_DISP_HEX_UNSIGNED
};
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisFormatterImmediateFormat datatype.
*/
typedef uint8_t ZydisFormatterImmediateFormat;
/**
* @brief Values that represent formatter immediate-formats.
*/
enum ZydisFormatterImmediateFormats
{
/**
* @brief Currently defaults to @c ZYDIS_FORMATTER_IMM_HEX_UNSIGNED.
*/
ZYDIS_FORMATTER_IMM_DEFAULT,
/**
* @brief Automatically chooses the most suitable formatting-mode based on the operands
* @c ZydisOperandInfo.imm.isSigned attribute.
*/
ZYDIS_FORMATTER_IMM_HEX_AUTO,
/**
* @brief Formats immediates as signed hexadecimal values.
*
* Examples:
* "MOV EAX, 0x400"
* "MOV EAX, -0x400"
*/
ZYDIS_FORMATTER_IMM_HEX_SIGNED,
/**
* @brief Formats immediates as unsigned hexadecimal values.
*
* Examples:
* "MOV EAX, 0x400"
* "MOV EAX, 0xFFFFFC00"
*/
ZYDIS_FORMATTER_IMM_HEX_UNSIGNED
};
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisFormatterHookType datatype.
*/
typedef uint8_t ZydisFormatterHookType;
/**
* @brief Values that represent formatter hook-types.
*/
enum ZydisFormatterHookTypes
{
/**
* @brief This function is called before the formatter starts formatting an instruction.
*/
ZYDIS_FORMATTER_HOOK_PRE,
/**
* @brief This function is called before the formatter finished formatting an instruction.
*/
ZYDIS_FORMATTER_HOOK_POST,
/**
* @brief This function refers to the main formatting function, that internally calls all
* other function except the ones that are hooked by @c ZYDIS_FORMATTER_HOOK_PRE and
* @c ZYDIS_FORMATTER_HOOK_POST.
*
* Replacing this function allows for complete custom formatting, but indirectly disables all
* other hooks except for @c ZYDIS_FORMATTER_HOOK_PRE and @c ZYDIS_FORMATTER_HOOK_POST.
*/
ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION,
/**
* @brief This function is called to print the instruction prefixes.
*/
ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES,
/**
* @brief This function is called to print the instruction mnemonic.
*/
ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC,
/**
* @brief This function is called to format an register operand.
*/
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG,
/**
* @brief This function is called to format an memory operand.
*
* Replacing this function might indirectly disable some specific calls to the
* @c ZYDIS_FORMATTER_PRINT_ADDRESS and @c ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT functions.
*/
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM,
/**
* @brief This function is called to format an pointer operand.
*/
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR,
/**
* @brief This function is called to format an immediate operand.
*
* Replacing this function might indirectly disable some specific calls to the
* @c ZYDIS_FORMATTER_PRINT_ADDRESS and @c ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE functions.
*/
ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM,
/**
* @brief This function is called right before formatting an memory operand to print the
* optional size-specifier.
*/
ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE,
/**
* @brief This function is called right before formatting an memory operand to print the
* optional segment-register.
*/
ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT,
/**
* @brief This function is called right after formatting an operand to print the optional
* avx-512 operand decorator.
*/
ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR,
/**
* @brief This function is called to print an absolute address.
*/
ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS,
/**
* @brief This function is called to print a memory displacement value.
*/
ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT,
/**
* @brief This function is called to print an immediate value.
*/
ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE
};
/* ---------------------------------------------------------------------------------------------- */
typedef struct ZydisInstructionFormatter_ ZydisInstructionFormatter;
/**
* @brief Defines the @c ZydisFormatterNotifyFunc function pointer.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param info A pointer to the @c ZydisInstructionInfo struct.
*
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
* formatting process to fail.
*
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRE and
* @c ZYDIS_FORMATTER_HOOK_POST hook-types.
*/
typedef ZydisStatus (*ZydisFormatterNotifyFunc)(ZydisInstructionFormatter* formatter,
ZydisInstructionInfo* info);
/**
* @brief Defines the @c ZydisFormatterFormatFunc function pointer.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param info A pointer to the @c ZydisInstructionInfo struct.
*
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
* formatting process to fail.
*
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the
* number of chars written. Not increasing the buffer-pointer will cause unexpected behavior.
*
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION,
* @c ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES and @c ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC hook-types.
*/
typedef ZydisStatus (*ZydisFormatterFormatFunc)(ZydisInstructionFormatter* formatter,
char** buffer, size_t bufferLen, ZydisInstructionInfo* info);
/**
* @brief Defines the @c ZydisFormatterFormatOperandFunc function pointer.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param info A pointer to the @c ZydisInstructionInfo struct.
* @param operand A pointer to the @c ZydisOperandInfo struct.
*
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
* formatting process to fail.
*
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the
* number of chars written.
*
* Returning @c ZYDIS_STATUS_SUCCESS in one of the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_X hooks
* without increasing the buffer-pointer is valid and will cause the formatter to omit the current
* operand.
*
* Returning @c ZYDIS_STATUS_SUCCESS in @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE,
* @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT or @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR without
* increasing the buffer-pointer is valid and signals that the corresponding element should not be
* printed for the current operand.
*
* Not increasing the buffer-pointer for any other hook-type will cause unexpected behavior.
*
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG,
* @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR,
* @c ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, @c ZYDIS_FORMATTER_HOOK_PRINT_OPERANDSIZE,
* @c ZYDIS_FORMATTER_HOOK_PRINT_SEGMENT, @c ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR,
* @c ZYDIS_FORMATTER_HOOK_PRINT_DISPLACEMENT and @c ZYDIS_FORMATTER_HOOK_PRINT_IMMEDIATE
* hook-types.
*/
typedef ZydisStatus (*ZydisFormatterFormatOperandFunc)(ZydisInstructionFormatter* formatter,
char** buffer, size_t bufferLen, ZydisInstructionInfo* info, ZydisOperandInfo* operand);
/**
* @brief Defines the @c ZydisFormatterFormatAddressFunc function pointer.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param buffer A pointer to the string-buffer.
* @param bufferLen The length of the string-buffer.
* @param info A pointer to the @c ZydisInstructionInfo struct.
* @param operand A pointer to the @c ZydisOperandInfo struct.
*
* @return Returning a status code other than @c ZYDIS_STATUS_SUCCESS will immediately cause the
* formatting process to fail.
*
* After appending text to the @c buffer you MUST increase the buffer-pointer by the size of the
* number of chars written.
* Not increasing the buffer-pointer will cause unexpected behavior.
*
* This function type is used for the @c ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS hook-type.
*/
typedef ZydisStatus (*ZydisFormatterFormatAddressFunc)(ZydisInstructionFormatter* formatter,
char** buffer, size_t bufferLen, ZydisInstructionInfo* info, ZydisOperandInfo* operand,
uint64_t address);
/**
* @brief Defines the @c ZydisInstructionFormatter struct.
*/
struct ZydisInstructionFormatter_
{
ZydisFormatterFlags flags;
ZydisFormatterAddressFormat addressFormat;
ZydisFormatterDisplacementFormat displacementFormat;
ZydisFormatterImmediateFormat immediateFormat;
ZydisFormatterNotifyFunc funcPre;
ZydisFormatterNotifyFunc funcPost;
ZydisFormatterFormatFunc funcFormatInstruction;
ZydisFormatterFormatFunc funcPrintPrefixes;
ZydisFormatterFormatFunc funcPrintMnemonic;
ZydisFormatterFormatOperandFunc funcFormatOperandReg;
ZydisFormatterFormatOperandFunc funcFormatOperandMem;
ZydisFormatterFormatOperandFunc funcFormatOperandPtr;
ZydisFormatterFormatOperandFunc funcFormatOperandImm;
ZydisFormatterFormatOperandFunc funcPrintOperandSize;
ZydisFormatterFormatOperandFunc funcPrintSegment;
ZydisFormatterFormatOperandFunc funcPrintDecorator;
ZydisFormatterFormatAddressFunc funcPrintAddress;
ZydisFormatterFormatOperandFunc funcPrintDisplacement;
ZydisFormatterFormatOperandFunc funcPrintImmediate;
const char* prefixHEX;
const char* prefixOCT;
const char* delimMnemonic;
const char* delimOperands;
const char* fmtDecorator; // TODO:
};
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @brief Initializes the given @c ZydisInstructionFormatter instance.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param style The formatter style.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisFormatterInitInstructionFormatter(
ZydisInstructionFormatter* formatter, ZydisFormatterStyle style);
/**
* @brief Initializes the given @c ZydisInstructionFormatter instance.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param style The formatter style.
* @param addressFormat The address format.
* @param displacementFormat The displacement format.
* @param immmediateFormat The immediate format.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisFormatterInitInstructionFormatterEx(
ZydisInstructionFormatter* formatter, ZydisFormatterStyle style, ZydisFormatterFlags flags,
ZydisFormatterAddressFormat addressFormat, ZydisFormatterDisplacementFormat displacementFormat,
ZydisFormatterImmediateFormat immmediateFormat);
/**
* @brief TODO:
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param hook The formatter hook-type.
* @param callback TODO: In Out
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisFormatterSetHook(ZydisInstructionFormatter* formatter,
ZydisFormatterHookType hook, const void** callback);
/**
* @brief Formats the given instruction and writes it into the output buffer.
*
* @param formatter A pointer to the @c ZydisInstructionFormatter instance.
* @param info A pointer to the @c ZydisInstructionInfo struct.
* @param buffer A pointer to the output buffer.
* @param bufferLen The length of the output buffer.
*
* @return A zydis status code.
*/
ZYDIS_EXPORT ZydisStatus ZydisFormatterFormatInstruction(
ZydisInstructionFormatter* formatter, ZydisInstructionInfo* info, char* buffer,
size_t bufferLen);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_FORMATTER_H */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,25 @@
typedef struct ZydisInstructionDefinition_
{
uint32_t mnemonic : 11;
uint32_t operandsId : 9;
uint32_t evexContext : 2;
uint32_t evexMaskPolicy : 2;
uint32_t evexZeroMaskAccepted : 1;
uint32_t acceptsLock : 1;
uint32_t acceptsREP : 1;
uint32_t acceptsREPEREPNE : 1;
uint32_t acceptsBOUND : 1;
uint32_t acceptsXACQUIRE : 1;
uint32_t acceptsXRELEASE : 1;
uint32_t acceptsHLEWithoutLock : 1;
uint32_t acceptsBranchHints : 1;
#ifdef ZYDIS_ENABLE_FEATURE_IMPLICITLY_USED_REGISTERS
uint8_t implicitRegistersId : 8;
#endif
#ifdef ZYDIS_ENABLE_FEATURE_AFFECTED_FLAGS
uint8_t affectedFlagsId : 8;
#endif
#ifdef ZYDIS_ENABLE_FEATURE_CPUID
uint8_t cpuidId : 8;
#endif
} ZydisInstructionDefinition;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,349 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_INSTRUCTIONTABLE_H
#define ZYDIS_INSTRUCTIONTABLE_H
#include <Zydis/Defines.h>
#include <Zydis/Mnemonic.h>
#include <Zydis/InstructionInfo.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Generated types */
/* ---------------------------------------------------------------------------------------------- */
// MSVC does not like types other than (un-)signed int for bitfields
#ifdef ZYDIS_MSVC
# pragma warning(push)
# pragma warning(disable:4214)
#endif
#pragma pack(push, 1)
/**
* @brief Defines the @c ZydisInstructionTableNodeType datatype.
*/
typedef uint8_t ZydisInstructionTableNodeType;
/**
* @brief Defines the @c ZydisInstructionTableNodeValue datatype.
*/
typedef uint16_t ZydisInstructionTableNodeValue;
/**
* @brief Defines the @c ZydisInstructionTableNode struct.
*
* This struct is static for now, because its size is sufficient to encode up to 65535
* instruction filters (what is about 10 times more than we currently need).
*/
typedef struct ZydisInstructionTableNode_
{
ZydisInstructionTableNodeType type;
ZydisInstructionTableNodeValue value;
} ZydisInstructionTableNode;
/**
* @brief Defines the @c ZydisSemanticOperandType datatype.
*/
typedef uint8_t ZydisSemanticOperandType;
/**
* @brief Defines the @c ZydisOperandDefinition struct.
*
* This struct is static for now, because adding more operand-types oder encodings requires
* code changes anyways.
*/
typedef struct ZydisOperandDefinition_
{
ZydisSemanticOperandType type : 7;
ZydisOperandEncoding encoding : 5;
ZydisOperandAction action : 3;
} ZydisOperandDefinition;
#include <Zydis/Internal/GeneratedTypes.inc>
#pragma pack(pop)
#ifdef ZYDIS_MSVC
# pragma warning(pop)
#endif
/* ---------------------------------------------------------------------------------------------- */
/* Instruction Table */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Values that represent zydis instruction table node types.
*/
enum ZydisInstructionTableNodeTypes
{
ZYDIS_NODETYPE_INVALID = 0x00,
/**
* @brief Reference to an instruction-definition with 0 operands.
*/
ZYDIS_NODETYPE_DEFINITION_0OP = 0x01,
/**
* @brief Reference to an instruction-definition with 1 operands.
*/
ZYDIS_NODETYPE_DEFINITION_1OP = 0x02,
/**
* @brief Reference to an instruction-definition with 2 operands.
*/
ZYDIS_NODETYPE_DEFINITION_2OP = 0x03,
/**
* @brief Reference to an instruction-definition with 3 operands.
*/
ZYDIS_NODETYPE_DEFINITION_3OP = 0x04,
/**
* @brief Reference to an instruction-definition with 4 operands.
*/
ZYDIS_NODETYPE_DEFINITION_4OP = 0x05,
/**
* @brief Reference to an instruction-definition with 5 operands.
*/
ZYDIS_NODETYPE_DEFINITION_5OP = 0x06,
/**
* @brief Reference to an opcode filter.
*/
ZYDIS_NODETYPE_FILTER_OPCODE = 0x07,
/**
* @brief Reference to an VEX/EVEX-map filter.
*/
ZYDIS_NODETYPE_FILTER_VEX = 0x08,
/**
* @brief Reference to an XOP-map filter.
*/
ZYDIS_NODETYPE_FILTER_XOP = 0x09,
/**
* @brief Reference to an instruction-mode filter.
*/
ZYDIS_NODETYPE_FILTER_MODE = 0x0A,
/**
* @brief Reference to a mandatory-prefix filter.
*/
ZYDIS_NODETYPE_FILTER_MANDATORYPREFIX = 0x0B,
/**
* @brief Reference to a ModRM.mod filter.
*/
ZYDIS_NODETYPE_FILTER_MODRMMOD = 0x0C,
/**
* @brief Reference to a ModRM.reg filter.
*/
ZYDIS_NODETYPE_FILTER_MODRMREG = 0x0D,
/**
* @brief Reference to a ModRM.rm filter.
*/
ZYDIS_NODETYPE_FILTER_MODRMRM = 0x0E,
/**
* @brief Reference to an operand-size filter.
*/
ZYDIS_NODETYPE_FILTER_OPERANDSIZE = 0x0F,
/**
* @brief Reference to an address-size filter.
*/
ZYDIS_NODETYPE_FILTER_ADDRESSSIZE = 0x10,
/**
* @brief Reference to an REX/VEX/EVEX.w filter.
*/
ZYDIS_NODETYPE_FILTER_REXW = 0x11,
/**
* @brief Reference to an VEX/EVEX.l filter.
*/
ZYDIS_NODETYPE_FILTER_VEXL = 0x12,
/**
* @brief Reference to an EVEX.l' filter.
*/
ZYDIS_NODETYPE_FILTER_EVEXL2 = 0x13,
/**
* @brief Reference to an EVEX.b filter.
*/
ZYDIS_NODETYPE_FILTER_EVEXB = 0x14
};
/* ---------------------------------------------------------------------------------------------- */
/* Operand definition */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Values that represent semantic operand types.
*/
enum ZydisSemanticOperandTypes
{
ZYDIS_SEM_OPERAND_TYPE_UNUSED,
ZYDIS_SEM_OPERAND_TYPE_GPR8,
ZYDIS_SEM_OPERAND_TYPE_GPR16,
ZYDIS_SEM_OPERAND_TYPE_GPR32,
ZYDIS_SEM_OPERAND_TYPE_GPR64,
ZYDIS_SEM_OPERAND_TYPE_FPR,
ZYDIS_SEM_OPERAND_TYPE_VR64,
ZYDIS_SEM_OPERAND_TYPE_VR128,
ZYDIS_SEM_OPERAND_TYPE_VR256,
ZYDIS_SEM_OPERAND_TYPE_VR512,
ZYDIS_SEM_OPERAND_TYPE_TR,
ZYDIS_SEM_OPERAND_TYPE_CR,
ZYDIS_SEM_OPERAND_TYPE_DR,
ZYDIS_SEM_OPERAND_TYPE_SREG,
ZYDIS_SEM_OPERAND_TYPE_MSKR,
ZYDIS_SEM_OPERAND_TYPE_BNDR,
ZYDIS_SEM_OPERAND_TYPE_MEM,
ZYDIS_SEM_OPERAND_TYPE_MEM8,
ZYDIS_SEM_OPERAND_TYPE_MEM16,
ZYDIS_SEM_OPERAND_TYPE_MEM32,
ZYDIS_SEM_OPERAND_TYPE_MEM64,
ZYDIS_SEM_OPERAND_TYPE_MEM80,
ZYDIS_SEM_OPERAND_TYPE_MEM128,
ZYDIS_SEM_OPERAND_TYPE_MEM256,
ZYDIS_SEM_OPERAND_TYPE_MEM512,
ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST2,
ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4,
ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8,
ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16,
ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2,
ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4,
ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8,
ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST16,
ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX,
ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY,
ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBZ,
ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBX,
ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY,
ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBZ,
ZYDIS_SEM_OPERAND_TYPE_M1616,
ZYDIS_SEM_OPERAND_TYPE_M1632,
ZYDIS_SEM_OPERAND_TYPE_M1664,
ZYDIS_SEM_OPERAND_TYPE_MEM112,
ZYDIS_SEM_OPERAND_TYPE_MEM224,
ZYDIS_SEM_OPERAND_TYPE_IMM8,
ZYDIS_SEM_OPERAND_TYPE_IMM16,
ZYDIS_SEM_OPERAND_TYPE_IMM32,
ZYDIS_SEM_OPERAND_TYPE_IMM64,
ZYDIS_SEM_OPERAND_TYPE_IMM8U,
ZYDIS_SEM_OPERAND_TYPE_REL8,
ZYDIS_SEM_OPERAND_TYPE_REL16,
ZYDIS_SEM_OPERAND_TYPE_REL32,
ZYDIS_SEM_OPERAND_TYPE_REL64,
ZYDIS_SEM_OPERAND_TYPE_PTR1616,
ZYDIS_SEM_OPERAND_TYPE_PTR1632,
ZYDIS_SEM_OPERAND_TYPE_PTR1664,
ZYDIS_SEM_OPERAND_TYPE_MOFFS16,
ZYDIS_SEM_OPERAND_TYPE_MOFFS32,
ZYDIS_SEM_OPERAND_TYPE_MOFFS64,
ZYDIS_SEM_OPERAND_TYPE_SRCIDX8,
ZYDIS_SEM_OPERAND_TYPE_SRCIDX16,
ZYDIS_SEM_OPERAND_TYPE_SRCIDX32,
ZYDIS_SEM_OPERAND_TYPE_SRCIDX64,
ZYDIS_SEM_OPERAND_TYPE_DSTIDX8,
ZYDIS_SEM_OPERAND_TYPE_DSTIDX16,
ZYDIS_SEM_OPERAND_TYPE_DSTIDX32,
ZYDIS_SEM_OPERAND_TYPE_DSTIDX64,
ZYDIS_SEM_OPERAND_TYPE_FIXED1,
ZYDIS_SEM_OPERAND_TYPE_AL,
ZYDIS_SEM_OPERAND_TYPE_CL,
ZYDIS_SEM_OPERAND_TYPE_AX,
ZYDIS_SEM_OPERAND_TYPE_DX,
ZYDIS_SEM_OPERAND_TYPE_EAX,
ZYDIS_SEM_OPERAND_TYPE_ECX,
ZYDIS_SEM_OPERAND_TYPE_RAX,
ZYDIS_SEM_OPERAND_TYPE_ES,
ZYDIS_SEM_OPERAND_TYPE_CS,
ZYDIS_SEM_OPERAND_TYPE_SS,
ZYDIS_SEM_OPERAND_TYPE_DS,
ZYDIS_SEM_OPERAND_TYPE_GS,
ZYDIS_SEM_OPERAND_TYPE_FS,
ZYDIS_SEM_OPERAND_TYPE_ST0
};
/* ---------------------------------------------------------------------------------------------- */
/* Instruction definition */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Values that represent zydis EVEX.b-contexts.
*/
enum ZydisEvexBFunctionalities
{
ZYDIS_EVEX_CONTEXT_INVALID,
ZYDIS_EVEX_CONTEXT_BC,
ZYDIS_EVEX_CONTEXT_RC,
ZYDIS_EVEX_CONTEXT_SAE
};
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Functions */
/* ============================================================================================== */
/**
* @brief Returns the root node of the instruction table.
*
* @return The root node of the instruction table.
*/
ZYDIS_NO_EXPORT const ZydisInstructionTableNode* ZydisInstructionTableGetRootNode();
/**
* @brief Returns the child node of @c parent specified by @c index.
*
* @param parent The parent node.
* @param index The index of the child node to retrieve.
*
* @return The specified child node.
*/
ZYDIS_NO_EXPORT const ZydisInstructionTableNode* ZydisInstructionTableGetChildNode(
const ZydisInstructionTableNode* parent, uint16_t index);
/**
* @brief Returns the instruction- and operand-definition that is linked to the given @c node.
*
* @param node The instruction definition node.
* @param definition A pointer to a variable that receives a pointer to the
* instruction-definition.
* @param operands A pointer to a variable that receives a pointer to the first
* operand-definition of the instruction.
* @param operandCount A pointer to a variable that receives the number of operand-definitions
* for the instruction.
*
* @return @c TRUE, if @c node contained a valid instruction-definition, @c FALSE if not.
*/
ZYDIS_NO_EXPORT ZydisBool ZydisInstructionTableGetDefinition(const ZydisInstructionTableNode* node,
const ZydisInstructionDefinition** definition, const ZydisOperandDefinition** operands,
uint8_t* operandCount);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_INSTRUCTIONTABLE_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,782 @@
const ZydisOperandDefinition operandDefinitions1[][1] =
{
/*0000*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0001*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0002*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0003*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_PTR1616, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0004*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_PTR1632, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0005*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0006*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*0007*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0008*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1664, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0009*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1616, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1632, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0010*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0011*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0012*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0013*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0014*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0015*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0016*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0017*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0018*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0019*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*001A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*001B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE) },
/*001C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FPR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*001D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM80, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*001E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM112, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*001F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM224, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0020*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0021*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE) },
/*0022*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0023*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0024*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0025*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL64, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0026*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0027*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL16, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0028*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_REL32, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0029*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_ES, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*002A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SS, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*002B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DS, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*002C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE) },
/*002D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE) },
/*002E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE) },
/*002F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0030*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0031*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0032*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0033*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0034*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0035*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FS, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0036*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GS, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0037*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CS, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0038*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READ) },
/*0039*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READ) },
/*003A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READ) },
/*003B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*003C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*003D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*003E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0040*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0041*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0042*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1664, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0043*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1632, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0044*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0045*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE) },
/*0046*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE) },
/*0047*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0048*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0049*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE) },
/*004A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE) },
/*004B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE) },
/*004C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*004D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) }
};
const ZydisOperandDefinition operandDefinitions2[][2] =
{
/*0000*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0001*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0002*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0003*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0004*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0005*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0006*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0007*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0008*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0009*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*000F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0010*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0011*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0012*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*0013*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0014*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0015*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0016*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0017*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*0018*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0019*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*001A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*001B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*001C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0020*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0021*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0022*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0023*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0024*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0025*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0026*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0027*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0028*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0029*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*002A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0030*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0031*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0032*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0033*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0034*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0035*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0036*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0037*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0038*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0039*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*003A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_BNDR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*003B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*003C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*003D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*003E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*003F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0040*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0041*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0042*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0043*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0044*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0045*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0046*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0047*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0048*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0049*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*004A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*004B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*004C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*004D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*004E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*004F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0050*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0051*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0052*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0053*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0054*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0055*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0056*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0057*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0058*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0059*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*005A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*005B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*005C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*005D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*005E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*005F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0060*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0061*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0062*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*0063*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0064*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0065*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*0066*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0067*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0068*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0069*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*006A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*006B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*006C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*006D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*006E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*006F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0070*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0071*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0072*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0073*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0074*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0075*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0076*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0077*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0078*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0079*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*007A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*007B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*007C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*007D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*007E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*007F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0080*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0081*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0082*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0083*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0084*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0085*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0086*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0087*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_ST0, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FPR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0088*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FPR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_ST0, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0089*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_ST0, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FPR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*008A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*008E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*008F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0090*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0091*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0092*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0093*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0094*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0095*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_ECX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0096*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_ECX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0097*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0098*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0099*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*009A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*009B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*009C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*009D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*009E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*009F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00A0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00A4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1616, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1632, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_M1664, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00AE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00AF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00B0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00B1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00B2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00B3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00B4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00B5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00B6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00B7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00B8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00B9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00BA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00BB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00BC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00BD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00BE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00BF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00C0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00C1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SREG, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00C2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00C9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00CA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00CB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00CC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00CD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00CE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00CF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MOFFS64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00D8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*00D9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM64, ZYDIS_OPERAND_ACTION_READ) },
/*00DA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*00DB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*00DC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*00DD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*00DE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*00DF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*00E0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*00E1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*00E2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*00E3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*00E4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00E5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00E6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00E7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00E8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00E9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00EA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00EB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00EC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_TR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00ED*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_TR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00EE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00EF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00F1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00F2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00F8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00F9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00FA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00FB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*00FC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00FD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00FE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*00FF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0100*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0101*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0102*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0103*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0104*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0105*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0106*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0107*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0108*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0109*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*010A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*010B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*010C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*010D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*010E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*010F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0110*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0111*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_SRCIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0112*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0113*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0114*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE) },
/*0115*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0116*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0117*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0118*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0119*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*011A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*011B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*011C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*011D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*011E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*011F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0120*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0121*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0122*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0123*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0124*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0125*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0126*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0127*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0128*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0129*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*012A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_FIXED1, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*012B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*012C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*012D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*012E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*012F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0130*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0131*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0132*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0133*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0134*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0135*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0136*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0137*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX8, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0138*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX16, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0139*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX32, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*013A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_DSTIDX64, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*013B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*013C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*013D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*013E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*013F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0140*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*0141*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*0142*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ) },
/*0143*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0144*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0145*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0146*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0147*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0148*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0149*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*014A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*014B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*014C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*014D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*014E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*014F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0150*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0151*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0152*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0153*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0154*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0155*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0156*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0157*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0158*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0159*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*015A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*015B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ) },
/*015C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ) },
/*015D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*015E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*015F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0160*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0161*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0162*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ) },
/*0163*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ) },
/*0164*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0165*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0166*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0167*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0168*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0169*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*016A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*016B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*016C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*016D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*016E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*016F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0170*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0171*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0172*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0173*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0174*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0175*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0176*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0177*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0178*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0179*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*017A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*017B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*017C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*017D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*017E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*017F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0180*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0181*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0182*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0183*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0184*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0185*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0186*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0187*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0188*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0189*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*018A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*018B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*018C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*018D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*018E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*018F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0190*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0191*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0192*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0193*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0194*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0195*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0196*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0197*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0198*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM_CD2, ZYDIS_OPERAND_ACTION_READ) },
/*0199*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM_CD2, ZYDIS_OPERAND_ACTION_READ) },
/*019A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM_CD2, ZYDIS_OPERAND_ACTION_READ) },
/*019B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*019C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*019D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*019E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*019F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM_CD2, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01A9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01AA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01AB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01AC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01AD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01AE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01AF*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01B0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01B1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01B2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBX, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01B3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01B4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBZ, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*01B5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*01B6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_RAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READWRITE) },
/*01B7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_AX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READWRITE) },
/*01B8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_EAX, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_OPCODE, ZYDIS_OPERAND_ACTION_READWRITE) }
};
const ZydisOperandDefinition operandDefinitions3[][3] =
{
/*0000*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0001*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0002*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0003*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0004*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0005*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0006*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0007*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0008*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0009*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*000A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ) },
/*000B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ) },
/*000C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ) },
/*000D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ) },
/*000E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0010*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0011*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0012*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0013*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0014*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0015*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0016*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0017*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*0018*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*0019*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM64, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*001A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM16, ZYDIS_OPERAND_ENCODING_IMM16, ZYDIS_OPERAND_ACTION_READ) },
/*001B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM32, ZYDIS_OPERAND_ENCODING_IMM32, ZYDIS_OPERAND_ACTION_READ) },
/*001C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0020*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0021*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0022*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0023*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0024*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0025*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0026*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0027*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0028*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0029*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0030*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0031*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0032*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0033*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0034*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0035*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0036*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0037*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0038*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0039*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0040*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0041*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0042*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0043*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0044*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0045*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0046*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0047*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0048*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*0049*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR16, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*004A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_CL, ZYDIS_OPERAND_ENCODING_NONE, ZYDIS_OPERAND_ACTION_READ) },
/*004B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*004C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*004D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*004E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*004F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*0050*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ) },
/*0051*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ) },
/*0052*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0053*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0054*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*0055*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0056*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0057*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0058*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0059*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*005A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*005B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*005C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*005D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*005E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*005F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0060*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0061*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0062*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0063*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0064*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0065*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0066*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0067*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0068*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0069*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*006A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*006B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*006C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*006D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*006E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*006F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0070*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0071*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0072*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0073*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0074*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0075*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0076*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0077*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0078*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0079*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*007A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*007B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*007C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*007D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READWRITE) },
/*007E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBY, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READWRITE) },
/*007F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBX, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0080*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0081*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_VSIBY, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READWRITE) },
/*0082*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0083*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0084*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0085*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0086*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0087*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0088*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0089*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*008D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*008E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*008F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ) },
/*0090*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*0091*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ) },
/*0092*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ) },
/*0093*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0094*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0095*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0096*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0097*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0098*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ) },
/*0099*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*009A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*009B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*009C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*009D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*009E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*009F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM_CD2, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*00A0*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_VSIBX, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READWRITE) },
/*00A1*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*00A2*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*00A3*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ) },
/*00A4*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ) },
/*00A5*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ) },
/*00A6*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*00A7*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*00A8*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00A9*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AA*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*00AB*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ) },
/*00AC*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AD*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READWRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*00AE*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) }
};
const ZydisOperandDefinition operandDefinitions4[][4] =
{
/*0000*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0001*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0002*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0003*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0004*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0005*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0006*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0007*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0008*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0009*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*000F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ) },
/*0010*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ) },
/*0011*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ) },
/*0012*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ) },
/*0013*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0014*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0015*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM512, ZYDIS_OPERAND_ENCODING_RM_CD64, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0016*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST2, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0017*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0018*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0019*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST4, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST8, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32_BCST16, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*001F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0020*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0021*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0022*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0023*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MSKR, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0024*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM_CD8, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0025*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM_CD4, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0026*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0027*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0028*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*0029*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ) },
/*002B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002C*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ) },
/*002D*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ) },
/*002E*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*002F*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0030*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0031*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM_CD16, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0032*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0033*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM_CD32, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0034*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR512, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0035*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0036*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR32, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0037*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM8, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0038*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_GPR64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*0039*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM64, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003A*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) },
/*003B*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM16, ZYDIS_OPERAND_ENCODING_RM_CD2, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8, ZYDIS_OPERAND_ACTION_READ) }
};
const ZydisOperandDefinition operandDefinitions5[][5] =
{
/*0000*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0001*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0002*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0003*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_MEM256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0004*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0005*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR128, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0006*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) },
/*0007*/ { ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_REG, ZYDIS_OPERAND_ACTION_WRITE), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_VVVV, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_IMM8_HI, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_VR256, ZYDIS_OPERAND_ENCODING_RM, ZYDIS_OPERAND_ACTION_READ), ZYDIS_OPERAND_DEFINITION(ZYDIS_SEM_OPERAND_TYPE_IMM8U, ZYDIS_OPERAND_ENCODING_IMM8_LO, ZYDIS_OPERAND_ACTION_READ) }
};

68
include/Zydis/Mnemonic.h Normal file
View File

@ -0,0 +1,68 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_MNEMONIC_H
#define ZYDIS_MNEMONIC_H
#include <Zydis/Defines.h>
#include <Zydis/Types.h>
#include <Zydis/Status.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* @brief Defines the @c ZydisInstructionMnemonic datatype.
*/
typedef uint16_t ZydisInstructionMnemonic;
#include <Zydis/Internal/MnemonicDefines.inc>
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @brief Returns the specified instruction mnemonic string.
*
* @param mnemonic The mnemonic.
*
* @return The instruction mnemonic string or @c NULL, if an invalid mnemonic was passed.
*/
ZYDIS_EXPORT const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnemonic);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_MNEMONIC_H */

305
include/Zydis/Register.h Normal file
View File

@ -0,0 +1,305 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_REGISTER_H
#define ZYDIS_REGISTER_H
#include <Zydis/Defines.h>
#include <Zydis/Types.h>
#include <Zydis/Status.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Registers */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisRegister datatype.
*/
typedef uint8_t ZydisRegister;
/**
* @brief Values that represent zydis registers.
*/
enum ZydisRegisters
{
ZYDIS_REGISTER_NONE,
// General purpose registers 64-bit
ZYDIS_REGISTER_RAX, ZYDIS_REGISTER_RCX, ZYDIS_REGISTER_RDX, ZYDIS_REGISTER_RBX,
ZYDIS_REGISTER_RSP, ZYDIS_REGISTER_RBP, ZYDIS_REGISTER_RSI, ZYDIS_REGISTER_RDI,
ZYDIS_REGISTER_R8, ZYDIS_REGISTER_R9, ZYDIS_REGISTER_R10, ZYDIS_REGISTER_R11,
ZYDIS_REGISTER_R12, ZYDIS_REGISTER_R13, ZYDIS_REGISTER_R14, ZYDIS_REGISTER_R15,
// General purpose registers 32-bit
ZYDIS_REGISTER_EAX, ZYDIS_REGISTER_ECX, ZYDIS_REGISTER_EDX, ZYDIS_REGISTER_EBX,
ZYDIS_REGISTER_ESP, ZYDIS_REGISTER_EBP, ZYDIS_REGISTER_ESI, ZYDIS_REGISTER_EDI,
ZYDIS_REGISTER_R8D, ZYDIS_REGISTER_R9D, ZYDIS_REGISTER_R10D, ZYDIS_REGISTER_R11D,
ZYDIS_REGISTER_R12D, ZYDIS_REGISTER_R13D, ZYDIS_REGISTER_R14D, ZYDIS_REGISTER_R15D,
// General purpose registers 16-bit
ZYDIS_REGISTER_AX, ZYDIS_REGISTER_CX, ZYDIS_REGISTER_DX, ZYDIS_REGISTER_BX,
ZYDIS_REGISTER_SP, ZYDIS_REGISTER_BP, ZYDIS_REGISTER_SI, ZYDIS_REGISTER_DI,
ZYDIS_REGISTER_R8W, ZYDIS_REGISTER_R9W, ZYDIS_REGISTER_R10W, ZYDIS_REGISTER_R11W,
ZYDIS_REGISTER_R12W, ZYDIS_REGISTER_R13W, ZYDIS_REGISTER_R14W, ZYDIS_REGISTER_R15W,
// General purpose registers 8-bit
ZYDIS_REGISTER_AL, ZYDIS_REGISTER_CL, ZYDIS_REGISTER_DL, ZYDIS_REGISTER_BL,
ZYDIS_REGISTER_AH, ZYDIS_REGISTER_CH, ZYDIS_REGISTER_DH, ZYDIS_REGISTER_BH,
ZYDIS_REGISTER_SPL, ZYDIS_REGISTER_BPL, ZYDIS_REGISTER_SIL, ZYDIS_REGISTER_DIL,
ZYDIS_REGISTER_R8B, ZYDIS_REGISTER_R9B, ZYDIS_REGISTER_R10B, ZYDIS_REGISTER_R11B,
ZYDIS_REGISTER_R12B, ZYDIS_REGISTER_R13B, ZYDIS_REGISTER_R14B, ZYDIS_REGISTER_R15B,
// Floating point legacy registers
ZYDIS_REGISTER_ST0, ZYDIS_REGISTER_ST1, ZYDIS_REGISTER_ST2, ZYDIS_REGISTER_ST3,
ZYDIS_REGISTER_ST4, ZYDIS_REGISTER_ST5, ZYDIS_REGISTER_ST6, ZYDIS_REGISTER_ST7,
// Floating point multimedia registers
ZYDIS_REGISTER_MM0, ZYDIS_REGISTER_MM1, ZYDIS_REGISTER_MM2, ZYDIS_REGISTER_MM3,
ZYDIS_REGISTER_MM4, ZYDIS_REGISTER_MM5, ZYDIS_REGISTER_MM6, ZYDIS_REGISTER_MM7,
// Floating point vector registers 512-bit
ZYDIS_REGISTER_ZMM0, ZYDIS_REGISTER_ZMM1, ZYDIS_REGISTER_ZMM2, ZYDIS_REGISTER_ZMM3,
ZYDIS_REGISTER_ZMM4, ZYDIS_REGISTER_ZMM5, ZYDIS_REGISTER_ZMM6, ZYDIS_REGISTER_ZMM7,
ZYDIS_REGISTER_ZMM8, ZYDIS_REGISTER_ZMM9, ZYDIS_REGISTER_ZMM10, ZYDIS_REGISTER_ZMM11,
ZYDIS_REGISTER_ZMM12, ZYDIS_REGISTER_ZMM13, ZYDIS_REGISTER_ZMM14, ZYDIS_REGISTER_ZMM15,
ZYDIS_REGISTER_ZMM16, ZYDIS_REGISTER_ZMM17, ZYDIS_REGISTER_ZMM18, ZYDIS_REGISTER_ZMM19,
ZYDIS_REGISTER_ZMM20, ZYDIS_REGISTER_ZMM21, ZYDIS_REGISTER_ZMM22, ZYDIS_REGISTER_ZMM23,
ZYDIS_REGISTER_ZMM24, ZYDIS_REGISTER_ZMM25, ZYDIS_REGISTER_ZMM26, ZYDIS_REGISTER_ZMM27,
ZYDIS_REGISTER_ZMM28, ZYDIS_REGISTER_ZMM29, ZYDIS_REGISTER_ZMM30, ZYDIS_REGISTER_ZMM31,
// Floating point vector registers 256-bit
ZYDIS_REGISTER_YMM0, ZYDIS_REGISTER_YMM1, ZYDIS_REGISTER_YMM2, ZYDIS_REGISTER_YMM3,
ZYDIS_REGISTER_YMM4, ZYDIS_REGISTER_YMM5, ZYDIS_REGISTER_YMM6, ZYDIS_REGISTER_YMM7,
ZYDIS_REGISTER_YMM8, ZYDIS_REGISTER_YMM9, ZYDIS_REGISTER_YMM10, ZYDIS_REGISTER_YMM11,
ZYDIS_REGISTER_YMM12, ZYDIS_REGISTER_YMM13, ZYDIS_REGISTER_YMM14, ZYDIS_REGISTER_YMM15,
ZYDIS_REGISTER_YMM16, ZYDIS_REGISTER_YMM17, ZYDIS_REGISTER_YMM18, ZYDIS_REGISTER_YMM19,
ZYDIS_REGISTER_YMM20, ZYDIS_REGISTER_YMM21, ZYDIS_REGISTER_YMM22, ZYDIS_REGISTER_YMM23,
ZYDIS_REGISTER_YMM24, ZYDIS_REGISTER_YMM25, ZYDIS_REGISTER_YMM26, ZYDIS_REGISTER_YMM27,
ZYDIS_REGISTER_YMM28, ZYDIS_REGISTER_YMM29, ZYDIS_REGISTER_YMM30, ZYDIS_REGISTER_YMM31,
// Floating point vector registers 128-bit
ZYDIS_REGISTER_XMM0, ZYDIS_REGISTER_XMM1, ZYDIS_REGISTER_XMM2, ZYDIS_REGISTER_XMM3,
ZYDIS_REGISTER_XMM4, ZYDIS_REGISTER_XMM5, ZYDIS_REGISTER_XMM6, ZYDIS_REGISTER_XMM7,
ZYDIS_REGISTER_XMM8, ZYDIS_REGISTER_XMM9, ZYDIS_REGISTER_XMM10, ZYDIS_REGISTER_XMM11,
ZYDIS_REGISTER_XMM12, ZYDIS_REGISTER_XMM13, ZYDIS_REGISTER_XMM14, ZYDIS_REGISTER_XMM15,
ZYDIS_REGISTER_XMM16, ZYDIS_REGISTER_XMM17, ZYDIS_REGISTER_XMM18, ZYDIS_REGISTER_XMM19,
ZYDIS_REGISTER_XMM20, ZYDIS_REGISTER_XMM21, ZYDIS_REGISTER_XMM22, ZYDIS_REGISTER_XMM23,
ZYDIS_REGISTER_XMM24, ZYDIS_REGISTER_XMM25, ZYDIS_REGISTER_XMM26, ZYDIS_REGISTER_XMM27,
ZYDIS_REGISTER_XMM28, ZYDIS_REGISTER_XMM29, ZYDIS_REGISTER_XMM30, ZYDIS_REGISTER_XMM31,
// Flags registers
ZYDIS_REGISTER_RFLAGS, ZYDIS_REGISTER_EFLAGS, ZYDIS_REGISTER_FLAGS,
// Instruction-pointer registers
ZYDIS_REGISTER_RIP, ZYDIS_REGISTER_EIP, ZYDIS_REGISTER_IP,
// Special registers
ZYDIS_REGISTER_MXCSR, ZYDIS_REGISTER_PKRU, ZYDIS_REGISTER_XCR0,
// Segment registers
ZYDIS_REGISTER_ES, ZYDIS_REGISTER_SS, ZYDIS_REGISTER_CS, ZYDIS_REGISTER_DS,
ZYDIS_REGISTER_FS, ZYDIS_REGISTER_GS,
// Table registers
ZYDIS_REGISTER_GDTR, ZYDIS_REGISTER_LDTR, ZYDIS_REGISTER_IDTR, ZYDIS_REGISTER_TR,
// Test registers
ZYDIS_REGISTER_TR0, ZYDIS_REGISTER_TR1, ZYDIS_REGISTER_TR2, ZYDIS_REGISTER_TR3,
ZYDIS_REGISTER_TR4, ZYDIS_REGISTER_TR5, ZYDIS_REGISTER_TR6, ZYDIS_REGISTER_TR7,
// Control registers
ZYDIS_REGISTER_CR0, ZYDIS_REGISTER_CR1, ZYDIS_REGISTER_CR2, ZYDIS_REGISTER_CR3,
ZYDIS_REGISTER_CR4, ZYDIS_REGISTER_CR5, ZYDIS_REGISTER_CR6, ZYDIS_REGISTER_CR7,
ZYDIS_REGISTER_CR8, ZYDIS_REGISTER_CR9, ZYDIS_REGISTER_CR10, ZYDIS_REGISTER_CR11,
ZYDIS_REGISTER_CR12, ZYDIS_REGISTER_CR13, ZYDIS_REGISTER_CR14, ZYDIS_REGISTER_CR15,
// Debug registers
ZYDIS_REGISTER_DR0, ZYDIS_REGISTER_DR1, ZYDIS_REGISTER_DR2, ZYDIS_REGISTER_DR3,
ZYDIS_REGISTER_DR4, ZYDIS_REGISTER_DR5, ZYDIS_REGISTER_DR6, ZYDIS_REGISTER_DR7,
ZYDIS_REGISTER_DR8, ZYDIS_REGISTER_DR9, ZYDIS_REGISTER_DR10, ZYDIS_REGISTER_DR11,
ZYDIS_REGISTER_DR12, ZYDIS_REGISTER_DR13, ZYDIS_REGISTER_DR14, ZYDIS_REGISTER_DR15,
// Mask registers
ZYDIS_REGISTER_K0, ZYDIS_REGISTER_K1, ZYDIS_REGISTER_K2, ZYDIS_REGISTER_K3,
ZYDIS_REGISTER_K4, ZYDIS_REGISTER_K5, ZYDIS_REGISTER_K6, ZYDIS_REGISTER_K7,
// Bound registers
ZYDIS_REGISTER_BND0, ZYDIS_REGISTER_BND1, ZYDIS_REGISTER_BND2, ZYDIS_REGISTER_BND3,
ZYDIS_REGISTER_BNDCFG, ZYDIS_REGISTER_BNDSTATUS
};
/* ---------------------------------------------------------------------------------------------- */
/* Register classes */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisRegisterClass datatype.
*/
typedef uint8_t ZydisRegisterClass;
/**
* @brief Values that represent zydis register-classes.
*/
enum ZydisRegisterClasses
{
ZYDIS_REGCLASS_INVALID,
/**
* @brief 8-bit general-purpose registers.
*/
ZYDIS_REGCLASS_GPR8,
/**
* @brief 16-bit general-purpose registers.
*/
ZYDIS_REGCLASS_GPR16,
/**
* @brief 32-bit general-purpose registers.
*/
ZYDIS_REGCLASS_GPR32,
/**
* @brief 64-bit general-purpose registers.
*/
ZYDIS_REGCLASS_GPR64,
/**
* @brief Floating point legacy registers.
*/
ZYDIS_REGCLASS_X87,
/**
* @brief Floating point multimedia registers.
*/
ZYDIS_REGCLASS_MMX,
/**
* @brief 128-bit vector registers.
*/
ZYDIS_REGCLASS_XMM,
/**
* @brief 256-bit vector registers.
*/
ZYDIS_REGCLASS_YMM,
/**
* @brief 512-bit vector registers.
*/
ZYDIS_REGCLASS_ZMM,
/**
* @brief Flags registers.
*/
ZYDIS_REGCLASS_FLAGS,
/**
* @brief Instruction-pointer registers.
*/
ZYDIS_REGCLASS_IP,
/**
* @brief Segment registers.
*/
ZYDIS_REGCLASS_SEGMENT,
/**
* @brief Test registers.
*/
ZYDIS_REGCLASS_TEST,
/**
* @brief Control registers.
*/
ZYDIS_REGCLASS_CONTROL,
/**
* @brief Debug registers.
*/
ZYDIS_REGCLASS_DEBUG,
/**
* @brief Mask registers.
*/
ZYDIS_REGCLASS_MASK,
/**
* @brief Bound registers.
*/
ZYDIS_REGCLASS_BOUND
};
/* ---------------------------------------------------------------------------------------------- */
/* Register width */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Defines the @c ZydisRegisterWidth datatype.
*/
typedef uint16_t ZydisRegisterWidth;
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @brief Returns the register specified by the @c registerClass and the @c id.
*
* @param registerClass The register class.
* @param id The register id.
*
* @return The register specified by the @c registerClass and the @c id or @c ZYDIS_REGISTER_NONE,
* if an invalid parameter was passed.
*/
ZYDIS_EXPORT ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, uint8_t id);
/**
* @brief Returns the id of the specified register.
*
* @param reg The register.
*
* @return The id of the specified register, or -1 if an invalid parameter was passed.
*/
ZYDIS_EXPORT int16_t ZydisRegisterGetId(ZydisRegister reg);
/**
* @brief Returns the register-class of the specified register.
*
* @param reg The register.
*
* @return The register-class of the specified register.
*/
ZYDIS_EXPORT ZydisRegisterClass ZydisRegisterGetClass(ZydisRegister reg);
/**
* @brief Returns the width of the specified register mode.
*
* @param reg The register.
*
* @return The width of the specified register.
*/
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth(ZydisRegister reg);
/**
* @brief Returns the width of the specified register in 64-bit mode.
*
* @param reg The register.
*
* @return The width of the specified register.
*/
ZYDIS_EXPORT ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg);
/**
* @brief Returns the specified register string.
*
* @param reg The register.
*
* @return The register string or @c NULL, if an invalid register was passed.
*/
ZYDIS_EXPORT const char* ZydisRegisterGetString(ZydisRegister reg);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_REGISTER_H */

172
include/Zydis/Status.h Normal file
View File

@ -0,0 +1,172 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_STATUS_H
#define ZYDIS_STATUS_H
#include <Zydis/Types.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* @brief Defines the @c ZydisStatus datatype.
*/
typedef uint32_t ZydisStatus;
/**
* @brief Values that represent a zydis status-codes.
*/
enum ZydisStatusCode
{
/* ------------------------------------------------------------------------------------------ */
/* General */
/* ------------------------------------------------------------------------------------------ */
/**
* @brief The operation completed successfully.
*/
ZYDIS_STATUS_SUCCESS = 0x00000000,
/**
* @brief An invalid parameter was passed to a function.
*/
ZYDIS_STATUS_INVALID_PARAMETER,
/**
* @brief An attempt was made to perform an invalid operation.
*/
ZYDIS_STATUS_INVALID_OPERATION,
/* ------------------------------------------------------------------------------------------ */
/* Decoder */
/* ------------------------------------------------------------------------------------------ */
/**
* @brief An attempt was made to read data from an input data-source that has no more data
* available.
*/
ZYDIS_STATUS_NO_MORE_DATA,
/**
* @brief An general error occured while decoding the current instruction. The instruction
* might be undefined.
*/
ZYDIS_STATUS_DECODING_ERROR,
/**
* @brief The instruction exceeded the maximum length of 15 bytes.
*/
ZYDIS_STATUS_INSTRUCTION_TOO_LONG,
/**
* @brief The instruction encoded an invalid register.
*/
ZYDIS_STATUS_BAD_REGISTER,
/**
* @brief A lock-prefix (F0) was found while decoding an instruction that does not support
* locking.
*/
ZYDIS_STATUS_ILLEGAL_LOCK,
/**
* @brief A legacy-prefix (F2, F3, 66) was found while decoding a XOP/VEX/EVEX instruction.
*/
ZYDIS_STATUS_ILLEGAL_LEGACY_PFX,
/**
* @brief A rex-prefix was found while decoding a XOP/VEX/EVEX instruction.
*/
ZYDIS_STATUS_ILLEGAL_REX,
/**
* @brief An invalid opcode-map value was found while decoding a XOP/VEX/EVEX-prefix.
*/
ZYDIS_STATUS_INVALID_MAP,
/**
* @brief An error occured while decoding the EVEX-prefix.
*/
ZYDIS_STATUS_MALFORMED_EVEX,
// TODO:
ZYDIS_STATUS_INVALID_MASK,
ZYDIS_STATUS_INVALID_VSIB,
/* ------------------------------------------------------------------------------------------ */
/* Encoder */
/* ------------------------------------------------------------------------------------------ */
// TODO:
ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION,
/* ------------------------------------------------------------------------------------------ */
/* Formatter */
/* ------------------------------------------------------------------------------------------ */
/**
* @brief A buffer passed to a function was too small to complete the requested operation.
*/
ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE,
/* ------------------------------------------------------------------------------------------ */
/* Misc */
/* ------------------------------------------------------------------------------------------ */
/**
* @brief The base value for user-defined status codes.
*/
ZYDIS_STATUS_USER = 0x10000000
};
/* ============================================================================================== */
/* Macros */
/* ============================================================================================== */
/**
* @brief Checks if a zydis operation was successfull.
*
* @param status The zydis status-code to check.
*/
#define ZYDIS_SUCCESS(status) (status == ZYDIS_STATUS_SUCCESS)
/**
* @brief Checks if a zydis operation was successfull and returns the status-code, if not.
*
* @param status The zydis status-code to check.
*/
#define ZYDIS_CHECK(status) \
do \
{ \
ZydisStatus s = status; \
if (!ZYDIS_SUCCESS(s)) \
{ \
return s; \
} \
} while(0)
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_STATUS_H */

71
include/Zydis/Types.h Normal file
View File

@ -0,0 +1,71 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
* @brief Includes and defines some default datatypes.
*/
#ifndef ZYDIS_TYPES_H
#define ZYDIS_TYPES_H
/* ============================================================================================== */
/* Integral types */
/* ============================================================================================== */
/**
* uint8_t, uint16_t, uint32_t, uint64_t, int8_t, int16_t, int32_t, int64_t
*/
#include <stdint.h>
/**
* size_t, ptrdiff_t
*/
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Boolean */
/* ============================================================================================== */
#define ZYDIS_FALSE 0
#define ZYDIS_TRUE 1
/**
* @briefs Defines the @c ZydisBool datatype.
*/
typedef uint8_t ZydisBool;
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_TYPES_H */

61
include/Zydis/Utils.h Normal file
View File

@ -0,0 +1,61 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_UTILS_H
#define ZYDIS_UTILS_H
#include <stdint.h>
#include <Zydis/Defines.h>
#include <Zydis/Status.h>
#include <Zydis/InstructionInfo.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Utils */
/* ============================================================================================== */
/**
* @brief Calculates the absolute target-address of an relative instruction operand.
*
* @param info A pointer to the @c ZydisInstructionInfo struct.
* @param operand A pointer to the @c ZydisOperandInfo struct.
* @param address A pointer to the memory that receives the absolute target-address.
*
* @return A zydis status code
*/
ZYDIS_EXPORT ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisInstructionInfo* info,
const ZydisOperandInfo* operand, uint64_t* address);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_UTILS_H */

139
include/Zydis/Zydis.h Normal file
View File

@ -0,0 +1,139 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#ifndef ZYDIS_H
#define ZYDIS_H
#include <Zydis/Defines.h>
#include <Zydis/Types.h>
#include <Zydis/Status.h>
#include <Zydis/Mnemonic.h>
#include <Zydis/Register.h>
#include <Zydis/InstructionInfo.h>
#include <Zydis/Decoder.h>
#include <Zydis/Formatter.h>
#include <Zydis/Encoder.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Macros */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Constants */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief A macro that defines the zydis version.
*/
#define ZYDIS_VERSION (uint64_t)0x0002000000000000
/* ---------------------------------------------------------------------------------------------- */
/* Helper macros */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Extracts the major-part of the zydis version.
*
* @param version The zydis version value
*/
#define ZYDIS_VERSION_MAJOR(version) (uint16_t)((version & 0xFFFF000000000000) >> 48)
/**
* @brief Extracts the minor-part of the zydis version.
*
* @param version The zydis version value
*/
#define ZYDIS_VERSION_MINOR(version) (uint16_t)((version & 0x0000FFFF00000000) >> 32)
/**
* @brief Extracts the patch-part of the zydis version.
*
* @param version The zydis version value
*/
#define ZYDIS_VERSION_PATCH(version) (uint16_t)((version & 0x00000000FFFF0000) >> 16)
/**
* @brief Extracts the build-part of the zydis version.
*
* @param version The zydis version value
*/
#define ZYDIS_VERSION_BUILD(version) (uint16_t)(version & 0x000000000000FFFF)
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Enums and types */
/* ============================================================================================== */
/**
* @brief Defines the @c ZydisFeature datatype.
*/
typedef uint8_t ZydisFeature;
/**
* @brief Values that represent zydis features.
*/
enum ZydisFeatures
{
ZYDIS_FEATURE_IMPLICITLY_USED_REGISTERS,
ZYDIS_FEATURE_AFFECTED_FLAGS,
ZYDIS_FEATURE_CPUID
};
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
/**
* @brief Returns the zydis version.
*
* @return The zydis version.
*
* Use the macros provided in this file to extract the major, minor, patch and build part from the
* returned version value.
*/
ZYDIS_EXPORT uint64_t ZydisGetVersion();
/**
* @brief Checks, if the specified feature is enabled in the current zydis library instance.
*
* @param feature The feature.
*
* @return @c True if the feature is enabled, @c false if not.
*/
ZYDIS_EXPORT ZydisBool ZydisIsFeatureEnabled(ZydisFeature feature);
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif /* ZYDIS_H */

2405
src/Decoder.c Normal file

File diff suppressed because it is too large Load Diff

1121
src/Encoder.c Normal file

File diff suppressed because it is too large Load Diff

1003
src/Formatter.c Normal file

File diff suppressed because it is too large Load Diff

353
src/InstructionTable.c Normal file
View File

@ -0,0 +1,353 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <assert.h>
#include <Zydis/Internal/InstructionTable.h>
/* ============================================================================================== */
/* Data tables */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Forward declarations */
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Contains all opcode filters.
*
* Indexed by the numeric value of the opcode.
*/
extern const ZydisInstructionTableNode filterOpcode[][256];
/**
* @brief Contains all VEX-map filters.
*
* Index values:
* 0 = LES, LDS or BOUND instruction (default encoding)
* 1 = 0F
* 2 = 0F38
* 3 = 0F3A
* 4 = 66
* 5 = 66_0F
* 6 = 66_0F38
* 7 = 66_0F3A
* 8 = F3
* 9 = F3_0F
* A = F3_0F38
* B = F3_0F3A
* C = F2
* D = F2_0F
* E = F2_0F38
* F = F2_0F3A
*/
extern const ZydisInstructionTableNode filterVEX[][16];
/**
* @brief Contains all XOP-map filters.
*
* Index values:
* 0 = POP instruction (default encoding)
* 1 = xop8
* 2 = xop9
* 3 = xopA
*/
extern const ZydisInstructionTableNode filterXOP[][4];
/**
* @brief Contains all instruction-mode filters.
*
* Index values:
* 0 = 64 bit mode required
* 1 = 64 bit mode excluded
*/
extern const ZydisInstructionTableNode filterMode[][2];
/**
* @brief Contains all mandatory-prefix switch tables.
*
* Index values:
* 0 = none
* 1 = 66
* 2 = F3
* 3 = F2
*/
extern const ZydisInstructionTableNode filterMandatoryPrefix[][4];
/**
* @brief Contains all ModRM.mod filters.
*
* Index values:
* 0 = [modrm_mod == !11] = memory
* 1 = [modrm_mod == 11] = register
*/
extern const ZydisInstructionTableNode filterModrmMod[][2];
/**
* @brief Contains all ModRM.reg filters.
*
* Indexed by the numeric value of the modrm_reg field.
*/
extern const ZydisInstructionTableNode filterModrmReg[][8];
/**
* @brief Contains all ModRM.rm filters.
*
* Indexed by the numeric value of the modrm_rm field.
*/
extern const ZydisInstructionTableNode filterModrmRm[][8];
/**
* @brief Contains all operand-size filters.
*
* Index values:
* 0 = 16bit = 0x66 prefix in 32 bit mode
* 1 = 32bit = 0x66 prefix in 16 bit mode
*/
extern const ZydisInstructionTableNode filterOperandSize[][2];
/**
* @brief Contains all address-size filters.
*
* Index values:
* 0 = 16
* 1 = 32
* 2 = 64
*/
extern const ZydisInstructionTableNode filterAddressSize[][3];
/**
* @brief Contains all REX/VEX/EVEX.w filters.
*
* Indexed by the numeric value of the REX/VEX/EVEX.w field.
*/
extern const ZydisInstructionTableNode filterREXW[][2];
/**
* @brief Contains all VEX.l filters.
*
* Indexed by the numeric value of the VEX/EVEX.l field.
*/
extern const ZydisInstructionTableNode filterVEXL[][2];
/**
* @brief Contains all EVEX.l' filters.
*
* Indexed by the numeric value of the EVEX.l' field.
*/
extern const ZydisInstructionTableNode filterEVEXL2[][2];
/**
* @brief Contains all EVEX.b filters.
*
* Indexed by the numeric value of the EVEX.b field.
*/
extern const ZydisInstructionTableNode filterEVEXB[][2];
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Contains all operand-definitions with 1 operands.
*/
extern const ZydisOperandDefinition operandDefinitions1[][1];
/**
* @brief Contains all operand-definitions with 2 operands.
*/
extern const ZydisOperandDefinition operandDefinitions2[][2];
/**
* @brief Contains all operand-definitions with 3 operands.
*/
extern const ZydisOperandDefinition operandDefinitions3[][3];
/**
* @brief Contains all operand-definitions with 4 operands.
*/
extern const ZydisOperandDefinition operandDefinitions4[][4];
/**
* @brief Contains all operand-definitions with 5 operands.
*/
extern const ZydisOperandDefinition operandDefinitions5[][5];
/* ---------------------------------------------------------------------------------------------- */
/**
* @brief Contains all instruction-definitions.
*/
extern const ZydisInstructionDefinition instructionDefinitions[];
/* ---------------------------------------------------------------------------------------------- */
/* Functions */
/* ---------------------------------------------------------------------------------------------- */
const ZydisInstructionTableNode* ZydisInstructionTableGetRootNode()
{
static const ZydisInstructionTableNode root = { ZYDIS_NODETYPE_FILTER_OPCODE, 0x00000000 };
return &root;
}
const ZydisInstructionTableNode* ZydisInstructionTableGetChildNode(
const ZydisInstructionTableNode* parent, uint16_t index)
{
switch (parent->type)
{
case ZYDIS_NODETYPE_FILTER_OPCODE:
ZYDIS_ASSERT(index < 256);
return &filterOpcode[parent->value][index];
case ZYDIS_NODETYPE_FILTER_VEX:
ZYDIS_ASSERT(index < 16);
return &filterVEX[parent->value][index];
case ZYDIS_NODETYPE_FILTER_XOP:
ZYDIS_ASSERT(index < 4);
return &filterXOP[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODE:
ZYDIS_ASSERT(index < 3);
return &filterMode[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MANDATORYPREFIX:
ZYDIS_ASSERT(index < 4);
return &filterMandatoryPrefix[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRMMOD:
ZYDIS_ASSERT(index < 2);
return &filterModrmMod[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRMREG:
ZYDIS_ASSERT(index < 8);
return &filterModrmReg[parent->value][index];
case ZYDIS_NODETYPE_FILTER_MODRMRM:
ZYDIS_ASSERT(index < 8);
return &filterModrmRm[parent->value][index];
case ZYDIS_NODETYPE_FILTER_OPERANDSIZE:
ZYDIS_ASSERT(index < 2);
return &filterOperandSize[parent->value][index];
case ZYDIS_NODETYPE_FILTER_ADDRESSSIZE:
ZYDIS_ASSERT(index < 3);
return &filterAddressSize[parent->value][index];
case ZYDIS_NODETYPE_FILTER_REXW:
ZYDIS_ASSERT(index < 2);
return &filterREXW[parent->value][index];
case ZYDIS_NODETYPE_FILTER_VEXL:
ZYDIS_ASSERT(index < 2);
return &filterVEXL[parent->value][index];
case ZYDIS_NODETYPE_FILTER_EVEXL2:
ZYDIS_ASSERT(index < 2);
return &filterEVEXL2[parent->value][index];
case ZYDIS_NODETYPE_FILTER_EVEXB:
ZYDIS_ASSERT(index < 2);
return &filterEVEXB[parent->value][index];
default:
ZYDIS_UNREACHABLE;
}
static const ZydisInstructionTableNode invalid = { ZYDIS_NODETYPE_INVALID, 0x00000000 };
return &invalid;
}
ZydisBool ZydisInstructionTableGetDefinition(const ZydisInstructionTableNode* node,
const ZydisInstructionDefinition** definition, const ZydisOperandDefinition** operands,
uint8_t* operandCount)
{
*definition = &instructionDefinitions[node->value];
switch (node->type)
{
case ZYDIS_NODETYPE_DEFINITION_0OP:
*operandCount = 0;
break;
case ZYDIS_NODETYPE_DEFINITION_1OP:
*operandCount = 1;
*operands = operandDefinitions1[(*definition)->operandsId];
break;
case ZYDIS_NODETYPE_DEFINITION_2OP:
*operandCount = 2;
*operands = operandDefinitions2[(*definition)->operandsId];
break;
case ZYDIS_NODETYPE_DEFINITION_3OP:
*operandCount = 3;
*operands = operandDefinitions3[(*definition)->operandsId];
break;
case ZYDIS_NODETYPE_DEFINITION_4OP:
*operandCount = 4;
*operands = operandDefinitions4[(*definition)->operandsId];
break;
case ZYDIS_NODETYPE_DEFINITION_5OP:
*operandCount = 5;
*operands = operandDefinitions5[(*definition)->operandsId];
break;
default:
ZYDIS_UNREACHABLE;
return ZYDIS_FALSE;
}
return ZYDIS_TRUE;
}
/* ---------------------------------------------------------------------------------------------- */
/* Main instruction-table */
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_INVALID \
{ ZYDIS_NODETYPE_INVALID, 0x00000000 }
#define ZYDIS_FILTER(type, id) \
{ type, id }
#define ZYDIS_DEFINITION_0OP(id) \
{ ZYDIS_NODETYPE_DEFINITION_0OP, id }
#define ZYDIS_DEFINITION_1OP(id) \
{ ZYDIS_NODETYPE_DEFINITION_1OP, id }
#define ZYDIS_DEFINITION_2OP(id) \
{ ZYDIS_NODETYPE_DEFINITION_2OP, id }
#define ZYDIS_DEFINITION_3OP(id) \
{ ZYDIS_NODETYPE_DEFINITION_3OP, id }
#define ZYDIS_DEFINITION_4OP(id) \
{ ZYDIS_NODETYPE_DEFINITION_4OP, id }
#define ZYDIS_DEFINITION_5OP(id) \
{ ZYDIS_NODETYPE_DEFINITION_5OP, id }
#include <Zydis/Internal/InstructionFilters.inc>
#undef ZYDIS_INVALID
#undef ZYDIS_FILTER
#undef ZYDIS_DEFINITION_0OP
#undef ZYDIS_DEFINITION_1OP
#undef ZYDIS_DEFINITION_2OP
#undef ZYDIS_DEFINITION_3OP
#undef ZYDIS_DEFINITION_4OP
#undef ZYDIS_DEFINITION_5OP
/* ---------------------------------------------------------------------------------------------- */
/* Operand definitions */
/* ---------------------------------------------------------------------------------------------- */
#define ZYDIS_OPERAND_DEFINITION(type, encoding, access) \
{ type, encoding, access }
#include <Zydis/Internal/OperandDefinitions.inc>
#undef ZYDIS_OPERAND_DEFINITION
/* ---------------------------------------------------------------------------------------------- */
/* Instruction definitions */
/* ---------------------------------------------------------------------------------------------- */
#include <Zydis/Internal/InstructionDefinitions.inc>
/* ============================================================================================== */

View File

@ -1,12 +1,8 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd
Modifications : Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -28,28 +24,28 @@
***************************************************************************************************/
/**
* @file
* @brief Utility functions.
*/
#include <Zydis/Mnemonic.h>
#ifndef _ZYDIS_UTILS_HPP_
#define _ZYDIS_UTILS_HPP_
/* ============================================================================================== */
/* Mnemonic strings */
/* ============================================================================================== */
#include <stdint.h>
#include "ZydisTypes.hpp"
namespace Zydis
static const char* mnemonicStrings[] =
{
#include <Zydis/Internal/MnemonicStrings.inc>
};
/**
* @brief Calculates the absolute target address of a relative instruction operand.
* @param info The instruction info.
* @param operand The operand.
* @return The absolute target address.
*/
uint64_t CalcAbsoluteTarget(const InstructionInfo& info, const OperandInfo& operand);
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
const char* ZydisMnemonicGetString(ZydisInstructionMnemonic mnemonic)
{
if (mnemonic > (sizeof(mnemonicStrings) / sizeof(mnemonicStrings[0])) - 1)
{
return NULL;
}
return mnemonicStrings[mnemonic];
}
#endif /* _ZYDIS_UTILS_HPP_ */
/* ============================================================================================== */

244
src/Register.c Normal file
View File

@ -0,0 +1,244 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <Zydis/Register.h>
/* ============================================================================================== */
/* Register strings */
/* ============================================================================================== */
const char* registerStrings[] =
{
"none",
// General purpose registers 64-bit
"rax", "rcx", "rdx", "rbx",
"rsp", "rbp", "rsi", "rdi",
"r8", "r9", "r10", "r11",
"r12", "r13", "r14", "r15",
// General purpose registers 32-bit
"eax", "ecx", "edx", "ebx",
"esp", "ebp", "esi", "edi",
"r8d", "r9d", "r10d", "r11d",
"r12d", "r13d", "r14d", "r15d",
// General purpose registers 16-bit
"ax", "cx", "dx", "bx",
"sp", "bp", "si", "di",
"r8w", "r9w", "r10w", "r11w",
"r12w", "r13w", "r14w", "r15w",
// General purpose registers 8-bit
"al", "cl", "dl", "bl",
"ah", "ch", "dh", "bh",
"spl", "bpl", "sil", "dil",
"r8b", "r9b", "r10b", "r11b",
"r12b", "r13b", "r14b", "r15b",
// Floating point legacy registers
"st0", "st1", "st2", "st3",
"st4", "st5", "st6", "st7",
// Floating point multimedia registers
"mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7",
// Floating point vector registers 512-bit
"zmm0", "zmm1", "zmm2", "zmm3",
"zmm4", "zmm5", "zmm6", "zmm7",
"zmm8", "zmm9", "zmm10", "zmm11",
"zmm12", "zmm13", "zmm14", "zmm15",
"zmm16", "zmm17", "zmm18", "zmm19",
"zmm20", "zmm21", "zmm22", "zmm23",
"zmm24", "zmm25", "zmm26", "zmm27",
"zmm28", "zmm29", "zmm30", "zmm31",
// Floating point vector registers 256-bit
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm8", "ymm9", "ymm10", "ymm11",
"ymm12", "ymm13", "ymm14", "ymm15",
"ymm16", "ymm17", "ymm18", "ymm19",
"ymm20", "ymm21", "ymm22", "ymm23",
"ymm24", "ymm25", "ymm26", "ymm27",
"ymm28", "ymm29", "ymm30", "ymm31",
// Floating point vector registers 128-bit
"xmm0", "xmm1", "xmm2", "xmm3",
"xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11",
"xmm12", "xmm13", "xmm14", "xmm15",
"xmm16", "xmm17", "xmm18", "xmm19",
"xmm20", "xmm21", "xmm22", "xmm23",
"xmm24", "xmm25", "xmm26", "xmm27",
"xmm28", "xmm29", "xmm30", "xmm31",
// Special registers
"rflags", "eflags", "flags", "rip",
"eip", "ip", "mxcsr", "pkru",
"xcr0",
// Segment registers
"es", "ss", "cs", "ds",
"fs", "gs",
// Table registers
"gdtr", "ldtr", "idtr", "tr",
// Test registers
"tr0", "tr1", "tr2", "tr3",
"tr4", "tr5", "tr6", "tr7",
// Control registers
"cr0", "cr1", "cr2", "cr3",
"cr4", "cr5", "cr6", "cr7",
"cr8", "cr9", "cr10", "cr11",
"cr12", "cr13", "cr14", "cr15",
// Debug registers
"dr0", "dr1", "dr2", "dr3",
"dr4", "dr5", "dr6", "dr7",
"dr8", "dr9", "dr10", "dr11",
"dr12", "dr13", "dr14", "dr15",
// Mask registers
"k0", "k1", "k2", "k3",
"k4", "k5", "k6", "k7",
// Bounds registers
"bnd0", "bnd1", "bnd2", "bnd3",
"bndcfg", "bndstatus"
};
/* ============================================================================================== */
/* Register-class mapping */
/* ============================================================================================== */
struct ZydisRegisterMapItem
{
ZydisRegisterClass class;
ZydisRegister lo;
ZydisRegister hi;
ZydisRegisterWidth width;
ZydisRegisterWidth width64;
};
static const struct ZydisRegisterMapItem registerMap[] =
{
{ ZYDIS_REGCLASS_INVALID , ZYDIS_REGISTER_NONE , ZYDIS_REGISTER_NONE , 0 , 0 },
{ ZYDIS_REGCLASS_GPR8 , ZYDIS_REGISTER_AL , ZYDIS_REGISTER_R15B , 8 , 8 },
{ ZYDIS_REGCLASS_GPR16 , ZYDIS_REGISTER_AX , ZYDIS_REGISTER_R15W , 16 , 16 },
{ ZYDIS_REGCLASS_GPR32 , ZYDIS_REGISTER_EAX , ZYDIS_REGISTER_R15D , 32 , 32 },
{ ZYDIS_REGCLASS_GPR64 , ZYDIS_REGISTER_RAX , ZYDIS_REGISTER_R15 , 0 , 64 },
{ ZYDIS_REGCLASS_X87 , ZYDIS_REGISTER_ST0 , ZYDIS_REGISTER_ST7 , 80 , 80 },
{ ZYDIS_REGCLASS_MMX , ZYDIS_REGISTER_MM0 , ZYDIS_REGISTER_MM7 , 64 , 64 },
{ ZYDIS_REGCLASS_XMM , ZYDIS_REGISTER_XMM0 , ZYDIS_REGISTER_XMM31 , 128 , 128 },
{ ZYDIS_REGCLASS_YMM , ZYDIS_REGISTER_YMM0 , ZYDIS_REGISTER_YMM31 , 256 , 256 },
{ ZYDIS_REGCLASS_ZMM , ZYDIS_REGISTER_ZMM0 , ZYDIS_REGISTER_ZMM31 , 512 , 512 },
{ ZYDIS_REGCLASS_FLAGS , ZYDIS_REGISTER_RFLAGS , ZYDIS_REGISTER_FLAGS , 0 , 0 },
{ ZYDIS_REGCLASS_IP , ZYDIS_REGISTER_RIP , ZYDIS_REGISTER_IP , 0 , 0 },
{ ZYDIS_REGCLASS_SEGMENT , ZYDIS_REGISTER_ES , ZYDIS_REGISTER_GS , 16 , 16 },
{ ZYDIS_REGCLASS_TEST , ZYDIS_REGISTER_TR0 , ZYDIS_REGISTER_TR7 , 32 , 32 },
{ ZYDIS_REGCLASS_CONTROL , ZYDIS_REGISTER_CR0 , ZYDIS_REGISTER_CR15 , 32 , 64 },
{ ZYDIS_REGCLASS_DEBUG , ZYDIS_REGISTER_DR0 , ZYDIS_REGISTER_DR15 , 32 , 64 },
{ ZYDIS_REGCLASS_MASK , ZYDIS_REGISTER_K0 , ZYDIS_REGISTER_K7 , 64 , 64 },
{ ZYDIS_REGCLASS_BOUND , ZYDIS_REGISTER_BND0 , ZYDIS_REGISTER_BND3 , 128 , 128 }
};
static const uint8_t registerMapCount = sizeof(registerMap) / sizeof(struct ZydisRegisterMapItem);
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
ZydisRegister ZydisRegisterEncode(ZydisRegisterClass registerClass, uint8_t id)
{
switch (registerClass)
{
case ZYDIS_REGCLASS_INVALID:
case ZYDIS_REGCLASS_FLAGS:
case ZYDIS_REGCLASS_IP:
break;
default:
if ((registerClass < registerMapCount) &&
(id <= (registerMap[registerClass].hi - registerMap[registerClass].lo)))
{
return registerMap[registerClass].lo + id;
}
}
return ZYDIS_REGISTER_NONE;
}
int16_t ZydisRegisterGetId(ZydisRegister reg)
{
for (unsigned i = 0; i < registerMapCount; ++i)
{
switch (registerMap[i].class)
{
case ZYDIS_REGCLASS_INVALID:
case ZYDIS_REGCLASS_FLAGS:
case ZYDIS_REGCLASS_IP:
break;
default:
if ((reg >= registerMap[i].lo) && (reg <= registerMap[i].hi))
{
return reg - registerMap[i].lo;
}
}
}
return -1;
}
ZydisRegisterClass ZydisRegisterGetClass(ZydisRegister reg)
{
for (unsigned i = 0; i < registerMapCount; ++i)
{
if ((reg >= registerMap[i].lo) && (reg <= registerMap[i].hi))
{
return registerMap[i].class;
}
}
return ZYDIS_REGCLASS_INVALID;
}
ZydisRegisterWidth ZydisRegisterGetWidth(ZydisRegister reg)
{
for (unsigned i = 0; i < registerMapCount; ++i)
{
if ((reg >= registerMap[i].lo) && (reg <= registerMap[i].hi))
{
return registerMap[i].width;
}
}
return 0;
}
ZydisRegisterWidth ZydisRegisterGetWidth64(ZydisRegister reg)
{
for (unsigned i = 0; i < registerMapCount; ++i)
{
if ((reg >= registerMap[i].lo) && (reg <= registerMap[i].hi))
{
return registerMap[i].width64;
}
}
return 0;
}
const char* ZydisRegisterGetString(ZydisRegister reg)
{
if ((reg == 0) || (reg > (sizeof(registerStrings) / sizeof(registerStrings[0])) - 1))
{
return NULL;
}
return registerStrings[reg];
}
/* ============================================================================================== */

92
src/Utils.c Normal file
View File

@ -0,0 +1,92 @@
/***************************************************************************************************
Zyan Disassembler Library (Zydis)
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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <stdint.h>
#include <Zydis/Utils.h>
/* ============================================================================================== */
/* Operand utils */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Exported functions */
/* ---------------------------------------------------------------------------------------------- */
ZydisStatus ZydisUtilsCalcAbsoluteTargetAddress(const ZydisInstructionInfo* info,
const ZydisOperandInfo* operand, uint64_t* address)
{
if (!info || !operand || !address)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
switch (operand->type)
{
case ZYDIS_OPERAND_TYPE_MEMORY:
if (operand->mem.disp.dataSize == 0)
{
return ZYDIS_STATUS_INVALID_PARAMETER;
}
if (operand->mem.base == ZYDIS_REGISTER_EIP)
{
*address = (uint64_t)((uint32_t)info->instrPointer + operand->mem.disp.value.sdword);
return ZYDIS_STATUS_SUCCESS;
}
if (operand->mem.base == ZYDIS_REGISTER_RIP)
{
*address = (uint64_t)(info->instrPointer + operand->mem.disp.value.sqword);
return ZYDIS_STATUS_SUCCESS;
}
break;
case ZYDIS_OPERAND_TYPE_IMMEDIATE:
if (operand->imm.isSigned && operand->imm.isRelative)
{
*address = (uint64_t)((int64_t)info->instrPointer + operand->imm.value.sqword);
switch (info->mode)
{
case ZYDIS_DISASSEMBLER_MODE_16BIT:
case ZYDIS_DISASSEMBLER_MODE_32BIT:
if (operand->size == 16)
{
*address &= 0xFFFF;
}
break;
case ZYDIS_DISASSEMBLER_MODE_64BIT:
break;
default:
return ZYDIS_STATUS_INVALID_PARAMETER;
}
return ZYDIS_STATUS_SUCCESS;
}
break;
default:
break;
}
return ZYDIS_STATUS_INVALID_PARAMETER;
}
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */

View File

@ -1,12 +1,8 @@
/***************************************************************************************************
Zyan Disassembler Engine
Version 1.0
Remarks : Freeware, Copyright must be included
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd
Modifications : Joel Höner
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -28,46 +24,43 @@
***************************************************************************************************/
#include "ZydisUtils.hpp"
#include <cassert>
#include <Zydis/Zydis.h>
namespace Zydis
{
/* ============================================================================================== */
/* Exported functions */
/* ============================================================================================== */
uint64_t CalcAbsoluteTarget(const InstructionInfo& info, const OperandInfo& operand)
uint64_t ZydisGetVersion()
{
assert((operand.type == OperandType::REL_IMMEDIATE) ||
((operand.type == OperandType::MEMORY) && (operand.base == Register::RIP)));
uint64_t truncMask = 0xFFFFFFFFFFFFFFFFull;
if (!(info.flags & IF_DISASSEMBLER_MODE_64))
{
truncMask >>= (64 - info.operand_mode);
}
uint16_t size = operand.size;
if ((operand.type == OperandType::MEMORY) && (operand.base == Register::RIP))
{
size = operand.offset;
}
switch (size)
{
case 8:
return (info.instrPointer + operand.lval.sbyte) & truncMask;
case 16:
{
uint32_t delta = operand.lval.sword & truncMask;
if ((info.instrPointer + delta) > 0xFFFF)
{
return (info.instrPointer& 0xF0000) + ((info.instrPointer + delta) & 0xFFFF);
}
return info.instrPointer + delta;
}
case 32:
return (info.instrPointer + operand.lval.sdword) & truncMask;
default:
assert(0);
}
return 0;
return ZYDIS_VERSION;
}
}
ZydisBool ZydisIsFeatureEnabled(ZydisFeature feature)
{
switch (feature)
{
case ZYDIS_FEATURE_IMPLICITLY_USED_REGISTERS:
#ifdef ZYDIS_ENABLE_FEATURE_IMPLICITLY_USED_REGISTERS
return ZYDIS_TRUE;
#else
return ZYDIS_FALSE;
#endif
case ZYDIS_FEATURE_AFFECTED_FLAGS:
#ifdef ZYDIS_ENABLE_FEATURE_AFFECTED_FLAGS
return ZYDIS_TRUE;
#else
return ZYDIS_FALSE;
#endif
case ZYDIS_FEATURE_CPUID:
#ifdef ZYDIS_ENABLE_FEATURE_CPUID
return ZYDIS_TRUE;
#else
return ZYDIS_FALSE;
#endif
default:
break;
}
return ZYDIS_FALSE;
}
/* ============================================================================================== */

132
tools/ZydisDisasm.c Normal file
View File

@ -0,0 +1,132 @@
/***************************************************************************************************
Zyan Disassembler Engine (Zydis)
Original Author : Florian Bernd, Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <Zydis/Zydis.h>
/* ============================================================================================== */
/* Entry point */
/* ============================================================================================== */
int main(int argc, char** argv)
{
if (argc < 1 || argc > 2)
{
fprintf(stderr, "Usage: %s [input file]\n", (argc > 0 ? argv[0] : "ZydisDisasm"));
return EXIT_FAILURE;
}
FILE* file = argc >= 2 ? fopen(argv[1], "rb") : stdin;
if (!file)
{
fprintf(stderr, "Can not open file: %s\n", strerror(errno));
return EXIT_FAILURE;
}
ZydisInstructionFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
ZYDIS_FORMATTER_STYLE_INTEL, ZYDIS_FMTFLAG_FORCE_SEGMENTS | ZYDIS_FMTFLAG_FORCE_OPERANDSIZE,
ZYDIS_FORMATTER_ADDR_ABSOLUTE, ZYDIS_FORMATTER_DISP_DEFAULT, ZYDIS_FORMATTER_IMM_DEFAULT)))
{
fputs("Failed to initialized instruction-formatter\n", stderr);
return EXIT_FAILURE;
}
ZydisInstructionDecoder decoder;
if (!ZYDIS_SUCCESS(ZydisDecoderInitInstructionDecoder(&decoder, ZYDIS_DISASSEMBLER_MODE_64BIT)))
{
fputs("Failed to initialize instruction-decoder\n", stderr);
return EXIT_FAILURE;
}
uint8_t readBuf[ZYDIS_MAX_INSTRUCTION_LENGTH * 1024];
size_t numBytesRead;
do
{
numBytesRead = fread(readBuf, 1, sizeof(readBuf), file);
ZydisInstructionInfo info;
ZydisStatus status;
size_t readOffs = 0;
while ((status = ZydisDecoderDecodeInstruction(
&decoder, readBuf + readOffs, numBytesRead - readOffs, readOffs, &info
)) != ZYDIS_STATUS_NO_MORE_DATA)
{
if (!ZYDIS_SUCCESS(status))
{
++readOffs;
printf("db %02X\n", info.data[0]);
continue;
}
char printBuffer[256];
ZydisFormatterFormatInstruction(
&formatter, &info, printBuffer, sizeof(printBuffer)
);
puts(printBuffer);
// TODO: Remove
// DEBUG CODE START
for (size_t i = 0; i < info.length; ++i)
{
printf("%02X ", *(readBuf + readOffs + i));
}
putchar('\n');
uint8_t encBuffer[15];
size_t encBufferSize = sizeof(encBuffer);
ZydisStatus encStatus = ZydisEncoderEncodeInstruction(
encBuffer, &encBufferSize, &info
);
(void)encStatus;
ZYDIS_ASSERT(ZYDIS_SUCCESS(encStatus));
for (size_t i = 0; i < encBufferSize; ++i)
{
printf("%02X ", encBuffer[i]);
}
putchar('\n');
ZYDIS_ASSERT(encBufferSize == info.length);
ZYDIS_ASSERT(!memcmp(encBuffer, readBuf + readOffs, encBufferSize));
// DEBUG CODE END
readOffs += info.length;
}
if (readOffs < sizeof(readBuf))
{
memmove(readBuf, readBuf + readOffs, sizeof(readBuf) - readOffs);
}
} while (numBytesRead == sizeof(readBuf));
return 0;
}
/* ============================================================================================== */

114
tools/ZydisFuzzIn.c Normal file
View File

@ -0,0 +1,114 @@
/***************************************************************************************************
Zyan Disassembler Engine (Zydis)
Original Author : Joel Höner
* 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 the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* 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", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* 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 CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
***************************************************************************************************/
/**
* @file
*
* This file implements a tool that is supposed to be fed as input for fuzzers like AFL,
* reading a control block from stdin, allowing the fuzzer to reach every possible
* code-path, testing any possible combination of disassembler configurations.
*/
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <Zydis/Zydis.h>
typedef struct ZydisFuzzControlBlock_ {
ZydisDisassemblerMode disasMode;
ZydisFormatterStyle formatterStyle;
ZydisFormatterFlags formatterFlags;
ZydisFormatterAddressFormat formatterAddrFormat;
ZydisFormatterDisplacementFormat formatterDispFormat;
ZydisFormatterImmediateFormat formatterImmFormat;
} ZydisFuzzControlBlock;
/* ============================================================================================== */
/* Entry point */
/* ============================================================================================== */
int main()
{
ZydisFuzzControlBlock controlBlock;
if (fread(&controlBlock, 1, sizeof(controlBlock), stdin) != sizeof(controlBlock))
{
fputs("not enough bytes to fuzz\n", stderr);
return EXIT_FAILURE;
}
ZydisInstructionFormatter formatter;
if (!ZYDIS_SUCCESS(ZydisFormatterInitInstructionFormatterEx(&formatter,
controlBlock.formatterStyle, controlBlock.formatterFlags, controlBlock.formatterAddrFormat,
controlBlock.formatterDispFormat, controlBlock.formatterImmFormat)))
{
fputs("failed to initialize instruction-formatter\n", stderr);
return EXIT_FAILURE;
}
ZydisInstructionDecoder decoder;
if (!ZYDIS_SUCCESS(ZydisDecoderInitInstructionDecoder(&decoder, controlBlock.disasMode)))
{
fputs("Failed to initialize instruction-decoder\n", stderr);
return EXIT_FAILURE;
}
uint8_t readBuf[ZYDIS_MAX_INSTRUCTION_LENGTH * 1024];
size_t numBytesRead;
do
{
numBytesRead = fread(readBuf, 1, sizeof(readBuf), stdin);
ZydisInstructionInfo info;
ZydisStatus status;
size_t readOffs = 0;
while ((status = ZydisDecoderDecodeInstruction(
&decoder, readBuf + readOffs, numBytesRead - readOffs, readOffs, &info
)) != ZYDIS_STATUS_NO_MORE_DATA)
{
if (!ZYDIS_SUCCESS(status))
{
++readOffs;
continue;
}
char printBuffer[256];
ZydisFormatterFormatInstruction(&formatter, &info, printBuffer, sizeof(printBuffer));
readOffs += info.length;
}
if (readOffs < sizeof(readBuf))
{
memmove(readBuf, readBuf + readOffs, sizeof(readBuf) - readOffs);
}
} while (numBytesRead == sizeof(readBuf));
return 0;
}
/* ============================================================================================== */