diff --git a/.gitignore b/.gitignore index 8a257f9..b72b9f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,9 @@ - -# Created by https://www.gitignore.io/api/delphi,freepascal - -### Delphi ### -# 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 -# -# C++ object files produced when C/C++ Output file generation is configured. -# Uncomment this if you are not using external objects (zlib library for example). -#*.obj -# +*.dSYM # Delphi compiler-generated binaries (safe to delete) -*.exe -*.dll *.bpl *.bpi *.dcp -*.so *.apk *.drc *.map @@ -45,9 +12,12 @@ *.tds *.dcu *.lib -*.a *.o *.ocx +*.zip +*.exe +*.dbg +*.res # Delphi autogenerated files (duplicated info) *.cfg @@ -61,25 +31,18 @@ *.tvsconfig *.dsk -# Delphi history and backups +# Delphi history , Build and backups +lib +backup __history/ __recovery/ *.~* # Castalia statistics file (since XE7 Castalia is distributed with Delphi) *.stat +*.bak -### FreePascal ### -*.lps -*.compiled -*.[oa] -*.ppu -*.rst -*.cgi -*.log -*.bak* -fp.ini -fp.cfg -fp.dsk - -# End of https://www.gitignore.io/api/delphi,freepascal \ No newline at end of file +# Linux binraies +Examples/EncodeFromScratch +Examples/disassemblesimple +Examples/Disassembler diff --git a/Examples/CustomFormatter.dpr b/Examples/CustomFormatter.dpr deleted file mode 100644 index 9396ac2..0000000 --- a/Examples/CustomFormatter.dpr +++ /dev/null @@ -1,238 +0,0 @@ -{*************************************************************************************************** - - 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. - -***************************************************************************************************} - -program CustomFormatter; - -{$APPTYPE CONSOLE} - -{$R *.res} - -uses - Zydis in '..\Zydis\Zydis.pas', - Zydis.Exception in '..\Zydis\Zydis.Exception.pas', - Zydis.Decoder in '..\Zydis\Zydis.Decoder.pas', - Zydis.Formatter in '..\Zydis\Zydis.Formatter.pas', - {$IFNDEF FPC}System.SysUtils{$ELSE}SysUtils{$ENDIF}; - -{* ============================================================================================== *} -{* Formatter *} -{* ============================================================================================== *} - -type - TZydisCustomFormatter = class(Zydis.Formatter.TZydisFormatter) - strict private - FRewriteMnemonics: Boolean; - FOmitImmediate: Boolean; - strict protected - function DoFormatOperandImm(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; override; - function DoPrintMnemonic(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; override; - public - property RewriteMnemonics: Boolean read FRewriteMnemonics write FRewriteMnemonics; - end; - -{ TZydisCustomFormatter } - -function TZydisCustomFormatter.DoFormatOperandImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - // The @c DoPrintMnemonic sinals us to omit the immediate (condition-code) operand - if (FOmitImmediate) then - begin - Exit(ZYDIS_STATUS_SKIP_OPERAND); - end; - - // Default immediate formatting - Result := inherited; -end; - -function TZydisCustomFormatter.DoPrintMnemonic(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; -const - ConditionCodeStrings: array[0..31] of AnsiString = ( - {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' - ); -var - ConditionCode: UInt8; -begin - if (not FRewriteMnemonics) then - begin - Exit(inherited); - end; - - // We use a custom field to pass data to the @c DoFormatOperandImm callback - FOmitImmediate := true; - - // Rewrite the instruction-mnemonic for the given instructions - if (Instruction.Operands[Instruction.OperandCount - 1].&Type = ZYDIS_OPERAND_TYPE_IMMEDIATE) then - begin - ConditionCode := Instruction.Operands[Instruction.OperandCount - 1].Imm.Value.u; - case Instruction.Mnemonic of - ZYDIS_MNEMONIC_CMPPS: - if (ConditionCode < $08) then - begin - Str.Append(PAnsiChar(AnsiString( - Format('cmp%sps', [ConditionCodeStrings[ConditionCode]])))); - Exit(ZYDIS_STATUS_SUCCESS); - end; - ZYDIS_MNEMONIC_CMPPD: - if (ConditionCode < $08) then - begin - Str.Append(PAnsiChar(AnsiString( - Format('cmp%spd', [ConditionCodeStrings[ConditionCode]])))); - Exit(ZYDIS_STATUS_SUCCESS); - end; - ZYDIS_MNEMONIC_VCMPPS: - if (ConditionCode < $20) then - begin - Str.Append(PAnsiChar(AnsiString( - Format('vcmp%sps', [ConditionCodeStrings[ConditionCode]])))); - Exit(ZYDIS_STATUS_SUCCESS); - end; - ZYDIS_MNEMONIC_VCMPPD: - if (ConditionCode < $20) then - begin - Str.Append(PAnsiChar(AnsiString( - Format('vcmp%spd', [ConditionCodeStrings[ConditionCode]])))); - Exit(ZYDIS_STATUS_SUCCESS); - end; - end; - end; - - // We did not rewrite the instruction-mnemonic. Signal the @c DoFormatOperandImm callback not to - // omit the operand - FOmitImmediate := false; - - // Default mnemonic printing - Result := inherited; -end; - -{* ============================================================================================== *} -{* Entry point *} -{* ============================================================================================== *} - -const - X86DATA: array[0..17] of Byte = - ( - // cmpps xmm1, xmm4, 0x03 - $0F, $C2, $CC, $03, - // vcmppd xmm1, xmm2, xmm3, 0x17 - $C5, $E9, $C2, $CB, $17, - // vcmpps k2 {k7}, zmm2, dword ptr ds:[rax + rbx*4 + 0x100] {1to16}, 0x0F - $62, $F1, $6C, $5F, $C2, $54, $98, $40, $0F - ); - -var - Formatter: TZydisCustomFormatter; - Decoder: Zydis.Decoder.TZydisDecoder; - InstructionPointer: ZydisU64; - Offset: Integer; - Instruction: TZydisDecodedInstruction; -begin - try - if (ZydisGetVersion <> ZYDIS_VERSION) then - begin - raise Exception.Create('Invalid Zydis version'); - end; - - Formatter := TZydisCustomFormatter.Create(ZYDIS_FORMATTER_STYLE_INTEL); - try - Formatter.ForceMemorySegments := true; - Formatter.ForceMemorySize := true; - Decoder := - Zydis.Decoder.TZydisDecoder.Create(ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64); - try - InstructionPointer := $007FFFFFFF400000; - Offset := 0; - repeat - Decoder.DecodeBuffer(@X86DATA[Offset], Length(X86DATA) - Offset, InstructionPointer, - Instruction); - WriteLn(Format('%.16x %s', - [InstructionPointer, Formatter.FormatInstruction(Instruction)])); - Inc(InstructionPointer, Instruction.Length); - Inc(Offset, Instruction.Length); - until (Offset >= Length(X86DATA)); - - WriteLn; - Formatter.RewriteMnemonics := true; - - InstructionPointer := $007FFFFFFF400000; - Offset := 0; - repeat - Decoder.DecodeBuffer(@X86DATA[Offset], Length(X86DATA) - Offset, InstructionPointer, - Instruction); - WriteLn(Format('%.16x %s', - [InstructionPointer, Formatter.FormatInstruction(Instruction)])); - Inc(InstructionPointer, Instruction.Length); - Inc(Offset, Instruction.Length); - until (Offset >= Length(X86DATA)); - finally - Decoder.Free; - end; - finally - Formatter.Free; - end; - - except - on E: Exception do - Writeln(E.ClassName, ': ', E.Message); - end; -end. - diff --git a/Examples/DisassembleSimple.dpr b/Examples/DisassembleSimple.dpr new file mode 100644 index 0000000..61800ad --- /dev/null +++ b/Examples/DisassembleSimple.dpr @@ -0,0 +1,46 @@ +{ + Zydis DisassembleSimple Example By Coldzer0 +} +program DisassembleSimple; + +{$IFDEF FPC} + {$mode Delphi}{$H+}{$J-} +{$ENDIF} +{$IfDef MSWINDOWS} + {$APPTYPE CONSOLE} +{$EndIf} + +uses + SysUtils, + Zydis.Apis, + Zydis.Enums, + Zydis.Types, + Zydis.Status, + Zydis.Disassembler.Types; + +var + offset : ZyanUSize; + runtime_address: ZyanU64; + instruction : TZydisDisassembledInstruction; + Data: array[0..24] of ZyanU8 = ($51, $8D, $45, $FF, $50, $FF, + $75, $0C, $FF, $75, $08, $FF, $15, $A0, $A5, $48, $76, $85, $C0, + $0F, $88, $FC, $DA, $02, $00); + +{$R *.res} + +begin + offset := 0; + runtime_address := $007FFFFFFF400000; + + Initialize(instruction); + // Loop over the instructions in our buffer. + while ZYAN_SUCCESS(ZydisDisassembleIntel(ZYDIS_MACHINE_MODE_LONG_64, + runtime_address, @data[offset], SizeOf(data) - offset, instruction)) do + begin + WriteLn(Format('%.16X %s', [runtime_address, UTF8ToString(instruction.text)])); + inc(offset, instruction.info.length); + inc(runtime_address, instruction.info.length); + end; + + ReadLn; +end. diff --git a/Examples/CustomFormatter.dproj b/Examples/DisassembleSimple.dproj similarity index 54% rename from Examples/CustomFormatter.dproj rename to Examples/DisassembleSimple.dproj index 718c6e4..e63f4b6 100644 --- a/Examples/CustomFormatter.dproj +++ b/Examples/DisassembleSimple.dproj @@ -1,14 +1,14 @@  - {2F0CE0AE-FA5B-40AF-A42A-F03C996A119D} - 18.3 - None - CustomFormatter.dpr + {D0BB7181-2249-4028-91E3-696B63373B34} + DisassembleSimple.dpr True - Debug - Win64 + Release 3 Console + None + 19.5 + Win64 true @@ -23,18 +23,12 @@ Base true - + true Base true - - true - Cfg_1 - true - true - - + true Base true @@ -46,79 +40,92 @@ true - .\$(Platform)\$(Config) - .\$(Platform)\$(Config) false - false - false false false - CustomFormatter + false + false + 00400000 + DisassembleSimple + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) Debug - CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= - 1033 - true - $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png - $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png - Zydis.ico - (Ohne) + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + DisassembleSimple_Icon.ico + ../Zydis;../libs/Delphi;$(DCC_UnitSearchPath) + (None) + none - true - $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png - $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + DisassembleSimple_Icon.ico + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) Debug CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= - 1033 - Zydis.ico - (Ohne) + ../Zydis;../libs/Delphi;$(DCC_UnitSearchPath) + (None) + none + RELEASE;$(DCC_Define) + 0 + false + 0 + + DEBUG;$(DCC_Define) - true false true - true - true - - - false - 1033 - (Ohne) - - - false - RELEASE;$(DCC_Define) - 0 - 0 + true + true - 1033 - (Ohne) + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + DisassembleSimple_Icon.ico + (None) + none MainSource - - - - - - Cfg_2 - Base - Base - + Cfg_1 Base + + Cfg_2 + Base + + + Delphi.Personality.12 + + + + + DisassembleSimple.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + True + True + + + 12 + - diff --git a/Examples/CustomFormatter.res b/Examples/DisassembleSimple_Icon.ico similarity index 88% rename from Examples/CustomFormatter.res rename to Examples/DisassembleSimple_Icon.ico index 57de833..ec4a50b 100644 Binary files a/Examples/CustomFormatter.res and b/Examples/DisassembleSimple_Icon.ico differ diff --git a/Examples/Disassembler.dpr b/Examples/Disassembler.dpr new file mode 100644 index 0000000..5a4a8dc --- /dev/null +++ b/Examples/Disassembler.dpr @@ -0,0 +1,73 @@ +{ + Zydis Disassembler Example By Coldzer0 +} +program Disassembler; + +{$IFDEF FPC} + {$mode Delphi} + {$PackRecords C} +{$ENDIF} +{$IfDef MSWINDOWS} + {$APPTYPE CONSOLE} +{$EndIf} + +uses + SysUtils, + Zydis.Apis, + Zydis.Enums, + Zydis.Types, + Zydis.Status, + Zydis.Decoder.Types, + Zydis.Formatter.Types, + Zydis.Disassembler.Types; + +var + offset : ZyanUSize = 0; + runtime_address: ZyanU64 = $007FFFFFFF400000; + + decoder : TZydisDecoder; + Formatter : TZydisFormatter; + instruction : TZydisDecodedInstruction; + + operands : Array [0..ZYDIS_MAX_OPERAND_COUNT -1] of TZydisDecodedOperand; + + length : ZyanUSize; + + buffer: array[0..255] of AnsiChar; + + Data: array[0..24] of ZyanU8 = ($51, $8D, $45, $FF, $50, $FF, + $75, $0C, $FF, $75, $08, $FF, $15, $A0, $A5, $48, $76, $85, $C0, + $0F, $88, $FC, $DA, $02, $00); + +begin + ZydisDecoderInit(@decoder, ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_STACK_WIDTH_64); + ZydisFormatterInit(@formatter, ZYDIS_FORMATTER_STYLE_INTEL); + + Initialize(operands); + Initialize(instruction); + Initialize(buffer); + + length := sizeof(data); + while ZYAN_SUCCESS(ZydisDecoderDecodeFull(@decoder, @data[offset], length - offset, + instruction, operands)) do + begin + // Print current instruction pointer. + Write(Format('%.16X ', [runtime_address])); + + // Format & print the binary instruction structure to human-readable format + ZydisFormatterFormatInstruction(@formatter, @instruction, @operands, + instruction.operand_count_visible, buffer, SizeOf(buffer), runtime_address, nil); + + WriteLn(buffer); + + Inc(offset, instruction.length); + inc(runtime_address, instruction.length); + end; + + ReadLn; +end. + + + + + diff --git a/Examples/Disassembler.dproj b/Examples/Disassembler.dproj new file mode 100644 index 0000000..f7d7469 --- /dev/null +++ b/Examples/Disassembler.dproj @@ -0,0 +1,145 @@ + + + {69150B59-A479-4C6F-B265-6BCBE8EA7F3B} + Disassembler.dpr + True + Release + 3 + Console + None + 19.5 + Win64 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + false + false + false + false + false + 00400000 + Disassembler + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + $(BDS)\bin\delphi_PROJECTICON.ico + $(BDS)\bin\delphi_PROJECTICNS.icns + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + ../Zydis;../libs/Delphi;$(DCC_UnitSearchPath) + (None) + none + + + RELEASE;$(DCC_Define) + 0 + false + 0 + + + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + DEBUG;$(DCC_Define) + false + true + true + true + + + ../Zydis;$(DCC_UnitSearchPath) + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + (None) + none + + + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + + + + Delphi.Personality.12 + + + + + Disassembler.dpr + + + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + True + True + + + 12 + + + + diff --git a/Examples/Disassembler.lpi b/Examples/Disassembler.lpi new file mode 100644 index 0000000..307a597 --- /dev/null +++ b/Examples/Disassembler.lpi @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes> + <Item Name="Default" Default="True"/> + <Item Name="Windows_Debug64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="Disassembler"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\windows\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + <IncludeAssertionCode Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + <VerifyObjMethodCallValidity Value="True"/> + <TargetCPU Value="x86_64"/> + <TargetOS Value="win64"/> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + <UseHeaptrc Value="True"/> + <TrashVariables Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Windows_Release64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="Disassembler"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\windows\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <TargetCPU Value="x86_64"/> + <TargetOS Value="win64"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + </Debugging> + <LinkSmart Value="True"/> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Linux_Release64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="Disassembler"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\linux\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <Checks> + <StackChecks Value="True"/> + </Checks> + <TargetCPU Value="x86_64"/> + <TargetOS Value="linux"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + </Debugging> + <LinkSmart Value="True"/> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Linux_Debug64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="Disassembler"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\linux\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <TargetCPU Value="x86_64"/> + <TargetOS Value="linux"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf2"/> + <UseHeaptrc Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units> + <Unit> + <Filename Value="Disassembler.dpr"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Formatter.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.string.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="Zycore.strings"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Vector.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Allocator.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.FormatterBuffer.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="test.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="Disassembler"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + </SyntaxOptions> + </Parsing> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions> + <Item> + <Name Value="EAbort"/> + </Item> + <Item> + <Name Value="ECodetoolError"/> + </Item> + <Item> + <Name Value="EFOpenError"/> + </Item> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/Examples/Disassembler.lps b/Examples/Disassembler.lps new file mode 100644 index 0000000..7ca5ecc --- /dev/null +++ b/Examples/Disassembler.lps @@ -0,0 +1,295 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <PathDelim Value="\"/> + <Version Value="12"/> + <BuildModes Active="Windows_Release64"/> + <Units> + <Unit> + <Filename Value="Disassembler.dpr"/> + <IsPartOfProject Value="True"/> + <TopLine Value="10"/> + <CursorPos X="37" Y="16"/> + <UsageCount Value="54"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Formatter.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="21" Y="13"/> + <UsageCount Value="56"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.string.pas"/> + <IsPartOfProject Value="True"/> + <UnitName Value="Zycore.strings"/> + <EditorIndex Value="-1"/> + <CursorPos X="13" Y="6"/> + <UsageCount Value="56"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Vector.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="9" Y="6"/> + <UsageCount Value="56"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Allocator.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="15" Y="13"/> + <UsageCount Value="55"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.FormatterBuffer.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos Y="15"/> + <UsageCount Value="55"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="test.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <UsageCount Value="53"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.pas"/> + <EditorIndex Value="-1"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Generated\zydis_enums.inc"/> + <EditorIndex Value="2"/> + <TopLine Value="3130"/> + <CursorPos X="5" Y="3144"/> + <UsageCount Value="11"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.pas"/> + <UnitName Value="Zydis.api"/> + <EditorIndex Value="-1"/> + <TopLine Value="19"/> + <CursorPos X="14" Y="25"/> + <UsageCount Value="7"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <IsVisibleTab Value="True"/> + <EditorIndex Value="4"/> + <TopLine Value="246"/> + <CursorPos X="54" Y="264"/> + <UsageCount Value="28"/> + <Loaded Value="True"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Strings.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="15" Y="11"/> + <UsageCount Value="8"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Types.pas"/> + <EditorIndex Value="3"/> + <TopLine Value="22"/> + <UsageCount Value="26"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Enums.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="9"/> + <UsageCount Value="8"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.Types.pas"/> + <EditorIndex Value="5"/> + <TopLine Value="400"/> + <CursorPos X="7" Y="408"/> + <UsageCount Value="25"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Disassembler.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="14"/> + <CursorPos Y="24"/> + <UsageCount Value="7"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Disassembler.Types.pas"/> + <EditorIndex Value="-1"/> + <UsageCount Value="7"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Formatter.Types.pas"/> + <EditorIndex Value="1"/> + <TopLine Value="168"/> + <CursorPos X="26" Y="187"/> + <UsageCount Value="11"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Status.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="34"/> + <CursorPos X="12" Y="48"/> + <UsageCount Value="8"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\win\sysosh.inc"/> + <EditorIndex Value="-1"/> + <CursorPos Y="18"/> + <UsageCount Value="7"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\inc\systemh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="501"/> + <CursorPos Y="531"/> + <UsageCount Value="7"/> + </Unit> + </Units> + <JumpHistory HistoryIndex="28"> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="58" Column="50" TopLine="41"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="40" Column="25" TopLine="31"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="50" Column="33" TopLine="40"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="196" Column="63" TopLine="181"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="197" Column="36" TopLine="181"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="51" Column="24" TopLine="36"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="50" Column="87" TopLine="36"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="47" Column="90" TopLine="39"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="49" Column="36" TopLine="39"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="201" Column="18" TopLine="184"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="51" Column="22" TopLine="36"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="52" Column="22" TopLine="36"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="47" Column="38" TopLine="36"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="45" Column="75" TopLine="31"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="342" Column="17" TopLine="328"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="44" Column="24" TopLine="44"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="34" Column="76" TopLine="20"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="199" Column="8" TopLine="183"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="56" Column="8" TopLine="42"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="196" Column="40" TopLine="183"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="55" Column="30" TopLine="42"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="60" Column="41" TopLine="49"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="10" Column="17"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Formatter.Types.pas"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Formatter.Types.pas"/> + <Caret Line="191" Column="57" TopLine="168"/> + </Position> + <Position> + <Filename Value="Disassembler.dpr"/> + <Caret Line="16" Column="37" TopLine="10"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <Caret Line="230" Column="12" TopLine="216"/> + </Position> + <Position> + <Filename Value="..\Zydis\Zydis.Decoder.Types.pas"/> + <Caret Line="408" Column="7" TopLine="400"/> + </Position> + </JumpHistory> + <RunParams> + <FormatVersion Value="2"/> + <Modes ActiveMode=""/> + </RunParams> + <HistoryLists> + <List Name="LaunchingApplication" Type="File" Count="1"> + <Item1 Value="C:\Windows\system32\cmd.exe /C ${TargetCmdLine}"/> + </List> + </HistoryLists> + </ProjectSession> +</CONFIG> diff --git a/Examples/EncodeFromScratch.dpr b/Examples/EncodeFromScratch.dpr new file mode 100644 index 0000000..8a36d4f --- /dev/null +++ b/Examples/EncodeFromScratch.dpr @@ -0,0 +1,130 @@ +program EncodeFromScratch; + +{$IfDef MSWINDOWS} + {$APPTYPE CONSOLE} +{$EndIf} + + +uses + {$IfDef UNIX} + BaseUnix, + {$Else} + Windows, + {$EndIf} + SysUtils, + Zydis.Apis, + Zydis.Enums, + Zydis.Types, + Zydis.Status, + Zydis.Encoder.Types; + +const + EXIT_FAILURE = 1; + + procedure ExpectSuccess(status: ZyanStatus); + begin + if ZYAN_FAILED(status) then + begin + WriteLn('Something failed: 0x', IntToHex(status, 8)); + Halt(EXIT_FAILURE); + end; + end; + + procedure AppendInstruction(req: PZydisEncoderRequest; var buffer: PZyanU8; + var buffer_length: ZyanUSize); + var + instr_length: ZyanUSize; + begin + instr_length := buffer_length; + ExpectSuccess(ZydisEncoderEncodeInstruction(req, buffer, @instr_length)); + Inc(buffer, instr_length); + Dec(buffer_length, instr_length); + end; + + function AssembleCode(buffer: PZyanU8; buffer_length: ZyanUSize): ZyanUSize; + var + write_ptr: PZyanU8; + remaining_length: ZyanUSize; + req: TZydisEncoderRequest; + begin + write_ptr := buffer; + remaining_length := buffer_length; + + // Assemble `mov rax, $1337`. + FillChar(req, SizeOf(TZydisEncoderRequest), 0); + + req.mnemonic := ZYDIS_MNEMONIC_MOV; + req.machine_mode := ZYDIS_MACHINE_MODE_LONG_64; + req.operand_count := 2; + req.operands[0].type_ := ZYDIS_OPERAND_TYPE_REGISTER; + req.operands[0].reg.Value := ZYDIS_REGISTER_RAX; + req.operands[1].type_ := ZYDIS_OPERAND_TYPE_IMMEDIATE; + req.operands[1].imm.u := $1337; + AppendInstruction(@req, write_ptr, remaining_length); + + // Assemble `ret`. + FillChar(req, SizeOf(TZydisEncoderRequest), 0); + req.mnemonic := ZYDIS_MNEMONIC_RET; + req.machine_mode := ZYDIS_MACHINE_MODE_LONG_64; + AppendInstruction(@req, write_ptr, remaining_length); + + Result := buffer_length - remaining_length; + end; + +type + TRetFunc = function: ZyanU64; + +var + page_size, alloc_size: ZyanUSize; + buffer, aligned: PZyanU8; + length: ZyanUSize; + func_ptr: TRetFunc; + Result: ZyanU64; + {$IfDef MSWINDOWS}OldProtection: DWORD;{$EndIf} + i: integer; +begin + // Allocate 2 pages of memory. We won't need nearly as much, but it simplifies + // re-protecting the memory to RWX later. + page_size := $1000; + alloc_size := page_size * 2; + buffer := AllocMem(alloc_size); + + // Assemble our function. + length := AssembleCode(buffer, alloc_size); + + // Print a hex-dump of the assembled code. + WriteLn('Created byte-code:'); + for i := 0 to length - 1 do + Write(Format('%.2X ', [TBytes(buffer)[i]])); + WriteLn; + + // Align pointer to typical page size. + aligned := PZyanU8(NativeUInt(buffer) and not (page_size - 1)); + + { Only Enable for Dynamic linked Zydis library cuz it needs libc } + //ExpectSuccess(ZyanMemoryVirtualProtect(aligned, alloc_size, ZYAN_PAGE_EXECUTE_READWRITE)); + + { + On 32bit the code will be + dec eax + mov eax,1337 + ret + } + + // Re-protect the heap region as RWX. Don't do this at home, kids! + {$IfDef UNIX} + if Fpmprotect(aligned, alloc_size, PROT_EXEC or PROT_READ or PROT_WRITE) = 0 then + {$ELSE} + if VirtualProtect(aligned, alloc_size, PAGE_EXECUTE_READWRITE, OldProtection) then + {$EndIf} + begin + // Create a function pointer for our buffer. + func_ptr := TRetFunc(buffer); + + // Call the function! + result := func_ptr(); + WriteLn('Return value of JITed code: 0x', IntToHex(result, 16)); + end; + Freemem(buffer); + ReadLn; +end. diff --git a/Examples/SimpleDemo.dproj b/Examples/EncodeFromScratch.dproj similarity index 51% rename from Examples/SimpleDemo.dproj rename to Examples/EncodeFromScratch.dproj index c946cd6..a5815ec 100644 --- a/Examples/SimpleDemo.dproj +++ b/Examples/EncodeFromScratch.dproj @@ -1,14 +1,14 @@ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> - <ProjectGuid>{B67489E9-839F-402C-93DB-B014EBB1B4B4}</ProjectGuid> - <ProjectVersion>18.3</ProjectVersion> - <FrameworkType>None</FrameworkType> - <MainSource>SimpleDemo.dpr</MainSource> + <ProjectGuid>{C9CE9C1A-61A1-4BAC-AB7B-679CA31182FD}</ProjectGuid> + <MainSource>EncodeFromScratch.dpr</MainSource> <Base>True</Base> - <Config Condition="'$(Config)'==''">Debug</Config> - <Platform Condition="'$(Platform)'==''">Win64</Platform> + <Config Condition="'$(Config)'==''">Release</Config> <TargetedPlatforms>3</TargetedPlatforms> <AppType>Console</AppType> + <FrameworkType>None</FrameworkType> + <ProjectVersion>19.5</ProjectVersion> + <Platform Condition="'$(Platform)'==''">Win32</Platform> </PropertyGroup> <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''"> <Base>true</Base> @@ -23,7 +23,7 @@ <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> - <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''"> + <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''"> <Cfg_1>true</Cfg_1> <CfgParent>Base</CfgParent> <Base>true</Base> @@ -34,91 +34,106 @@ <Cfg_1>true</Cfg_1> <Base>true</Base> </PropertyGroup> - <PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''"> - <Cfg_2>true</Cfg_2> - <CfgParent>Base</CfgParent> + <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="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''"> - <Cfg_2_Win64>true</Cfg_2_Win64> - <CfgParent>Cfg_2</CfgParent> + <PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''"> <Cfg_2>true</Cfg_2> + <CfgParent>Base</CfgParent> <Base>true</Base> </PropertyGroup> <PropertyGroup Condition="'$(Base)'!=''"> - <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> - <SanitizedProjectName>SimpleDemo</SanitizedProjectName> + <DCC_N>false</DCC_N> + <DCC_S>false</DCC_S> + <DCC_ImageBase>00400000</DCC_ImageBase> + <SanitizedProjectName>EncodeFromScratch</SanitizedProjectName> + <VerInfo_Locale>1033</VerInfo_Locale> + <VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys> + <DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace)</DCC_Namespace> + <Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon> + <Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns> </PropertyGroup> <PropertyGroup Condition="'$(Base_Win32)'!=''"> + <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace> <BT_BuildType>Debug</BT_BuildType> - <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> - <VerInfo_Locale>1033</VerInfo_Locale> - <DCC_ConsoleTarget>true</DCC_ConsoleTarget> - <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44> - <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150> - <Icon_MainIcon>Zydis.ico</Icon_MainIcon> - <Manifest_File>(Ohne)</Manifest_File> + <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys> + <DCC_UnitSearchPath>../Zydis;../libs/Delphi;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> + <Manifest_File>(None)</Manifest_File> + <AppDPIAwarenessMode>none</AppDPIAwarenessMode> </PropertyGroup> <PropertyGroup Condition="'$(Base_Win64)'!=''"> - <DCC_ConsoleTarget>true</DCC_ConsoleTarget> - <UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44> - <UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150> + <DCC_Namespace>System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace> <BT_BuildType>Debug</BT_BuildType> <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> - <VerInfo_Locale>1033</VerInfo_Locale> - <Manifest_File>(Ohne)</Manifest_File> - <Icon_MainIcon>Zydis.ico</Icon_MainIcon> + <DCC_UnitSearchPath>../Zydis;../libs/Delphi;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> + <Manifest_File>(None)</Manifest_File> + <AppDPIAwarenessMode>none</AppDPIAwarenessMode> </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> + <DCC_Define>RELEASE;$(DCC_Define)</DCC_Define> + <DCC_DebugInformation>0</DCC_DebugInformation> + <DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols> + <DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo> </PropertyGroup> <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''"> - <DCC_RemoteDebug>false</DCC_RemoteDebug> - <VerInfo_Locale>1033</VerInfo_Locale> - <Manifest_File>(Ohne)</Manifest_File> + <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys> + <Manifest_File>(None)</Manifest_File> + <AppDPIAwarenessMode>none</AppDPIAwarenessMode> </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 Condition="'$(Cfg_1_Win64)'!=''"> + <VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys> + <Manifest_File>(None)</Manifest_File> + <AppDPIAwarenessMode>none</AppDPIAwarenessMode> </PropertyGroup> - <PropertyGroup Condition="'$(Cfg_2_Win64)'!=''"> - <VerInfo_Locale>1033</VerInfo_Locale> - <Manifest_File>(Ohne)</Manifest_File> + <PropertyGroup Condition="'$(Cfg_2)'!=''"> + <DCC_Define>DEBUG;$(DCC_Define)</DCC_Define> + <DCC_Optimize>false</DCC_Optimize> + <DCC_GenerateStackFrames>true</DCC_GenerateStackFrames> + <DCC_RangeChecking>true</DCC_RangeChecking> + <DCC_IntegerOverflowCheck>true</DCC_IntegerOverflowCheck> </PropertyGroup> <ItemGroup> <DelphiCompile Include="$(MainSource)"> <MainSource>MainSource</MainSource> </DelphiCompile> - <DCCReference Include="..\Zydis\Zydis.pas"/> - <DCCReference Include="..\Zydis\Zydis.Exception.pas"/> - <DCCReference Include="..\Zydis\Zydis.Decoder.pas"/> - <DCCReference Include="..\Zydis\Zydis.Formatter.pas"/> - <BuildConfiguration Include="Release"> - <Key>Cfg_2</Key> - <CfgParent>Base</CfgParent> - </BuildConfiguration> <BuildConfiguration Include="Base"> <Key>Base</Key> </BuildConfiguration> - <BuildConfiguration Include="Debug"> + <BuildConfiguration Include="Release"> <Key>Cfg_1</Key> <CfgParent>Base</CfgParent> </BuildConfiguration> + <BuildConfiguration Include="Debug"> + <Key>Cfg_2</Key> + <CfgParent>Base</CfgParent> + </BuildConfiguration> </ItemGroup> + <ProjectExtensions> + <Borland.Personality>Delphi.Personality.12</Borland.Personality> + <Borland.ProjectType/> + <BorlandProject> + <Delphi.Personality> + <Source> + <Source Name="MainSource">EncodeFromScratch.dpr</Source> + </Source> + <Excluded_Packages> + <Excluded_Packages Name="$(BDSBIN)\dcloffice2k280.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages> + <Excluded_Packages Name="$(BDSBIN)\dclofficexp280.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages> + </Excluded_Packages> + </Delphi.Personality> + <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> diff --git a/Examples/EncodeFromScratch.lpi b/Examples/EncodeFromScratch.lpi new file mode 100644 index 0000000..e702931 --- /dev/null +++ b/Examples/EncodeFromScratch.lpi @@ -0,0 +1,223 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="EncodeFromScratch"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + </General> + <BuildModes> + <Item Name="Default" Default="True"/> + <Item Name="Windows_Debug64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="EncodeFromScratch"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\windows\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <IncludeAssertionCode Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + <VerifyObjMethodCallValidity Value="True"/> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + <UseHeaptrc Value="True"/> + <TrashVariables Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Windows_Release64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="EncodeFromScratch"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\windows\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + </Debugging> + <LinkSmart Value="True"/> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Linux_Debug64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="EncodeFromScratch"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\linux\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <IncludeAssertionCode Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + <VerifyObjMethodCallValidity Value="True"/> + <TargetCPU Value="x86_64"/> + <TargetOS Value="linux"/> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + <UseHeaptrc Value="True"/> + <TrashVariables Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Linux_Release64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="EncodeFromScratch"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\linux\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <TargetCPU Value="x86_64"/> + <TargetOS Value="linux"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + </Debugging> + <LinkSmart Value="True"/> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units> + <Unit> + <Filename Value="EncodeFromScratch.dpr"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Encoder.Types.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="EncodeFromScratch"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions> + <Item> + <Name Value="EAbort"/> + </Item> + <Item> + <Name Value="ECodetoolError"/> + </Item> + <Item> + <Name Value="EFOpenError"/> + </Item> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/Examples/EncodeFromScratch.lps b/Examples/EncodeFromScratch.lps new file mode 100644 index 0000000..76251e4 --- /dev/null +++ b/Examples/EncodeFromScratch.lps @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <PathDelim Value="\"/> + <Version Value="12"/> + <BuildModes Active="Windows_Release64"/> + <Units> + <Unit> + <Filename Value="EncodeFromScratch.dpr"/> + <IsPartOfProject Value="True"/> + <TopLine Value="5"/> + <CursorPos X="19" Y="5"/> + <UsageCount Value="31"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Encoder.Types.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <TopLine Value="36"/> + <CursorPos X="28" Y="48"/> + <UsageCount Value="30"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\inc\systemh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="522"/> + <CursorPos X="20" Y="539"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Types.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="55"/> + <CursorPos X="5" Y="34"/> + <UsageCount Value="13"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Status.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="32"/> + <CursorPos X="53" Y="49"/> + <UsageCount Value="10"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Disassembler.Types.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="16"/> + <CursorPos Y="34"/> + <UsageCount Value="10"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Generated\zydis_enums.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="2919"/> + <CursorPos Y="2934"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.Types.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="271"/> + <CursorPos Y="282"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <IsVisibleTab Value="True"/> + <EditorIndex Value="1"/> + <TopLine Value="413"/> + <CursorPos Y="423"/> + <FoldState Value=" T3r70K2 PiGiD0\"/> + <UsageCount Value="13"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Enums.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="39"/> + <CursorPos X="13" Y="43"/> + <UsageCount Value="13"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\unix\bunxh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="93"/> + <CursorPos X="68" Y="110"/> + <UsageCount Value="10"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\win\sysutils.pp"/> + <UnitName Value="SysUtils"/> + <EditorIndex Value="2"/> + <UsageCount Value="11"/> + <Loaded Value="True"/> + </Unit> + </Units> + <JumpHistory HistoryIndex="24"> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="88" TopLine="71"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="90" TopLine="71"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="89" Column="65" TopLine="76"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="24" Column="61" TopLine="12"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="92" Column="37" TopLine="77"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="100" Column="66" TopLine="81"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="78" Column="25" TopLine="72"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="108" Column="9" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="98" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="33" TopLine="18"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="98" TopLine="83"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="104" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="107" Column="45" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="110" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="111" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="98" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="96" Column="43" TopLine="89"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="102" Column="53" TopLine="89"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="87" Column="9" TopLine="79"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="101" Column="43" TopLine="79"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="100" Column="32" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="100" Column="65" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="104" Column="41" TopLine="86"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Column="26"/> + </Position> + <Position> + <Filename Value="EncodeFromScratch.dpr"/> + <Caret Line="5" Column="19" TopLine="5"/> + </Position> + </JumpHistory> + <RunParams> + <FormatVersion Value="2"/> + <Modes ActiveMode=""/> + </RunParams> + </ProjectSession> +</CONFIG> diff --git a/Examples/Examples.groupproj b/Examples/Examples.groupproj deleted file mode 100644 index 77c942a..0000000 --- a/Examples/Examples.groupproj +++ /dev/null @@ -1,41 +0,0 @@ -<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <ProjectGuid>{D2FEAC7B-BA6A-4F35-B075-A47A8CB9AE80}</ProjectGuid> - </PropertyGroup> - <ItemGroup> - <Projects Include="CustomFormatter.dproj"> - <Dependencies/> - </Projects> - <Projects Include="SimpleDemo.dproj"> - <Dependencies/> - </Projects> - </ItemGroup> - <Target Name="CustomFormatter"> - <MSBuild Projects="CustomFormatter.dproj"/> - </Target> - <Target Name="CustomFormatter:Clean"> - <MSBuild Projects="CustomFormatter.dproj" Targets="Clean"/> - </Target> - <Target Name="CustomFormatter:Make"> - <MSBuild Projects="CustomFormatter.dproj" Targets="Make"/> - </Target> - <Target Name="SimpleDemo"> - <MSBuild Projects="SimpleDemo.dproj"/> - </Target> - <Target Name="SimpleDemo:Clean"> - <MSBuild Projects="SimpleDemo.dproj" Targets="Clean"/> - </Target> - <Target Name="SimpleDemo:Make"> - <MSBuild Projects="SimpleDemo.dproj" Targets="Make"/> - </Target> - <Target Name="Build"> - <CallTarget Targets="CustomFormatter;SimpleDemo"/> - </Target> - <Target Name="Clean"> - <CallTarget Targets="CustomFormatter:Clean;SimpleDemo:Clean"/> - </Target> - <Target Name="Make"> - <CallTarget Targets="CustomFormatter:Make;SimpleDemo:Make"/> - </Target> - <Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/> -</Project> diff --git a/Examples/SimpleDemo.dpr b/Examples/SimpleDemo.dpr deleted file mode 100644 index 762da96..0000000 --- a/Examples/SimpleDemo.dpr +++ /dev/null @@ -1,94 +0,0 @@ -{*************************************************************************************************** - - 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. - -***************************************************************************************************} - -program SimpleDemo; - -{$APPTYPE CONSOLE} - -{$R *.res} - -uses - Zydis in '../Zydis/Zydis.pas', - Zydis.Exception in '../Zydis/Zydis.Exception.pas', - Zydis.Decoder in '../Zydis/Zydis.Decoder.pas', - Zydis.Formatter in '../Zydis/Zydis.Formatter.pas', - {$IFNDEF FPC}System.SysUtils{$ELSE}SysUtils{$ENDIF}; - -{* ============================================================================================== *} -{* Entry point *} -{* ============================================================================================== *} - -const - X86DATA: array[0..24] of Byte = - ( - $51, $8D, $45, $FF, $50, $FF, $75, $0C, $FF, $75, - $08, $FF, $15, $A0, $A5, $48, $76, $85, $C0, $0F, - $88, $FC, $DA, $02, $00 - ); - -var - Formatter: Zydis.Formatter.TZydisFormatter; - Decoder: Zydis.Decoder.TZydisDecoder; - InstructionPointer: ZydisU64; - Offset: Integer; - Instruction: TZydisDecodedInstruction; -begin - try - if (ZydisGetVersion <> ZYDIS_VERSION) then - begin - raise Exception.Create('Invalid Zydis version'); - end; - - Formatter := Zydis.Formatter.TZydisFormatter.Create(ZYDIS_FORMATTER_STYLE_INTEL); - try - Formatter.ForceMemorySegments := true; - Formatter.ForceMemorySize := true; - Decoder := - Zydis.Decoder.TZydisDecoder.Create(ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64); - try - InstructionPointer := $007FFFFFFF400000; - Offset := 0; - repeat - Decoder.DecodeBuffer(@X86DATA[Offset], Length(X86DATA) - Offset, InstructionPointer, - Instruction); - WriteLn(Format('%.16x %s', - [InstructionPointer, Formatter.FormatInstruction(Instruction)])); - Inc(InstructionPointer, Instruction.Length); - Inc(Offset, Instruction.Length); - until (Offset >= Length(X86DATA)); - finally - Decoder.Free; - end; - finally - Formatter.Free; - end; - - except - on E: Exception do - Writeln(E.ClassName, ': ', E.Message); - end; -end. - diff --git a/Examples/disassemblesimple.ico b/Examples/disassemblesimple.ico new file mode 100644 index 0000000..1b2e574 Binary files /dev/null and b/Examples/disassemblesimple.ico differ diff --git a/Examples/disassemblesimple.lpi b/Examples/disassemblesimple.lpi new file mode 100644 index 0000000..c26380b --- /dev/null +++ b/Examples/disassemblesimple.lpi @@ -0,0 +1,203 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectOptions> + <Version Value="12"/> + <PathDelim Value="\"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + <MainUnitHasScaledStatement Value="False"/> + </Flags> + <SessionStorage Value="InProjectDir"/> + <Title Value="disassemblesimple"/> + <UseAppBundle Value="False"/> + <ResourceType Value="res"/> + <Icon Value="0"/> + </General> + <BuildModes> + <Item Name="Default" Default="True"/> + <Item Name="Debug"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="disassemblesimple"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\Windows\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <SyntaxMode Value="Delphi"/> + <IncludeAssertionCode Value="True"/> + <CStyleMacros Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <Checks> + <IOChecks Value="True"/> + <RangeChecks Value="True"/> + <OverflowChecks Value="True"/> + <StackChecks Value="True"/> + </Checks> + <VerifyObjMethodCallValidity Value="True"/> + </CodeGeneration> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf3"/> + <UseHeaptrc Value="True"/> + <UseExternalDbgSyms Value="True"/> + </Debugging> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Windows_Release_64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="disassemblesimple"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\Windows\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <CStyleMacros Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + <DebugInfoType Value="dsDwarf3"/> + </Debugging> + <LinkSmart Value="True"/> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + <Item Name="Linux_Release_64"> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="disassemblesimple"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <Libraries Value="..\libs\FPC\linux\x64"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Parsing> + <SyntaxOptions> + <CStyleMacros Value="True"/> + </SyntaxOptions> + </Parsing> + <CodeGeneration> + <SmartLinkUnit Value="True"/> + <TargetCPU Value="x86_64"/> + <TargetOS Value="linux"/> + <Optimizations> + <OptimizationLevel Value="3"/> + </Optimizations> + </CodeGeneration> + <Linking> + <Debugging> + <GenerateDebugInfo Value="False"/> + <RunWithoutDebug Value="True"/> + </Debugging> + <LinkSmart Value="True"/> + </Linking> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + </Item> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + </RunParams> + <Units> + <Unit> + <Filename Value="DisassembleSimple.dpr"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Disassembler.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.Types.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Status.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.pas"/> + <IsPartOfProject Value="True"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <PathDelim Value="\"/> + <Target> + <Filename Value="DisassembleSimple"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <OtherUnitFiles Value="..\Zydis"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Other> + <ConfigFile> + <WriteConfigFilePath Value=""/> + </ConfigFile> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions> + <Item> + <Name Value="EAbort"/> + </Item> + <Item> + <Name Value="ECodetoolError"/> + </Item> + <Item> + <Name Value="EFOpenError"/> + </Item> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/Examples/disassemblesimple.lps b/Examples/disassemblesimple.lps new file mode 100644 index 0000000..162a530 --- /dev/null +++ b/Examples/disassemblesimple.lps @@ -0,0 +1,322 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <PathDelim Value="\"/> + <Version Value="12"/> + <BuildModes Active="Linux_Release_64"/> + <Units> + <Unit> + <Filename Value="DisassembleSimple.dpr"/> + <IsPartOfProject Value="True"/> + <IsVisibleTab Value="True"/> + <TopLine Value="16"/> + <CursorPos Y="46"/> + <UsageCount Value="122"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Disassembler.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos Y="2"/> + <UsageCount Value="122"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.Types.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="7" Y="310"/> + <UsageCount Value="66"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Status.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="17" Y="28"/> + <UsageCount Value="46"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Decoder.pas"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="24"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.sharedtypes.pas"/> + <UnitName Value="Zydis.SharedTypes"/> + <EditorIndex Value="-1"/> + <UsageCount Value="42"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.bind.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="26" Y="11"/> + <UsageCount Value="30"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Generated\Zydis_bind.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="3176"/> + <UsageCount Value="29"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Types.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="46"/> + <CursorPos X="13" Y="35"/> + <UsageCount Value="60"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\inc\ctypes.pp"/> + <EditorIndex Value="-1"/> + <TopLine Value="43"/> + <UsageCount Value="1"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\packages\numlib\src\int.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="100"/> + <UsageCount Value="1"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\netwlibc\libc.pp"/> + <EditorIndex Value="-1"/> + <TopLine Value="7"/> + <CursorPos X="42" Y="14"/> + <UsageCount Value="1"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\stdinth.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="70"/> + <CursorPos X="33" Y="85"/> + <UsageCount Value="10"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="17" Y="28"/> + <UsageCount Value="53"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Generated\Zydis_enums.inc"/> + <EditorIndex Value="-1"/> + <CursorPos Y="6"/> + <UsageCount Value="22"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Enums.pas"/> + <EditorIndex Value="-1"/> + <UsageCount Value="31"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\inc\systemh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="107"/> + <CursorPos X="3" Y="121"/> + <UsageCount Value="10"/> + </Unit> + <Unit> + <Filename Value="F:\FPCross\fpcsrc\rtl\inc\ustringh.inc"/> + <EditorIndex Value="-1"/> + <TopLine Value="137"/> + <CursorPos X="22" Y="149"/> + <UsageCount Value="10"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Exception.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="23"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Formatter.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\..\Zydis-pascal\Zydis\Zydis.bind.pas"/> + <EditorIndex Value="-1"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\..\Zydis-pascal\Zydis\Zydis.Decoder.pas"/> + <EditorIndex Value="-1"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\..\Zydis-pascal\Zydis\Zydis.Exception.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="4"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\..\Zydis-pascal\Zydis\Zydis.Formatter.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="28"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\..\Zydis-pascal\Zydis\Zydis.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="16"/> + <CursorPos X="3" Y="34"/> + <UsageCount Value="9"/> + <DefaultSyntaxHighlighter Value="Delphi"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Allocator.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.FormatterBuffer.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="27"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Strings.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zycore.Vector.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Apis.pas"/> + <EditorIndex Value="1"/> + <TopLine Value="411"/> + <CursorPos X="8" Y="422"/> + <FoldState Value=" TGr90J T3rU0W1 PRY0P"/> + <UsageCount Value="12"/> + <Loaded Value="True"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Disassembler.Types.pas"/> + <EditorIndex Value="-1"/> + <TopLine Value="27"/> + <CursorPos X="5" Y="47"/> + <UsageCount Value="12"/> + </Unit> + <Unit> + <Filename Value="..\Zydis\Zydis.Formatter.Types.pas"/> + <EditorIndex Value="-1"/> + <CursorPos X="81" Y="23"/> + <UsageCount Value="12"/> + </Unit> + </Units> + <JumpHistory HistoryIndex="21"> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="40" TopLine="12"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="41" TopLine="12"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="42" TopLine="12"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="4" Column="13"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="15" Column="101"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="22" Column="12"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="22" Column="12"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="5" Column="13"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="20" Column="3" TopLine="10"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="28" Column="31" TopLine="15"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="49" Column="22" TopLine="18"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="8" Column="35" TopLine="7"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="15" Column="21" TopLine="6"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="6" Column="29"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="15" Column="23"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="16" Column="3"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="13" Column="15"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="37" Column="67" TopLine="17"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="38" Column="63" TopLine="17"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="37" Column="63" TopLine="17"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="11" Column="9"/> + </Position> + <Position> + <Filename Value="DisassembleSimple.dpr"/> + <Caret Line="16" Column="18"/> + </Position> + </JumpHistory> + <RunParams> + <FormatVersion Value="2"/> + <Modes ActiveMode=""/> + </RunParams> + </ProjectSession> +</CONFIG> diff --git a/Examples/SimpleDemo.res b/Examples/disassemblesimple.res similarity index 99% rename from Examples/SimpleDemo.res rename to Examples/disassemblesimple.res index 57de833..6a96cd0 100644 Binary files a/Examples/SimpleDemo.res and b/Examples/disassemblesimple.res differ diff --git a/README.md b/README.md index 5f30aa7..87ae2bf 100644 --- a/README.md +++ b/README.md @@ -1,90 +1,68 @@ Zydis Pascal Bindings ===================== -[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Gitter](https://badges.gitter.im/zyantific/zyan-disassembler-engine.svg)](https://gitter.im/zyantific/zydis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge) [![Discord](https://img.shields.io/discord/390136917779415060.svg)](https://discordapp.com/channels/390136917779415060/390138781313007626) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) Pascal language bindings for the [Zydis library](https://github.com/zyantific/zydis), a fast and lightweight x86/x86-64 disassembler. -## Readme -The Zydis pascal bindings support both dynamic and static linkage. The required binaries for Windows can be acquired in the [Releases](https://github.com/zyantific/zydis-pascal/releases) section. +## TODO +This repo still in development & Supports FreePascal / Delphi -#### Dynamic -- Extract the `Zydis32.dll` or `Zydis64.dll` from the `Bin32`/`Bin64` folder to the directory that contains your application or install the library to your `C:\Windows\System32\` (64-bit) / `C:\Windows\SysWOW64\` (32-bit) directory -- Enable the `{$DEFINE ZYDIS_DYNAMIC_LINK}` compiler-directive (enabled by default) in `Zydis.pas` - -#### Static -- Extract the complete `Bin32`/`Bin64` folder to the root of the pascal bindings directory -- Disable the `{$DEFINE ZYDIS_DYNAMIC_LINK}` compiler-directive in `Zydis.pas` +--- ## Example ```pascal +program DisassembleSimple; + uses - System.SysUtils, + SysUtils, Zydis, - Zydis.Exception, - Zydis.Decoder, - Zydis.Formatter; - -const - X86DATA: array of Byte = [$51, $8D, $45, $FF, $50, $FF, $75, $0C, $FF, $75, - $08, $FF, $15, $A0, $A5, $48, $76, $85, $C0, $0F, - $88, $FC, $DA, $02, $00]; + Zydis.enums, + Zydis.types, + Zydis.Status, + Zydis.Disassembler; var - Formatter: Zydis.Formatter.TZydisFormatter; - Decoder: Zydis.Decoder.TZydisDecoder; - InstructionPointer: ZydisU64; - Offset: Integer; - Instruction: TZydisDecodedInstruction; -begin - try - if (ZydisGetVersion <> ZYDIS_VERSION) then - begin - raise Exception.Create('Invalid Zydis version'); - end; + offset : ZyanUSize; + runtime_address: ZyanU64; + instruction : TZydisDisassembledInstruction; + Data: array[0..24] of ZyanU8 = ($51, $8D, $45, $FF, $50, $FF, + $75, $0C, $FF, $75, $08, $FF, $15, $A0, $A5, $48, $76, $85, $C0, + $0F, $88, $FC, $DA, $02, $00); - Formatter := Zydis.Formatter.TZydisFormatter.Create(ZYDIS_FORMATTER_STYLE_INTEL); - try - Formatter.ForceMemorySegments := true; - Formatter.ForceMemorySize := true; - Decoder := - Zydis.Decoder.TZydisDecoder.Create(ZYDIS_MACHINE_MODE_LONG_64, ZYDIS_ADDRESS_WIDTH_64); - try - InstructionPointer := $007FFFFFFF400000; - Offset := 0; - repeat - Decoder.DecodeBuffer(@X86DATA[Offset], Length(X86DATA) - Offset, InstructionPointer, - Instruction); - WriteLn(Format('%.16x %s', - [InstructionPointer, Formatter.FormatInstruction(Instruction)])); - Inc(InstructionPointer, Instruction.Length); - Inc(Offset, Instruction.Length); - until (Offset >= Length(X86DATA)); - finally - Decoder.Free; - end; - finally - Formatter.Free; - end; +{$R *.res} - except - on E: Exception do - Writeln(E.ClassName, ': ', E.Message); +begin + offset := 0; + runtime_address := $007FFFFFFF400000; + + Initialize(instruction); + // Loop over the instructions in our buffer. + while ZYAN_SUCCESS(ZydisDisassembleIntel(ZYDIS_MACHINE_MODE_LONG_64, + runtime_address, @data[offset], SizeOf(data) - offset, instruction)) do + begin + WriteLn(Format('%.16X %s', [runtime_address, UTF8ToString(instruction.text)])); + offset += instruction.info.length; + runtime_address += instruction.info.length; end; + + ReadLn; end. ``` #### Output ``` 007FFFFFFF400000 push rcx -007FFFFFFF400001 lea eax, ss:[rbp-0x01] +007FFFFFFF400001 lea eax, [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] +007FFFFFFF400005 push [rbp+0x0C] +007FFFFFFF400008 push [rbp+0x08] +007FFFFFFF40000B call [0x008000007588A5B1] 007FFFFFFF400011 test eax, eax 007FFFFFFF400013 js 0x007FFFFFFF42DB15 ``` ## License The Zydis Pascal Bindings are licensed under the MIT License. + +## With ❤️ From Home. diff --git a/Zydis/Generated/Zydis.Enum.ISAExt.inc b/Zydis/Generated/Zydis.Enum.ISAExt.inc deleted file mode 100644 index 634ed38..0000000 --- a/Zydis/Generated/Zydis.Enum.ISAExt.inc +++ /dev/null @@ -1,154 +0,0 @@ -type - {$Z1} - TZydisISAExt = ( - ZYDIS_ISA_EXT_INVALID, - ZYDIS_ISA_EXT_ADOX_ADCX, - ZYDIS_ISA_EXT_AES, - ZYDIS_ISA_EXT_AMD, - ZYDIS_ISA_EXT_AMD3DNOW, - ZYDIS_ISA_EXT_AVX, - ZYDIS_ISA_EXT_AVX2, - ZYDIS_ISA_EXT_AVX2GATHER, - ZYDIS_ISA_EXT_AVX512BW_128, - ZYDIS_ISA_EXT_AVX512BW_128N, - ZYDIS_ISA_EXT_AVX512BW_256, - ZYDIS_ISA_EXT_AVX512BW_512, - ZYDIS_ISA_EXT_AVX512BW_KOP, - ZYDIS_ISA_EXT_AVX512CD_128, - ZYDIS_ISA_EXT_AVX512CD_256, - ZYDIS_ISA_EXT_AVX512CD_512, - ZYDIS_ISA_EXT_AVX512DQ_128, - ZYDIS_ISA_EXT_AVX512DQ_128N, - ZYDIS_ISA_EXT_AVX512DQ_256, - ZYDIS_ISA_EXT_AVX512DQ_512, - ZYDIS_ISA_EXT_AVX512DQ_KOP, - ZYDIS_ISA_EXT_AVX512DQ_SCALAR, - ZYDIS_ISA_EXT_AVX512ER_512, - ZYDIS_ISA_EXT_AVX512ER_SCALAR, - ZYDIS_ISA_EXT_AVX512F_128, - ZYDIS_ISA_EXT_AVX512F_128N, - ZYDIS_ISA_EXT_AVX512F_256, - ZYDIS_ISA_EXT_AVX512F_512, - ZYDIS_ISA_EXT_AVX512F_KOP, - ZYDIS_ISA_EXT_AVX512F_SCALAR, - ZYDIS_ISA_EXT_AVX512PF_512, - ZYDIS_ISA_EXT_AVX512_4FMAPS_512, - ZYDIS_ISA_EXT_AVX512_4FMAPS_SCALAR, - ZYDIS_ISA_EXT_AVX512_4VNNIW_512, - ZYDIS_ISA_EXT_AVX512_BITALG_128, - ZYDIS_ISA_EXT_AVX512_BITALG_256, - ZYDIS_ISA_EXT_AVX512_BITALG_512, - ZYDIS_ISA_EXT_AVX512_GFNI_128, - ZYDIS_ISA_EXT_AVX512_GFNI_256, - ZYDIS_ISA_EXT_AVX512_GFNI_512, - ZYDIS_ISA_EXT_AVX512_IFMA_128, - ZYDIS_ISA_EXT_AVX512_IFMA_256, - ZYDIS_ISA_EXT_AVX512_IFMA_512, - ZYDIS_ISA_EXT_AVX512_VAES_128, - ZYDIS_ISA_EXT_AVX512_VAES_256, - ZYDIS_ISA_EXT_AVX512_VAES_512, - ZYDIS_ISA_EXT_AVX512_VBMI2_128, - ZYDIS_ISA_EXT_AVX512_VBMI2_256, - ZYDIS_ISA_EXT_AVX512_VBMI2_512, - ZYDIS_ISA_EXT_AVX512_VBMI_128, - ZYDIS_ISA_EXT_AVX512_VBMI_256, - ZYDIS_ISA_EXT_AVX512_VBMI_512, - ZYDIS_ISA_EXT_AVX512_VNNI_128, - ZYDIS_ISA_EXT_AVX512_VNNI_256, - ZYDIS_ISA_EXT_AVX512_VNNI_512, - ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_128, - ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_256, - ZYDIS_ISA_EXT_AVX512_VPCLMULQDQ_512, - ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_128, - ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_256, - ZYDIS_ISA_EXT_AVX512_VPOPCNTDQ_512, - ZYDIS_ISA_EXT_AVXAES, - ZYDIS_ISA_EXT_AVX_GFNI, - ZYDIS_ISA_EXT_BMI1, - ZYDIS_ISA_EXT_BMI2, - ZYDIS_ISA_EXT_CET, - ZYDIS_ISA_EXT_CLFLUSHOPT, - ZYDIS_ISA_EXT_CLFSH, - ZYDIS_ISA_EXT_CLWB, - ZYDIS_ISA_EXT_CLZERO, - ZYDIS_ISA_EXT_CMOV, - ZYDIS_ISA_EXT_CMPXCHG16B, - ZYDIS_ISA_EXT_F16C, - ZYDIS_ISA_EXT_FAT_NOP, - ZYDIS_ISA_EXT_FCMOV, - ZYDIS_ISA_EXT_FMA, - ZYDIS_ISA_EXT_FMA4, - ZYDIS_ISA_EXT_FXSAVE, - ZYDIS_ISA_EXT_FXSAVE64, - ZYDIS_ISA_EXT_GFNI, - ZYDIS_ISA_EXT_I186, - ZYDIS_ISA_EXT_I286PROTECTED, - ZYDIS_ISA_EXT_I286REAL, - ZYDIS_ISA_EXT_I386, - ZYDIS_ISA_EXT_I486, - ZYDIS_ISA_EXT_I486REAL, - ZYDIS_ISA_EXT_I86, - ZYDIS_ISA_EXT_INVPCID, - ZYDIS_ISA_EXT_KNCE, - ZYDIS_ISA_EXT_KNCJKBR, - ZYDIS_ISA_EXT_KNCSTREAM, - ZYDIS_ISA_EXT_KNCV, - ZYDIS_ISA_EXT_KNC_MISC, - ZYDIS_ISA_EXT_KNC_PF_HINT, - ZYDIS_ISA_EXT_LAHF, - ZYDIS_ISA_EXT_LONGMODE, - ZYDIS_ISA_EXT_LZCNT, - ZYDIS_ISA_EXT_MONITOR, - ZYDIS_ISA_EXT_MONITORX, - ZYDIS_ISA_EXT_MOVBE, - ZYDIS_ISA_EXT_MPX, - ZYDIS_ISA_EXT_PAUSE, - ZYDIS_ISA_EXT_PCLMULQDQ, - ZYDIS_ISA_EXT_PCONFIG, - ZYDIS_ISA_EXT_PENTIUMMMX, - ZYDIS_ISA_EXT_PENTIUMREAL, - ZYDIS_ISA_EXT_PKU, - ZYDIS_ISA_EXT_POPCNT, - ZYDIS_ISA_EXT_PPRO, - ZYDIS_ISA_EXT_PREFETCHWT1, - ZYDIS_ISA_EXT_PREFETCH_NOP, - ZYDIS_ISA_EXT_PT, - ZYDIS_ISA_EXT_RDPID, - ZYDIS_ISA_EXT_RDPMC, - ZYDIS_ISA_EXT_RDRAND, - ZYDIS_ISA_EXT_RDSEED, - ZYDIS_ISA_EXT_RDTSCP, - ZYDIS_ISA_EXT_RDWRFSGS, - ZYDIS_ISA_EXT_RTM, - ZYDIS_ISA_EXT_SGX, - ZYDIS_ISA_EXT_SGX_ENCLV, - ZYDIS_ISA_EXT_SHA, - ZYDIS_ISA_EXT_SMAP, - ZYDIS_ISA_EXT_SMX, - ZYDIS_ISA_EXT_SSE, - ZYDIS_ISA_EXT_SSE2, - ZYDIS_ISA_EXT_SSE2MMX, - ZYDIS_ISA_EXT_SSE3, - ZYDIS_ISA_EXT_SSE3X87, - ZYDIS_ISA_EXT_SSE4, - ZYDIS_ISA_EXT_SSE42, - ZYDIS_ISA_EXT_SSE4A, - ZYDIS_ISA_EXT_SSEMXCSR, - ZYDIS_ISA_EXT_SSE_PREFETCH, - ZYDIS_ISA_EXT_SSSE3, - ZYDIS_ISA_EXT_SSSE3MMX, - ZYDIS_ISA_EXT_SVM, - ZYDIS_ISA_EXT_TBM, - ZYDIS_ISA_EXT_VAES, - ZYDIS_ISA_EXT_VMFUNC, - ZYDIS_ISA_EXT_VPCLMULQDQ, - ZYDIS_ISA_EXT_VTX, - ZYDIS_ISA_EXT_X87, - ZYDIS_ISA_EXT_XOP, - ZYDIS_ISA_EXT_XSAVE, - ZYDIS_ISA_EXT_XSAVEC, - ZYDIS_ISA_EXT_XSAVEOPT, - ZYDIS_ISA_EXT_XSAVES, - - ZYDIS_ISA_EXT_MAX_VALUE = ZYDIS_ISA_EXT_XSAVES - ); diff --git a/Zydis/Generated/Zydis.Enum.ISASet.inc b/Zydis/Generated/Zydis.Enum.ISASet.inc deleted file mode 100644 index dd9318f..0000000 --- a/Zydis/Generated/Zydis.Enum.ISASet.inc +++ /dev/null @@ -1,74 +0,0 @@ -type - {$Z1} - TZydisISASet = ( - ZYDIS_ISA_SET_INVALID, - ZYDIS_ISA_SET_ADOX_ADCX, - ZYDIS_ISA_SET_AES, - ZYDIS_ISA_SET_AMD3DNOW, - ZYDIS_ISA_SET_AVX, - ZYDIS_ISA_SET_AVX2, - ZYDIS_ISA_SET_AVX2GATHER, - ZYDIS_ISA_SET_AVX512EVEX, - ZYDIS_ISA_SET_AVX512VEX, - ZYDIS_ISA_SET_AVXAES, - ZYDIS_ISA_SET_BASE, - ZYDIS_ISA_SET_BMI1, - ZYDIS_ISA_SET_BMI2, - ZYDIS_ISA_SET_CET, - ZYDIS_ISA_SET_CLFLUSHOPT, - ZYDIS_ISA_SET_CLFSH, - ZYDIS_ISA_SET_CLWB, - ZYDIS_ISA_SET_CLZERO, - ZYDIS_ISA_SET_F16C, - ZYDIS_ISA_SET_FMA, - ZYDIS_ISA_SET_FMA4, - ZYDIS_ISA_SET_GFNI, - ZYDIS_ISA_SET_INVPCID, - ZYDIS_ISA_SET_KNC, - ZYDIS_ISA_SET_KNCE, - ZYDIS_ISA_SET_KNCV, - ZYDIS_ISA_SET_LONGMODE, - ZYDIS_ISA_SET_LZCNT, - ZYDIS_ISA_SET_MMX, - ZYDIS_ISA_SET_MONITOR, - ZYDIS_ISA_SET_MONITORX, - ZYDIS_ISA_SET_MOVBE, - ZYDIS_ISA_SET_MPX, - ZYDIS_ISA_SET_PAUSE, - ZYDIS_ISA_SET_PCLMULQDQ, - ZYDIS_ISA_SET_PCONFIG, - ZYDIS_ISA_SET_PKU, - ZYDIS_ISA_SET_PREFETCHWT1, - ZYDIS_ISA_SET_PT, - ZYDIS_ISA_SET_RDPID, - ZYDIS_ISA_SET_RDRAND, - ZYDIS_ISA_SET_RDSEED, - ZYDIS_ISA_SET_RDTSCP, - ZYDIS_ISA_SET_RDWRFSGS, - ZYDIS_ISA_SET_RTM, - ZYDIS_ISA_SET_SGX, - ZYDIS_ISA_SET_SGX_ENCLV, - ZYDIS_ISA_SET_SHA, - ZYDIS_ISA_SET_SMAP, - ZYDIS_ISA_SET_SMX, - ZYDIS_ISA_SET_SSE, - ZYDIS_ISA_SET_SSE2, - ZYDIS_ISA_SET_SSE3, - ZYDIS_ISA_SET_SSE4, - ZYDIS_ISA_SET_SSE4A, - ZYDIS_ISA_SET_SSSE3, - ZYDIS_ISA_SET_SVM, - ZYDIS_ISA_SET_TBM, - ZYDIS_ISA_SET_VAES, - ZYDIS_ISA_SET_VMFUNC, - ZYDIS_ISA_SET_VPCLMULQDQ, - ZYDIS_ISA_SET_VTX, - ZYDIS_ISA_SET_X87, - ZYDIS_ISA_SET_XOP, - ZYDIS_ISA_SET_XSAVE, - ZYDIS_ISA_SET_XSAVEC, - ZYDIS_ISA_SET_XSAVEOPT, - ZYDIS_ISA_SET_XSAVES, - - ZYDIS_ISA_SET_MAX_VALUE = ZYDIS_ISA_SET_XSAVES - ); diff --git a/Zydis/Generated/Zydis.Enum.InstructionCategory.inc b/Zydis/Generated/Zydis.Enum.InstructionCategory.inc deleted file mode 100644 index 32ac627..0000000 --- a/Zydis/Generated/Zydis.Enum.InstructionCategory.inc +++ /dev/null @@ -1,98 +0,0 @@ -type - {$Z1} - TZydisInstructionCategory = ( - ZYDIS_CATEGORY_INVALID, - ZYDIS_CATEGORY_ADOX_ADCX, - ZYDIS_CATEGORY_AES, - ZYDIS_CATEGORY_AMD3DNOW, - ZYDIS_CATEGORY_AVX, - ZYDIS_CATEGORY_AVX2, - ZYDIS_CATEGORY_AVX2GATHER, - ZYDIS_CATEGORY_AVX512, - ZYDIS_CATEGORY_AVX512_4FMAPS, - ZYDIS_CATEGORY_AVX512_4VNNIW, - ZYDIS_CATEGORY_AVX512_BITALG, - ZYDIS_CATEGORY_AVX512_VBMI, - ZYDIS_CATEGORY_BINARY, - ZYDIS_CATEGORY_BITBYTE, - ZYDIS_CATEGORY_BLEND, - ZYDIS_CATEGORY_BMI1, - ZYDIS_CATEGORY_BMI2, - ZYDIS_CATEGORY_BROADCAST, - ZYDIS_CATEGORY_CALL, - ZYDIS_CATEGORY_CET, - ZYDIS_CATEGORY_CLFLUSHOPT, - ZYDIS_CATEGORY_CLWB, - ZYDIS_CATEGORY_CLZERO, - ZYDIS_CATEGORY_CMOV, - ZYDIS_CATEGORY_COMPRESS, - ZYDIS_CATEGORY_COND_BR, - ZYDIS_CATEGORY_CONFLICT, - ZYDIS_CATEGORY_CONVERT, - ZYDIS_CATEGORY_DATAXFER, - ZYDIS_CATEGORY_DECIMAL, - ZYDIS_CATEGORY_EXPAND, - ZYDIS_CATEGORY_FCMOV, - ZYDIS_CATEGORY_FLAGOP, - ZYDIS_CATEGORY_FMA4, - ZYDIS_CATEGORY_GATHER, - ZYDIS_CATEGORY_GFNI, - ZYDIS_CATEGORY_IFMA, - ZYDIS_CATEGORY_INTERRUPT, - ZYDIS_CATEGORY_IO, - ZYDIS_CATEGORY_IOSTRINGOP, - ZYDIS_CATEGORY_KMASK, - ZYDIS_CATEGORY_KNC, - ZYDIS_CATEGORY_KNCMASK, - ZYDIS_CATEGORY_KNCSCALAR, - ZYDIS_CATEGORY_LOGICAL, - ZYDIS_CATEGORY_LOGICAL_FP, - ZYDIS_CATEGORY_LZCNT, - ZYDIS_CATEGORY_MISC, - ZYDIS_CATEGORY_MMX, - ZYDIS_CATEGORY_MPX, - ZYDIS_CATEGORY_NOP, - ZYDIS_CATEGORY_PCLMULQDQ, - ZYDIS_CATEGORY_PCONFIG, - ZYDIS_CATEGORY_PKU, - ZYDIS_CATEGORY_POP, - ZYDIS_CATEGORY_PREFETCH, - ZYDIS_CATEGORY_PREFETCHWT1, - ZYDIS_CATEGORY_PT, - ZYDIS_CATEGORY_PUSH, - ZYDIS_CATEGORY_RDPID, - ZYDIS_CATEGORY_RDRAND, - ZYDIS_CATEGORY_RDSEED, - ZYDIS_CATEGORY_RDWRFSGS, - ZYDIS_CATEGORY_RET, - ZYDIS_CATEGORY_ROTATE, - ZYDIS_CATEGORY_SCATTER, - ZYDIS_CATEGORY_SEGOP, - ZYDIS_CATEGORY_SEMAPHORE, - ZYDIS_CATEGORY_SETCC, - ZYDIS_CATEGORY_SGX, - ZYDIS_CATEGORY_SHA, - ZYDIS_CATEGORY_SHIFT, - ZYDIS_CATEGORY_SMAP, - ZYDIS_CATEGORY_SSE, - ZYDIS_CATEGORY_STRINGOP, - ZYDIS_CATEGORY_STTNI, - ZYDIS_CATEGORY_SYSCALL, - ZYDIS_CATEGORY_SYSRET, - ZYDIS_CATEGORY_SYSTEM, - ZYDIS_CATEGORY_TBM, - ZYDIS_CATEGORY_UFMA, - ZYDIS_CATEGORY_UNCOND_BR, - ZYDIS_CATEGORY_VAES, - ZYDIS_CATEGORY_VBMI2, - ZYDIS_CATEGORY_VFMA, - ZYDIS_CATEGORY_VPCLMULQDQ, - ZYDIS_CATEGORY_VTX, - ZYDIS_CATEGORY_WIDENOP, - ZYDIS_CATEGORY_X87_ALU, - ZYDIS_CATEGORY_XOP, - ZYDIS_CATEGORY_XSAVE, - ZYDIS_CATEGORY_XSAVEOPT, - - ZYDIS_CATEGORY_MAX_VALUE = ZYDIS_CATEGORY_XSAVEOPT - ); diff --git a/Zydis/Generated/Zydis.Enum.Mnemonic.inc b/Zydis/Generated/Zydis.Enum.Mnemonic.inc deleted file mode 100644 index 2e20b9e..0000000 --- a/Zydis/Generated/Zydis.Enum.Mnemonic.inc +++ /dev/null @@ -1,1589 +0,0 @@ -type - {$Z2} - TZydisMnemonic = ( - ZYDIS_MNEMONIC_INVALID, - ZYDIS_MNEMONIC_AAA, - ZYDIS_MNEMONIC_AAD, - ZYDIS_MNEMONIC_AAM, - ZYDIS_MNEMONIC_AAS, - ZYDIS_MNEMONIC_ADC, - ZYDIS_MNEMONIC_ADCX, - ZYDIS_MNEMONIC_ADD, - ZYDIS_MNEMONIC_ADDPD, - ZYDIS_MNEMONIC_ADDPS, - ZYDIS_MNEMONIC_ADDSD, - ZYDIS_MNEMONIC_ADDSS, - ZYDIS_MNEMONIC_ADDSUBPD, - ZYDIS_MNEMONIC_ADDSUBPS, - ZYDIS_MNEMONIC_ADOX, - ZYDIS_MNEMONIC_AESDEC, - ZYDIS_MNEMONIC_AESDECLAST, - ZYDIS_MNEMONIC_AESENC, - ZYDIS_MNEMONIC_AESENCLAST, - ZYDIS_MNEMONIC_AESIMC, - ZYDIS_MNEMONIC_AESKEYGENASSIST, - ZYDIS_MNEMONIC_AND, - ZYDIS_MNEMONIC_ANDN, - ZYDIS_MNEMONIC_ANDNPD, - ZYDIS_MNEMONIC_ANDNPS, - ZYDIS_MNEMONIC_ANDPD, - ZYDIS_MNEMONIC_ANDPS, - ZYDIS_MNEMONIC_ARPL, - ZYDIS_MNEMONIC_BEXTR, - ZYDIS_MNEMONIC_BLCFILL, - ZYDIS_MNEMONIC_BLCI, - ZYDIS_MNEMONIC_BLCIC, - ZYDIS_MNEMONIC_BLCMSK, - ZYDIS_MNEMONIC_BLCS, - ZYDIS_MNEMONIC_BLENDPD, - ZYDIS_MNEMONIC_BLENDPS, - ZYDIS_MNEMONIC_BLENDVPD, - ZYDIS_MNEMONIC_BLENDVPS, - ZYDIS_MNEMONIC_BLSFILL, - ZYDIS_MNEMONIC_BLSI, - ZYDIS_MNEMONIC_BLSIC, - ZYDIS_MNEMONIC_BLSMSK, - ZYDIS_MNEMONIC_BLSR, - ZYDIS_MNEMONIC_BNDCL, - ZYDIS_MNEMONIC_BNDCN, - ZYDIS_MNEMONIC_BNDCU, - ZYDIS_MNEMONIC_BNDLDX, - ZYDIS_MNEMONIC_BNDMK, - ZYDIS_MNEMONIC_BNDMOV, - ZYDIS_MNEMONIC_BNDSTX, - ZYDIS_MNEMONIC_BOUND, - ZYDIS_MNEMONIC_BSF, - ZYDIS_MNEMONIC_BSR, - ZYDIS_MNEMONIC_BSWAP, - ZYDIS_MNEMONIC_BT, - ZYDIS_MNEMONIC_BTC, - ZYDIS_MNEMONIC_BTR, - ZYDIS_MNEMONIC_BTS, - ZYDIS_MNEMONIC_BZHI, - ZYDIS_MNEMONIC_CALL, - ZYDIS_MNEMONIC_CBW, - ZYDIS_MNEMONIC_CDQ, - ZYDIS_MNEMONIC_CDQE, - ZYDIS_MNEMONIC_CLAC, - ZYDIS_MNEMONIC_CLC, - ZYDIS_MNEMONIC_CLD, - ZYDIS_MNEMONIC_CLEVICT0, - ZYDIS_MNEMONIC_CLEVICT1, - ZYDIS_MNEMONIC_CLFLUSH, - ZYDIS_MNEMONIC_CLFLUSHOPT, - ZYDIS_MNEMONIC_CLGI, - ZYDIS_MNEMONIC_CLI, - ZYDIS_MNEMONIC_CLRSSBSY, - ZYDIS_MNEMONIC_CLTS, - ZYDIS_MNEMONIC_CLWB, - ZYDIS_MNEMONIC_CLZERO, - ZYDIS_MNEMONIC_CMC, - ZYDIS_MNEMONIC_CMOVB, - ZYDIS_MNEMONIC_CMOVBE, - ZYDIS_MNEMONIC_CMOVL, - ZYDIS_MNEMONIC_CMOVLE, - ZYDIS_MNEMONIC_CMOVNB, - ZYDIS_MNEMONIC_CMOVNBE, - ZYDIS_MNEMONIC_CMOVNL, - ZYDIS_MNEMONIC_CMOVNLE, - ZYDIS_MNEMONIC_CMOVNO, - ZYDIS_MNEMONIC_CMOVNP, - ZYDIS_MNEMONIC_CMOVNS, - ZYDIS_MNEMONIC_CMOVNZ, - ZYDIS_MNEMONIC_CMOVO, - ZYDIS_MNEMONIC_CMOVP, - ZYDIS_MNEMONIC_CMOVS, - ZYDIS_MNEMONIC_CMOVZ, - ZYDIS_MNEMONIC_CMP, - ZYDIS_MNEMONIC_CMPPD, - ZYDIS_MNEMONIC_CMPPS, - ZYDIS_MNEMONIC_CMPSB, - ZYDIS_MNEMONIC_CMPSD, - ZYDIS_MNEMONIC_CMPSQ, - ZYDIS_MNEMONIC_CMPSS, - ZYDIS_MNEMONIC_CMPSW, - ZYDIS_MNEMONIC_CMPXCHG, - ZYDIS_MNEMONIC_CMPXCHG16B, - ZYDIS_MNEMONIC_CMPXCHG8B, - ZYDIS_MNEMONIC_COMISD, - ZYDIS_MNEMONIC_COMISS, - ZYDIS_MNEMONIC_CPUID, - ZYDIS_MNEMONIC_CQO, - ZYDIS_MNEMONIC_CRC32, - ZYDIS_MNEMONIC_CVTDQ2PD, - ZYDIS_MNEMONIC_CVTDQ2PS, - ZYDIS_MNEMONIC_CVTPD2DQ, - ZYDIS_MNEMONIC_CVTPD2PI, - ZYDIS_MNEMONIC_CVTPD2PS, - ZYDIS_MNEMONIC_CVTPI2PD, - ZYDIS_MNEMONIC_CVTPI2PS, - ZYDIS_MNEMONIC_CVTPS2DQ, - ZYDIS_MNEMONIC_CVTPS2PD, - ZYDIS_MNEMONIC_CVTPS2PI, - ZYDIS_MNEMONIC_CVTSD2SI, - ZYDIS_MNEMONIC_CVTSD2SS, - ZYDIS_MNEMONIC_CVTSI2SD, - ZYDIS_MNEMONIC_CVTSI2SS, - ZYDIS_MNEMONIC_CVTSS2SD, - ZYDIS_MNEMONIC_CVTSS2SI, - ZYDIS_MNEMONIC_CVTTPD2DQ, - ZYDIS_MNEMONIC_CVTTPD2PI, - ZYDIS_MNEMONIC_CVTTPS2DQ, - ZYDIS_MNEMONIC_CVTTPS2PI, - ZYDIS_MNEMONIC_CVTTSD2SI, - ZYDIS_MNEMONIC_CVTTSS2SI, - ZYDIS_MNEMONIC_CWD, - ZYDIS_MNEMONIC_CWDE, - ZYDIS_MNEMONIC_DAA, - ZYDIS_MNEMONIC_DAS, - ZYDIS_MNEMONIC_DEC, - ZYDIS_MNEMONIC_DELAY, - ZYDIS_MNEMONIC_DIV, - ZYDIS_MNEMONIC_DIVPD, - ZYDIS_MNEMONIC_DIVPS, - ZYDIS_MNEMONIC_DIVSD, - ZYDIS_MNEMONIC_DIVSS, - ZYDIS_MNEMONIC_DPPD, - ZYDIS_MNEMONIC_DPPS, - ZYDIS_MNEMONIC_EMMS, - ZYDIS_MNEMONIC_ENCLS, - ZYDIS_MNEMONIC_ENCLU, - ZYDIS_MNEMONIC_ENCLV, - ZYDIS_MNEMONIC_ENDBR32, - ZYDIS_MNEMONIC_ENDBR64, - ZYDIS_MNEMONIC_ENTER, - ZYDIS_MNEMONIC_EXTRACTPS, - ZYDIS_MNEMONIC_EXTRQ, - ZYDIS_MNEMONIC_F2XM1, - ZYDIS_MNEMONIC_FABS, - ZYDIS_MNEMONIC_FADD, - ZYDIS_MNEMONIC_FADDP, - ZYDIS_MNEMONIC_FBLD, - ZYDIS_MNEMONIC_FBSTP, - ZYDIS_MNEMONIC_FCHS, - ZYDIS_MNEMONIC_FCMOVB, - ZYDIS_MNEMONIC_FCMOVBE, - ZYDIS_MNEMONIC_FCMOVE, - ZYDIS_MNEMONIC_FCMOVNB, - ZYDIS_MNEMONIC_FCMOVNBE, - ZYDIS_MNEMONIC_FCMOVNE, - ZYDIS_MNEMONIC_FCMOVNU, - ZYDIS_MNEMONIC_FCMOVU, - ZYDIS_MNEMONIC_FCOM, - ZYDIS_MNEMONIC_FCOMI, - ZYDIS_MNEMONIC_FCOMIP, - ZYDIS_MNEMONIC_FCOMP, - ZYDIS_MNEMONIC_FCOMPP, - ZYDIS_MNEMONIC_FCOS, - ZYDIS_MNEMONIC_FDECSTP, - ZYDIS_MNEMONIC_FDISI8087_NOP, - ZYDIS_MNEMONIC_FDIV, - ZYDIS_MNEMONIC_FDIVP, - ZYDIS_MNEMONIC_FDIVR, - ZYDIS_MNEMONIC_FDIVRP, - ZYDIS_MNEMONIC_FEMMS, - ZYDIS_MNEMONIC_FENI8087_NOP, - ZYDIS_MNEMONIC_FFREE, - ZYDIS_MNEMONIC_FFREEP, - ZYDIS_MNEMONIC_FIADD, - ZYDIS_MNEMONIC_FICOM, - ZYDIS_MNEMONIC_FICOMP, - ZYDIS_MNEMONIC_FIDIV, - ZYDIS_MNEMONIC_FIDIVR, - ZYDIS_MNEMONIC_FILD, - ZYDIS_MNEMONIC_FIMUL, - ZYDIS_MNEMONIC_FINCSTP, - ZYDIS_MNEMONIC_FIST, - ZYDIS_MNEMONIC_FISTP, - ZYDIS_MNEMONIC_FISTTP, - ZYDIS_MNEMONIC_FISUB, - ZYDIS_MNEMONIC_FISUBR, - ZYDIS_MNEMONIC_FLD, - ZYDIS_MNEMONIC_FLD1, - ZYDIS_MNEMONIC_FLDCW, - ZYDIS_MNEMONIC_FLDENV, - ZYDIS_MNEMONIC_FLDL2E, - ZYDIS_MNEMONIC_FLDL2T, - ZYDIS_MNEMONIC_FLDLG2, - ZYDIS_MNEMONIC_FLDLN2, - ZYDIS_MNEMONIC_FLDPI, - ZYDIS_MNEMONIC_FLDZ, - ZYDIS_MNEMONIC_FMUL, - ZYDIS_MNEMONIC_FMULP, - ZYDIS_MNEMONIC_FNCLEX, - ZYDIS_MNEMONIC_FNINIT, - ZYDIS_MNEMONIC_FNOP, - ZYDIS_MNEMONIC_FNSAVE, - ZYDIS_MNEMONIC_FNSTCW, - ZYDIS_MNEMONIC_FNSTENV, - ZYDIS_MNEMONIC_FNSTSW, - ZYDIS_MNEMONIC_FPATAN, - ZYDIS_MNEMONIC_FPREM, - ZYDIS_MNEMONIC_FPREM1, - ZYDIS_MNEMONIC_FPTAN, - ZYDIS_MNEMONIC_FRNDINT, - ZYDIS_MNEMONIC_FRSTOR, - ZYDIS_MNEMONIC_FSCALE, - ZYDIS_MNEMONIC_FSETPM287_NOP, - ZYDIS_MNEMONIC_FSIN, - ZYDIS_MNEMONIC_FSINCOS, - ZYDIS_MNEMONIC_FSQRT, - ZYDIS_MNEMONIC_FST, - ZYDIS_MNEMONIC_FSTP, - ZYDIS_MNEMONIC_FSTPNCE, - ZYDIS_MNEMONIC_FSUB, - ZYDIS_MNEMONIC_FSUBP, - ZYDIS_MNEMONIC_FSUBR, - ZYDIS_MNEMONIC_FSUBRP, - ZYDIS_MNEMONIC_FTST, - ZYDIS_MNEMONIC_FUCOM, - ZYDIS_MNEMONIC_FUCOMI, - ZYDIS_MNEMONIC_FUCOMIP, - ZYDIS_MNEMONIC_FUCOMP, - ZYDIS_MNEMONIC_FUCOMPP, - ZYDIS_MNEMONIC_FWAIT, - ZYDIS_MNEMONIC_FXAM, - ZYDIS_MNEMONIC_FXCH, - ZYDIS_MNEMONIC_FXRSTOR, - ZYDIS_MNEMONIC_FXRSTOR64, - ZYDIS_MNEMONIC_FXSAVE, - ZYDIS_MNEMONIC_FXSAVE64, - ZYDIS_MNEMONIC_FXTRACT, - ZYDIS_MNEMONIC_FYL2X, - ZYDIS_MNEMONIC_FYL2XP1, - ZYDIS_MNEMONIC_GETSEC, - ZYDIS_MNEMONIC_GF2P8AFFINEINVQB, - ZYDIS_MNEMONIC_GF2P8AFFINEQB, - ZYDIS_MNEMONIC_GF2P8MULB, - ZYDIS_MNEMONIC_HADDPD, - ZYDIS_MNEMONIC_HADDPS, - ZYDIS_MNEMONIC_HLT, - ZYDIS_MNEMONIC_HSUBPD, - ZYDIS_MNEMONIC_HSUBPS, - ZYDIS_MNEMONIC_IDIV, - ZYDIS_MNEMONIC_IMUL, - ZYDIS_MNEMONIC_IN, - ZYDIS_MNEMONIC_INC, - ZYDIS_MNEMONIC_INCSSPD, - ZYDIS_MNEMONIC_INCSSPQ, - ZYDIS_MNEMONIC_INSB, - ZYDIS_MNEMONIC_INSD, - ZYDIS_MNEMONIC_INSERTPS, - ZYDIS_MNEMONIC_INSERTQ, - ZYDIS_MNEMONIC_INSW, - ZYDIS_MNEMONIC_INT, - ZYDIS_MNEMONIC_INT1, - ZYDIS_MNEMONIC_INT3, - ZYDIS_MNEMONIC_INTO, - ZYDIS_MNEMONIC_INVD, - ZYDIS_MNEMONIC_INVEPT, - ZYDIS_MNEMONIC_INVLPG, - ZYDIS_MNEMONIC_INVLPGA, - ZYDIS_MNEMONIC_INVPCID, - ZYDIS_MNEMONIC_INVVPID, - ZYDIS_MNEMONIC_IRET, - ZYDIS_MNEMONIC_IRETD, - ZYDIS_MNEMONIC_IRETQ, - ZYDIS_MNEMONIC_JB, - ZYDIS_MNEMONIC_JBE, - ZYDIS_MNEMONIC_JCXZ, - ZYDIS_MNEMONIC_JECXZ, - ZYDIS_MNEMONIC_JKNZD, - ZYDIS_MNEMONIC_JKZD, - ZYDIS_MNEMONIC_JL, - ZYDIS_MNEMONIC_JLE, - ZYDIS_MNEMONIC_JMP, - ZYDIS_MNEMONIC_JNB, - ZYDIS_MNEMONIC_JNBE, - ZYDIS_MNEMONIC_JNL, - ZYDIS_MNEMONIC_JNLE, - ZYDIS_MNEMONIC_JNO, - ZYDIS_MNEMONIC_JNP, - ZYDIS_MNEMONIC_JNS, - ZYDIS_MNEMONIC_JNZ, - ZYDIS_MNEMONIC_JO, - ZYDIS_MNEMONIC_JP, - ZYDIS_MNEMONIC_JRCXZ, - ZYDIS_MNEMONIC_JS, - ZYDIS_MNEMONIC_JZ, - ZYDIS_MNEMONIC_KADDB, - ZYDIS_MNEMONIC_KADDD, - ZYDIS_MNEMONIC_KADDQ, - ZYDIS_MNEMONIC_KADDW, - ZYDIS_MNEMONIC_KAND, - ZYDIS_MNEMONIC_KANDB, - ZYDIS_MNEMONIC_KANDD, - ZYDIS_MNEMONIC_KANDN, - ZYDIS_MNEMONIC_KANDNB, - ZYDIS_MNEMONIC_KANDND, - ZYDIS_MNEMONIC_KANDNQ, - ZYDIS_MNEMONIC_KANDNR, - ZYDIS_MNEMONIC_KANDNW, - ZYDIS_MNEMONIC_KANDQ, - ZYDIS_MNEMONIC_KANDW, - ZYDIS_MNEMONIC_KCONCATH, - ZYDIS_MNEMONIC_KCONCATL, - ZYDIS_MNEMONIC_KEXTRACT, - ZYDIS_MNEMONIC_KMERGE2L1H, - ZYDIS_MNEMONIC_KMERGE2L1L, - ZYDIS_MNEMONIC_KMOV, - ZYDIS_MNEMONIC_KMOVB, - ZYDIS_MNEMONIC_KMOVD, - ZYDIS_MNEMONIC_KMOVQ, - ZYDIS_MNEMONIC_KMOVW, - ZYDIS_MNEMONIC_KNOT, - ZYDIS_MNEMONIC_KNOTB, - ZYDIS_MNEMONIC_KNOTD, - ZYDIS_MNEMONIC_KNOTQ, - ZYDIS_MNEMONIC_KNOTW, - ZYDIS_MNEMONIC_KOR, - ZYDIS_MNEMONIC_KORB, - ZYDIS_MNEMONIC_KORD, - ZYDIS_MNEMONIC_KORQ, - ZYDIS_MNEMONIC_KORTEST, - ZYDIS_MNEMONIC_KORTESTB, - ZYDIS_MNEMONIC_KORTESTD, - ZYDIS_MNEMONIC_KORTESTQ, - ZYDIS_MNEMONIC_KORTESTW, - ZYDIS_MNEMONIC_KORW, - ZYDIS_MNEMONIC_KSHIFTLB, - ZYDIS_MNEMONIC_KSHIFTLD, - ZYDIS_MNEMONIC_KSHIFTLQ, - ZYDIS_MNEMONIC_KSHIFTLW, - ZYDIS_MNEMONIC_KSHIFTRB, - ZYDIS_MNEMONIC_KSHIFTRD, - ZYDIS_MNEMONIC_KSHIFTRQ, - ZYDIS_MNEMONIC_KSHIFTRW, - ZYDIS_MNEMONIC_KTESTB, - ZYDIS_MNEMONIC_KTESTD, - ZYDIS_MNEMONIC_KTESTQ, - ZYDIS_MNEMONIC_KTESTW, - ZYDIS_MNEMONIC_KUNPCKBW, - ZYDIS_MNEMONIC_KUNPCKDQ, - ZYDIS_MNEMONIC_KUNPCKWD, - ZYDIS_MNEMONIC_KXNOR, - ZYDIS_MNEMONIC_KXNORB, - ZYDIS_MNEMONIC_KXNORD, - ZYDIS_MNEMONIC_KXNORQ, - ZYDIS_MNEMONIC_KXNORW, - ZYDIS_MNEMONIC_KXOR, - ZYDIS_MNEMONIC_KXORB, - ZYDIS_MNEMONIC_KXORD, - ZYDIS_MNEMONIC_KXORQ, - ZYDIS_MNEMONIC_KXORW, - ZYDIS_MNEMONIC_LAHF, - ZYDIS_MNEMONIC_LAR, - ZYDIS_MNEMONIC_LDDQU, - ZYDIS_MNEMONIC_LDMXCSR, - ZYDIS_MNEMONIC_LDS, - ZYDIS_MNEMONIC_LEA, - ZYDIS_MNEMONIC_LEAVE, - ZYDIS_MNEMONIC_LES, - ZYDIS_MNEMONIC_LFENCE, - ZYDIS_MNEMONIC_LFS, - ZYDIS_MNEMONIC_LGDT, - ZYDIS_MNEMONIC_LGS, - ZYDIS_MNEMONIC_LIDT, - ZYDIS_MNEMONIC_LLDT, - ZYDIS_MNEMONIC_LLWPCB, - ZYDIS_MNEMONIC_LMSW, - ZYDIS_MNEMONIC_LODSB, - ZYDIS_MNEMONIC_LODSD, - ZYDIS_MNEMONIC_LODSQ, - ZYDIS_MNEMONIC_LODSW, - ZYDIS_MNEMONIC_LOOP, - ZYDIS_MNEMONIC_LOOPE, - ZYDIS_MNEMONIC_LOOPNE, - ZYDIS_MNEMONIC_LSL, - ZYDIS_MNEMONIC_LSS, - ZYDIS_MNEMONIC_LTR, - ZYDIS_MNEMONIC_LWPINS, - ZYDIS_MNEMONIC_LWPVAL, - ZYDIS_MNEMONIC_LZCNT, - ZYDIS_MNEMONIC_MASKMOVDQU, - ZYDIS_MNEMONIC_MASKMOVQ, - ZYDIS_MNEMONIC_MAXPD, - ZYDIS_MNEMONIC_MAXPS, - ZYDIS_MNEMONIC_MAXSD, - ZYDIS_MNEMONIC_MAXSS, - ZYDIS_MNEMONIC_MFENCE, - ZYDIS_MNEMONIC_MINPD, - ZYDIS_MNEMONIC_MINPS, - ZYDIS_MNEMONIC_MINSD, - ZYDIS_MNEMONIC_MINSS, - ZYDIS_MNEMONIC_MONITOR, - ZYDIS_MNEMONIC_MONITORX, - ZYDIS_MNEMONIC_MOV, - ZYDIS_MNEMONIC_MOVAPD, - ZYDIS_MNEMONIC_MOVAPS, - ZYDIS_MNEMONIC_MOVBE, - ZYDIS_MNEMONIC_MOVD, - ZYDIS_MNEMONIC_MOVDDUP, - ZYDIS_MNEMONIC_MOVDQ2Q, - ZYDIS_MNEMONIC_MOVDQA, - ZYDIS_MNEMONIC_MOVDQU, - ZYDIS_MNEMONIC_MOVHLPS, - ZYDIS_MNEMONIC_MOVHPD, - ZYDIS_MNEMONIC_MOVHPS, - ZYDIS_MNEMONIC_MOVLHPS, - ZYDIS_MNEMONIC_MOVLPD, - ZYDIS_MNEMONIC_MOVLPS, - ZYDIS_MNEMONIC_MOVMSKPD, - ZYDIS_MNEMONIC_MOVMSKPS, - ZYDIS_MNEMONIC_MOVNTDQ, - ZYDIS_MNEMONIC_MOVNTDQA, - ZYDIS_MNEMONIC_MOVNTI, - ZYDIS_MNEMONIC_MOVNTPD, - ZYDIS_MNEMONIC_MOVNTPS, - ZYDIS_MNEMONIC_MOVNTQ, - ZYDIS_MNEMONIC_MOVNTSD, - ZYDIS_MNEMONIC_MOVNTSS, - ZYDIS_MNEMONIC_MOVQ, - ZYDIS_MNEMONIC_MOVQ2DQ, - ZYDIS_MNEMONIC_MOVSB, - ZYDIS_MNEMONIC_MOVSD, - ZYDIS_MNEMONIC_MOVSHDUP, - ZYDIS_MNEMONIC_MOVSLDUP, - ZYDIS_MNEMONIC_MOVSQ, - ZYDIS_MNEMONIC_MOVSS, - ZYDIS_MNEMONIC_MOVSW, - ZYDIS_MNEMONIC_MOVSX, - ZYDIS_MNEMONIC_MOVSXD, - ZYDIS_MNEMONIC_MOVUPD, - ZYDIS_MNEMONIC_MOVUPS, - ZYDIS_MNEMONIC_MOVZX, - ZYDIS_MNEMONIC_MPSADBW, - ZYDIS_MNEMONIC_MUL, - ZYDIS_MNEMONIC_MULPD, - ZYDIS_MNEMONIC_MULPS, - ZYDIS_MNEMONIC_MULSD, - ZYDIS_MNEMONIC_MULSS, - ZYDIS_MNEMONIC_MULX, - ZYDIS_MNEMONIC_MWAIT, - ZYDIS_MNEMONIC_MWAITX, - ZYDIS_MNEMONIC_NEG, - ZYDIS_MNEMONIC_NOP, - ZYDIS_MNEMONIC_NOT, - ZYDIS_MNEMONIC_OR, - ZYDIS_MNEMONIC_ORPD, - ZYDIS_MNEMONIC_ORPS, - ZYDIS_MNEMONIC_OUT, - ZYDIS_MNEMONIC_OUTSB, - ZYDIS_MNEMONIC_OUTSD, - ZYDIS_MNEMONIC_OUTSW, - ZYDIS_MNEMONIC_PABSB, - ZYDIS_MNEMONIC_PABSD, - ZYDIS_MNEMONIC_PABSW, - ZYDIS_MNEMONIC_PACKSSDW, - ZYDIS_MNEMONIC_PACKSSWB, - ZYDIS_MNEMONIC_PACKUSDW, - ZYDIS_MNEMONIC_PACKUSWB, - ZYDIS_MNEMONIC_PADDB, - ZYDIS_MNEMONIC_PADDD, - ZYDIS_MNEMONIC_PADDQ, - ZYDIS_MNEMONIC_PADDSB, - ZYDIS_MNEMONIC_PADDSW, - ZYDIS_MNEMONIC_PADDUSB, - ZYDIS_MNEMONIC_PADDUSW, - ZYDIS_MNEMONIC_PADDW, - ZYDIS_MNEMONIC_PALIGNR, - ZYDIS_MNEMONIC_PAND, - ZYDIS_MNEMONIC_PANDN, - ZYDIS_MNEMONIC_PAUSE, - ZYDIS_MNEMONIC_PAVGB, - ZYDIS_MNEMONIC_PAVGUSB, - ZYDIS_MNEMONIC_PAVGW, - ZYDIS_MNEMONIC_PBLENDVB, - ZYDIS_MNEMONIC_PBLENDW, - ZYDIS_MNEMONIC_PCLMULQDQ, - ZYDIS_MNEMONIC_PCMPEQB, - ZYDIS_MNEMONIC_PCMPEQD, - ZYDIS_MNEMONIC_PCMPEQQ, - ZYDIS_MNEMONIC_PCMPEQW, - ZYDIS_MNEMONIC_PCMPESTRI, - ZYDIS_MNEMONIC_PCMPESTRM, - ZYDIS_MNEMONIC_PCMPGTB, - ZYDIS_MNEMONIC_PCMPGTD, - ZYDIS_MNEMONIC_PCMPGTQ, - ZYDIS_MNEMONIC_PCMPGTW, - ZYDIS_MNEMONIC_PCMPISTRI, - ZYDIS_MNEMONIC_PCMPISTRM, - ZYDIS_MNEMONIC_PCONFIG, - ZYDIS_MNEMONIC_PDEP, - ZYDIS_MNEMONIC_PEXT, - ZYDIS_MNEMONIC_PEXTRB, - ZYDIS_MNEMONIC_PEXTRD, - ZYDIS_MNEMONIC_PEXTRQ, - ZYDIS_MNEMONIC_PEXTRW, - ZYDIS_MNEMONIC_PF2ID, - ZYDIS_MNEMONIC_PF2IW, - ZYDIS_MNEMONIC_PFACC, - ZYDIS_MNEMONIC_PFADD, - ZYDIS_MNEMONIC_PFCMPEQ, - ZYDIS_MNEMONIC_PFCMPGE, - ZYDIS_MNEMONIC_PFCMPGT, - ZYDIS_MNEMONIC_PFCPIT1, - ZYDIS_MNEMONIC_PFMAX, - ZYDIS_MNEMONIC_PFMIN, - ZYDIS_MNEMONIC_PFMUL, - ZYDIS_MNEMONIC_PFNACC, - ZYDIS_MNEMONIC_PFPNACC, - ZYDIS_MNEMONIC_PFRCP, - ZYDIS_MNEMONIC_PFRCPIT2, - ZYDIS_MNEMONIC_PFRSQIT1, - ZYDIS_MNEMONIC_PFSQRT, - ZYDIS_MNEMONIC_PFSUB, - ZYDIS_MNEMONIC_PFSUBR, - ZYDIS_MNEMONIC_PHADDD, - ZYDIS_MNEMONIC_PHADDSW, - ZYDIS_MNEMONIC_PHADDW, - ZYDIS_MNEMONIC_PHMINPOSUW, - ZYDIS_MNEMONIC_PHSUBD, - ZYDIS_MNEMONIC_PHSUBSW, - ZYDIS_MNEMONIC_PHSUBW, - ZYDIS_MNEMONIC_PI2FD, - ZYDIS_MNEMONIC_PI2FW, - ZYDIS_MNEMONIC_PINSRB, - ZYDIS_MNEMONIC_PINSRD, - ZYDIS_MNEMONIC_PINSRQ, - ZYDIS_MNEMONIC_PINSRW, - ZYDIS_MNEMONIC_PMADDUBSW, - ZYDIS_MNEMONIC_PMADDWD, - ZYDIS_MNEMONIC_PMAXSB, - ZYDIS_MNEMONIC_PMAXSD, - ZYDIS_MNEMONIC_PMAXSW, - ZYDIS_MNEMONIC_PMAXUB, - ZYDIS_MNEMONIC_PMAXUD, - ZYDIS_MNEMONIC_PMAXUW, - ZYDIS_MNEMONIC_PMINSB, - ZYDIS_MNEMONIC_PMINSD, - ZYDIS_MNEMONIC_PMINSW, - ZYDIS_MNEMONIC_PMINUB, - ZYDIS_MNEMONIC_PMINUD, - ZYDIS_MNEMONIC_PMINUW, - ZYDIS_MNEMONIC_PMOVMSKB, - ZYDIS_MNEMONIC_PMOVSXBD, - ZYDIS_MNEMONIC_PMOVSXBQ, - ZYDIS_MNEMONIC_PMOVSXBW, - ZYDIS_MNEMONIC_PMOVSXDQ, - ZYDIS_MNEMONIC_PMOVSXWD, - ZYDIS_MNEMONIC_PMOVSXWQ, - ZYDIS_MNEMONIC_PMOVZXBD, - ZYDIS_MNEMONIC_PMOVZXBQ, - ZYDIS_MNEMONIC_PMOVZXBW, - ZYDIS_MNEMONIC_PMOVZXDQ, - ZYDIS_MNEMONIC_PMOVZXWD, - ZYDIS_MNEMONIC_PMOVZXWQ, - ZYDIS_MNEMONIC_PMULDQ, - ZYDIS_MNEMONIC_PMULHRSW, - ZYDIS_MNEMONIC_PMULHRW, - ZYDIS_MNEMONIC_PMULHUW, - ZYDIS_MNEMONIC_PMULHW, - ZYDIS_MNEMONIC_PMULLD, - ZYDIS_MNEMONIC_PMULLW, - ZYDIS_MNEMONIC_PMULUDQ, - ZYDIS_MNEMONIC_POP, - ZYDIS_MNEMONIC_POPA, - ZYDIS_MNEMONIC_POPAD, - ZYDIS_MNEMONIC_POPCNT, - ZYDIS_MNEMONIC_POPF, - ZYDIS_MNEMONIC_POPFD, - ZYDIS_MNEMONIC_POPFQ, - ZYDIS_MNEMONIC_POR, - ZYDIS_MNEMONIC_PREFETCH, - ZYDIS_MNEMONIC_PREFETCHNTA, - ZYDIS_MNEMONIC_PREFETCHT0, - ZYDIS_MNEMONIC_PREFETCHT1, - ZYDIS_MNEMONIC_PREFETCHT2, - ZYDIS_MNEMONIC_PREFETCHW, - ZYDIS_MNEMONIC_PREFETCHWT1, - ZYDIS_MNEMONIC_PSADBW, - ZYDIS_MNEMONIC_PSHUFB, - ZYDIS_MNEMONIC_PSHUFD, - ZYDIS_MNEMONIC_PSHUFHW, - ZYDIS_MNEMONIC_PSHUFLW, - ZYDIS_MNEMONIC_PSHUFW, - ZYDIS_MNEMONIC_PSIGNB, - ZYDIS_MNEMONIC_PSIGND, - ZYDIS_MNEMONIC_PSIGNW, - ZYDIS_MNEMONIC_PSLLD, - ZYDIS_MNEMONIC_PSLLDQ, - ZYDIS_MNEMONIC_PSLLQ, - ZYDIS_MNEMONIC_PSLLW, - ZYDIS_MNEMONIC_PSRAD, - ZYDIS_MNEMONIC_PSRAW, - ZYDIS_MNEMONIC_PSRLD, - ZYDIS_MNEMONIC_PSRLDQ, - ZYDIS_MNEMONIC_PSRLQ, - ZYDIS_MNEMONIC_PSRLW, - ZYDIS_MNEMONIC_PSUBB, - ZYDIS_MNEMONIC_PSUBD, - ZYDIS_MNEMONIC_PSUBQ, - ZYDIS_MNEMONIC_PSUBSB, - ZYDIS_MNEMONIC_PSUBSW, - ZYDIS_MNEMONIC_PSUBUSB, - ZYDIS_MNEMONIC_PSUBUSW, - ZYDIS_MNEMONIC_PSUBW, - ZYDIS_MNEMONIC_PSWAPD, - ZYDIS_MNEMONIC_PTEST, - ZYDIS_MNEMONIC_PTWRITE, - ZYDIS_MNEMONIC_PUNPCKHBW, - ZYDIS_MNEMONIC_PUNPCKHDQ, - ZYDIS_MNEMONIC_PUNPCKHQDQ, - ZYDIS_MNEMONIC_PUNPCKHWD, - ZYDIS_MNEMONIC_PUNPCKLBW, - ZYDIS_MNEMONIC_PUNPCKLDQ, - ZYDIS_MNEMONIC_PUNPCKLQDQ, - ZYDIS_MNEMONIC_PUNPCKLWD, - ZYDIS_MNEMONIC_PUSH, - ZYDIS_MNEMONIC_PUSHA, - ZYDIS_MNEMONIC_PUSHAD, - ZYDIS_MNEMONIC_PUSHF, - ZYDIS_MNEMONIC_PUSHFD, - ZYDIS_MNEMONIC_PUSHFQ, - ZYDIS_MNEMONIC_PXOR, - ZYDIS_MNEMONIC_RCL, - ZYDIS_MNEMONIC_RCPPS, - ZYDIS_MNEMONIC_RCPSS, - ZYDIS_MNEMONIC_RCR, - ZYDIS_MNEMONIC_RDFSBASE, - ZYDIS_MNEMONIC_RDGSBASE, - ZYDIS_MNEMONIC_RDMSR, - ZYDIS_MNEMONIC_RDPID, - ZYDIS_MNEMONIC_RDPKRU, - ZYDIS_MNEMONIC_RDPMC, - ZYDIS_MNEMONIC_RDRAND, - ZYDIS_MNEMONIC_RDSEED, - ZYDIS_MNEMONIC_RDSSPD, - ZYDIS_MNEMONIC_RDSSPQ, - ZYDIS_MNEMONIC_RDTSC, - ZYDIS_MNEMONIC_RDTSCP, - ZYDIS_MNEMONIC_RET, - ZYDIS_MNEMONIC_ROL, - ZYDIS_MNEMONIC_ROR, - ZYDIS_MNEMONIC_RORX, - ZYDIS_MNEMONIC_ROUNDPD, - ZYDIS_MNEMONIC_ROUNDPS, - ZYDIS_MNEMONIC_ROUNDSD, - ZYDIS_MNEMONIC_ROUNDSS, - ZYDIS_MNEMONIC_RSM, - ZYDIS_MNEMONIC_RSQRTPS, - ZYDIS_MNEMONIC_RSQRTSS, - ZYDIS_MNEMONIC_RSTORSSP, - ZYDIS_MNEMONIC_SAHF, - ZYDIS_MNEMONIC_SALC, - ZYDIS_MNEMONIC_SAR, - ZYDIS_MNEMONIC_SARX, - ZYDIS_MNEMONIC_SAVESSP, - ZYDIS_MNEMONIC_SBB, - ZYDIS_MNEMONIC_SCASB, - ZYDIS_MNEMONIC_SCASD, - ZYDIS_MNEMONIC_SCASQ, - ZYDIS_MNEMONIC_SCASW, - ZYDIS_MNEMONIC_SETB, - ZYDIS_MNEMONIC_SETBE, - ZYDIS_MNEMONIC_SETL, - ZYDIS_MNEMONIC_SETLE, - ZYDIS_MNEMONIC_SETNB, - ZYDIS_MNEMONIC_SETNBE, - ZYDIS_MNEMONIC_SETNL, - ZYDIS_MNEMONIC_SETNLE, - ZYDIS_MNEMONIC_SETNO, - ZYDIS_MNEMONIC_SETNP, - ZYDIS_MNEMONIC_SETNS, - ZYDIS_MNEMONIC_SETNZ, - ZYDIS_MNEMONIC_SETO, - ZYDIS_MNEMONIC_SETP, - ZYDIS_MNEMONIC_SETS, - ZYDIS_MNEMONIC_SETSSBSY, - ZYDIS_MNEMONIC_SETZ, - ZYDIS_MNEMONIC_SFENCE, - ZYDIS_MNEMONIC_SGDT, - ZYDIS_MNEMONIC_SHA1MSG1, - ZYDIS_MNEMONIC_SHA1MSG2, - ZYDIS_MNEMONIC_SHA1NEXTE, - ZYDIS_MNEMONIC_SHA1RNDS4, - ZYDIS_MNEMONIC_SHA256MSG1, - ZYDIS_MNEMONIC_SHA256MSG2, - ZYDIS_MNEMONIC_SHA256RNDS2, - ZYDIS_MNEMONIC_SHL, - ZYDIS_MNEMONIC_SHLD, - ZYDIS_MNEMONIC_SHLX, - ZYDIS_MNEMONIC_SHR, - ZYDIS_MNEMONIC_SHRD, - ZYDIS_MNEMONIC_SHRX, - ZYDIS_MNEMONIC_SHUFPD, - ZYDIS_MNEMONIC_SHUFPS, - ZYDIS_MNEMONIC_SIDT, - ZYDIS_MNEMONIC_SKINIT, - ZYDIS_MNEMONIC_SLDT, - ZYDIS_MNEMONIC_SLWPCB, - ZYDIS_MNEMONIC_SMSW, - ZYDIS_MNEMONIC_SPFLT, - ZYDIS_MNEMONIC_SQRTPD, - ZYDIS_MNEMONIC_SQRTPS, - ZYDIS_MNEMONIC_SQRTSD, - ZYDIS_MNEMONIC_SQRTSS, - ZYDIS_MNEMONIC_STAC, - ZYDIS_MNEMONIC_STC, - ZYDIS_MNEMONIC_STD, - ZYDIS_MNEMONIC_STGI, - ZYDIS_MNEMONIC_STI, - ZYDIS_MNEMONIC_STMXCSR, - ZYDIS_MNEMONIC_STOSB, - ZYDIS_MNEMONIC_STOSD, - ZYDIS_MNEMONIC_STOSQ, - ZYDIS_MNEMONIC_STOSW, - ZYDIS_MNEMONIC_STR, - ZYDIS_MNEMONIC_SUB, - ZYDIS_MNEMONIC_SUBPD, - ZYDIS_MNEMONIC_SUBPS, - ZYDIS_MNEMONIC_SUBSD, - ZYDIS_MNEMONIC_SUBSS, - ZYDIS_MNEMONIC_SWAPGS, - ZYDIS_MNEMONIC_SYSCALL, - ZYDIS_MNEMONIC_SYSENTER, - ZYDIS_MNEMONIC_SYSEXIT, - ZYDIS_MNEMONIC_SYSRET, - ZYDIS_MNEMONIC_T1MSKC, - ZYDIS_MNEMONIC_TEST, - ZYDIS_MNEMONIC_TZCNT, - ZYDIS_MNEMONIC_TZCNTI, - ZYDIS_MNEMONIC_TZMSK, - ZYDIS_MNEMONIC_UCOMISD, - ZYDIS_MNEMONIC_UCOMISS, - ZYDIS_MNEMONIC_UD0, - ZYDIS_MNEMONIC_UD1, - ZYDIS_MNEMONIC_UD2, - ZYDIS_MNEMONIC_UNPCKHPD, - ZYDIS_MNEMONIC_UNPCKHPS, - ZYDIS_MNEMONIC_UNPCKLPD, - ZYDIS_MNEMONIC_UNPCKLPS, - ZYDIS_MNEMONIC_V4FMADDPS, - ZYDIS_MNEMONIC_V4FMADDSS, - ZYDIS_MNEMONIC_V4FNMADDPS, - ZYDIS_MNEMONIC_V4FNMADDSS, - ZYDIS_MNEMONIC_VADDNPD, - ZYDIS_MNEMONIC_VADDNPS, - ZYDIS_MNEMONIC_VADDPD, - ZYDIS_MNEMONIC_VADDPS, - ZYDIS_MNEMONIC_VADDSD, - ZYDIS_MNEMONIC_VADDSETSPS, - ZYDIS_MNEMONIC_VADDSS, - ZYDIS_MNEMONIC_VADDSUBPD, - ZYDIS_MNEMONIC_VADDSUBPS, - ZYDIS_MNEMONIC_VAESDEC, - ZYDIS_MNEMONIC_VAESDECLAST, - ZYDIS_MNEMONIC_VAESENC, - ZYDIS_MNEMONIC_VAESENCLAST, - ZYDIS_MNEMONIC_VAESIMC, - ZYDIS_MNEMONIC_VAESKEYGENASSIST, - ZYDIS_MNEMONIC_VALIGND, - ZYDIS_MNEMONIC_VALIGNQ, - ZYDIS_MNEMONIC_VANDNPD, - ZYDIS_MNEMONIC_VANDNPS, - ZYDIS_MNEMONIC_VANDPD, - ZYDIS_MNEMONIC_VANDPS, - ZYDIS_MNEMONIC_VBLENDMPD, - ZYDIS_MNEMONIC_VBLENDMPS, - ZYDIS_MNEMONIC_VBLENDPD, - ZYDIS_MNEMONIC_VBLENDPS, - ZYDIS_MNEMONIC_VBLENDVPD, - ZYDIS_MNEMONIC_VBLENDVPS, - ZYDIS_MNEMONIC_VBROADCASTF128, - ZYDIS_MNEMONIC_VBROADCASTF32X2, - ZYDIS_MNEMONIC_VBROADCASTF32X4, - ZYDIS_MNEMONIC_VBROADCASTF32X8, - ZYDIS_MNEMONIC_VBROADCASTF64X2, - ZYDIS_MNEMONIC_VBROADCASTF64X4, - ZYDIS_MNEMONIC_VBROADCASTI128, - ZYDIS_MNEMONIC_VBROADCASTI32X2, - ZYDIS_MNEMONIC_VBROADCASTI32X4, - ZYDIS_MNEMONIC_VBROADCASTI32X8, - ZYDIS_MNEMONIC_VBROADCASTI64X2, - ZYDIS_MNEMONIC_VBROADCASTI64X4, - ZYDIS_MNEMONIC_VBROADCASTSD, - ZYDIS_MNEMONIC_VBROADCASTSS, - ZYDIS_MNEMONIC_VCMPPD, - ZYDIS_MNEMONIC_VCMPPS, - ZYDIS_MNEMONIC_VCMPSD, - ZYDIS_MNEMONIC_VCMPSS, - ZYDIS_MNEMONIC_VCOMISD, - ZYDIS_MNEMONIC_VCOMISS, - ZYDIS_MNEMONIC_VCOMPRESSPD, - ZYDIS_MNEMONIC_VCOMPRESSPS, - ZYDIS_MNEMONIC_VCVTDQ2PD, - ZYDIS_MNEMONIC_VCVTDQ2PS, - ZYDIS_MNEMONIC_VCVTFXPNTDQ2PS, - ZYDIS_MNEMONIC_VCVTFXPNTPD2DQ, - ZYDIS_MNEMONIC_VCVTFXPNTPD2UDQ, - ZYDIS_MNEMONIC_VCVTFXPNTPS2DQ, - ZYDIS_MNEMONIC_VCVTFXPNTPS2UDQ, - ZYDIS_MNEMONIC_VCVTFXPNTUDQ2PS, - ZYDIS_MNEMONIC_VCVTPD2DQ, - ZYDIS_MNEMONIC_VCVTPD2PS, - ZYDIS_MNEMONIC_VCVTPD2QQ, - ZYDIS_MNEMONIC_VCVTPD2UDQ, - ZYDIS_MNEMONIC_VCVTPD2UQQ, - ZYDIS_MNEMONIC_VCVTPH2PS, - ZYDIS_MNEMONIC_VCVTPS2DQ, - ZYDIS_MNEMONIC_VCVTPS2PD, - ZYDIS_MNEMONIC_VCVTPS2PH, - ZYDIS_MNEMONIC_VCVTPS2QQ, - ZYDIS_MNEMONIC_VCVTPS2UDQ, - ZYDIS_MNEMONIC_VCVTPS2UQQ, - ZYDIS_MNEMONIC_VCVTQQ2PD, - ZYDIS_MNEMONIC_VCVTQQ2PS, - ZYDIS_MNEMONIC_VCVTSD2SI, - ZYDIS_MNEMONIC_VCVTSD2SS, - ZYDIS_MNEMONIC_VCVTSD2USI, - ZYDIS_MNEMONIC_VCVTSI2SD, - ZYDIS_MNEMONIC_VCVTSI2SS, - ZYDIS_MNEMONIC_VCVTSS2SD, - ZYDIS_MNEMONIC_VCVTSS2SI, - ZYDIS_MNEMONIC_VCVTSS2USI, - ZYDIS_MNEMONIC_VCVTTPD2DQ, - ZYDIS_MNEMONIC_VCVTTPD2QQ, - ZYDIS_MNEMONIC_VCVTTPD2UDQ, - ZYDIS_MNEMONIC_VCVTTPD2UQQ, - ZYDIS_MNEMONIC_VCVTTPS2DQ, - ZYDIS_MNEMONIC_VCVTTPS2QQ, - ZYDIS_MNEMONIC_VCVTTPS2UDQ, - ZYDIS_MNEMONIC_VCVTTPS2UQQ, - ZYDIS_MNEMONIC_VCVTTSD2SI, - ZYDIS_MNEMONIC_VCVTTSD2USI, - ZYDIS_MNEMONIC_VCVTTSS2SI, - ZYDIS_MNEMONIC_VCVTTSS2USI, - ZYDIS_MNEMONIC_VCVTUDQ2PD, - ZYDIS_MNEMONIC_VCVTUDQ2PS, - ZYDIS_MNEMONIC_VCVTUQQ2PD, - ZYDIS_MNEMONIC_VCVTUQQ2PS, - ZYDIS_MNEMONIC_VCVTUSI2SD, - ZYDIS_MNEMONIC_VCVTUSI2SS, - ZYDIS_MNEMONIC_VDBPSADBW, - ZYDIS_MNEMONIC_VDIVPD, - ZYDIS_MNEMONIC_VDIVPS, - ZYDIS_MNEMONIC_VDIVSD, - ZYDIS_MNEMONIC_VDIVSS, - ZYDIS_MNEMONIC_VDPPD, - ZYDIS_MNEMONIC_VDPPS, - ZYDIS_MNEMONIC_VERR, - ZYDIS_MNEMONIC_VERW, - ZYDIS_MNEMONIC_VEXP223PS, - ZYDIS_MNEMONIC_VEXP2PD, - ZYDIS_MNEMONIC_VEXP2PS, - ZYDIS_MNEMONIC_VEXPANDPD, - ZYDIS_MNEMONIC_VEXPANDPS, - ZYDIS_MNEMONIC_VEXTRACTF128, - ZYDIS_MNEMONIC_VEXTRACTF32X4, - ZYDIS_MNEMONIC_VEXTRACTF32X8, - ZYDIS_MNEMONIC_VEXTRACTF64X2, - ZYDIS_MNEMONIC_VEXTRACTF64X4, - ZYDIS_MNEMONIC_VEXTRACTI128, - ZYDIS_MNEMONIC_VEXTRACTI32X4, - ZYDIS_MNEMONIC_VEXTRACTI32X8, - ZYDIS_MNEMONIC_VEXTRACTI64X2, - ZYDIS_MNEMONIC_VEXTRACTI64X4, - ZYDIS_MNEMONIC_VEXTRACTPS, - ZYDIS_MNEMONIC_VFIXUPIMMPD, - ZYDIS_MNEMONIC_VFIXUPIMMPS, - ZYDIS_MNEMONIC_VFIXUPIMMSD, - ZYDIS_MNEMONIC_VFIXUPIMMSS, - ZYDIS_MNEMONIC_VFIXUPNANPD, - ZYDIS_MNEMONIC_VFIXUPNANPS, - ZYDIS_MNEMONIC_VFMADD132PD, - ZYDIS_MNEMONIC_VFMADD132PS, - ZYDIS_MNEMONIC_VFMADD132SD, - ZYDIS_MNEMONIC_VFMADD132SS, - ZYDIS_MNEMONIC_VFMADD213PD, - ZYDIS_MNEMONIC_VFMADD213PS, - ZYDIS_MNEMONIC_VFMADD213SD, - ZYDIS_MNEMONIC_VFMADD213SS, - ZYDIS_MNEMONIC_VFMADD231PD, - ZYDIS_MNEMONIC_VFMADD231PS, - ZYDIS_MNEMONIC_VFMADD231SD, - ZYDIS_MNEMONIC_VFMADD231SS, - ZYDIS_MNEMONIC_VFMADD233PS, - ZYDIS_MNEMONIC_VFMADDPD, - ZYDIS_MNEMONIC_VFMADDPS, - ZYDIS_MNEMONIC_VFMADDSD, - ZYDIS_MNEMONIC_VFMADDSS, - ZYDIS_MNEMONIC_VFMADDSUB132PD, - ZYDIS_MNEMONIC_VFMADDSUB132PS, - ZYDIS_MNEMONIC_VFMADDSUB213PD, - ZYDIS_MNEMONIC_VFMADDSUB213PS, - ZYDIS_MNEMONIC_VFMADDSUB231PD, - ZYDIS_MNEMONIC_VFMADDSUB231PS, - ZYDIS_MNEMONIC_VFMADDSUBPD, - ZYDIS_MNEMONIC_VFMADDSUBPS, - ZYDIS_MNEMONIC_VFMSUB132PD, - ZYDIS_MNEMONIC_VFMSUB132PS, - ZYDIS_MNEMONIC_VFMSUB132SD, - ZYDIS_MNEMONIC_VFMSUB132SS, - ZYDIS_MNEMONIC_VFMSUB213PD, - ZYDIS_MNEMONIC_VFMSUB213PS, - ZYDIS_MNEMONIC_VFMSUB213SD, - ZYDIS_MNEMONIC_VFMSUB213SS, - ZYDIS_MNEMONIC_VFMSUB231PD, - ZYDIS_MNEMONIC_VFMSUB231PS, - ZYDIS_MNEMONIC_VFMSUB231SD, - ZYDIS_MNEMONIC_VFMSUB231SS, - ZYDIS_MNEMONIC_VFMSUBADD132PD, - ZYDIS_MNEMONIC_VFMSUBADD132PS, - ZYDIS_MNEMONIC_VFMSUBADD213PD, - ZYDIS_MNEMONIC_VFMSUBADD213PS, - ZYDIS_MNEMONIC_VFMSUBADD231PD, - ZYDIS_MNEMONIC_VFMSUBADD231PS, - ZYDIS_MNEMONIC_VFMSUBADDPD, - ZYDIS_MNEMONIC_VFMSUBADDPS, - ZYDIS_MNEMONIC_VFMSUBPD, - ZYDIS_MNEMONIC_VFMSUBPS, - ZYDIS_MNEMONIC_VFMSUBSD, - ZYDIS_MNEMONIC_VFMSUBSS, - ZYDIS_MNEMONIC_VFNMADD132PD, - ZYDIS_MNEMONIC_VFNMADD132PS, - ZYDIS_MNEMONIC_VFNMADD132SD, - ZYDIS_MNEMONIC_VFNMADD132SS, - ZYDIS_MNEMONIC_VFNMADD213PD, - ZYDIS_MNEMONIC_VFNMADD213PS, - ZYDIS_MNEMONIC_VFNMADD213SD, - ZYDIS_MNEMONIC_VFNMADD213SS, - ZYDIS_MNEMONIC_VFNMADD231PD, - ZYDIS_MNEMONIC_VFNMADD231PS, - ZYDIS_MNEMONIC_VFNMADD231SD, - ZYDIS_MNEMONIC_VFNMADD231SS, - ZYDIS_MNEMONIC_VFNMADDPD, - ZYDIS_MNEMONIC_VFNMADDPS, - ZYDIS_MNEMONIC_VFNMADDSD, - ZYDIS_MNEMONIC_VFNMADDSS, - ZYDIS_MNEMONIC_VFNMSUB132PD, - ZYDIS_MNEMONIC_VFNMSUB132PS, - ZYDIS_MNEMONIC_VFNMSUB132SD, - ZYDIS_MNEMONIC_VFNMSUB132SS, - ZYDIS_MNEMONIC_VFNMSUB213PD, - ZYDIS_MNEMONIC_VFNMSUB213PS, - ZYDIS_MNEMONIC_VFNMSUB213SD, - ZYDIS_MNEMONIC_VFNMSUB213SS, - ZYDIS_MNEMONIC_VFNMSUB231PD, - ZYDIS_MNEMONIC_VFNMSUB231PS, - ZYDIS_MNEMONIC_VFNMSUB231SD, - ZYDIS_MNEMONIC_VFNMSUB231SS, - ZYDIS_MNEMONIC_VFNMSUBPD, - ZYDIS_MNEMONIC_VFNMSUBPS, - ZYDIS_MNEMONIC_VFNMSUBSD, - ZYDIS_MNEMONIC_VFNMSUBSS, - ZYDIS_MNEMONIC_VFPCLASSPD, - ZYDIS_MNEMONIC_VFPCLASSPS, - ZYDIS_MNEMONIC_VFPCLASSSD, - ZYDIS_MNEMONIC_VFPCLASSSS, - ZYDIS_MNEMONIC_VFRCZPD, - ZYDIS_MNEMONIC_VFRCZPS, - ZYDIS_MNEMONIC_VFRCZSD, - ZYDIS_MNEMONIC_VFRCZSS, - ZYDIS_MNEMONIC_VGATHERDPD, - ZYDIS_MNEMONIC_VGATHERDPS, - ZYDIS_MNEMONIC_VGATHERPF0DPD, - ZYDIS_MNEMONIC_VGATHERPF0DPS, - ZYDIS_MNEMONIC_VGATHERPF0HINTDPD, - ZYDIS_MNEMONIC_VGATHERPF0HINTDPS, - ZYDIS_MNEMONIC_VGATHERPF0QPD, - ZYDIS_MNEMONIC_VGATHERPF0QPS, - ZYDIS_MNEMONIC_VGATHERPF1DPD, - ZYDIS_MNEMONIC_VGATHERPF1DPS, - ZYDIS_MNEMONIC_VGATHERPF1QPD, - ZYDIS_MNEMONIC_VGATHERPF1QPS, - ZYDIS_MNEMONIC_VGATHERQPD, - ZYDIS_MNEMONIC_VGATHERQPS, - ZYDIS_MNEMONIC_VGETEXPPD, - ZYDIS_MNEMONIC_VGETEXPPS, - ZYDIS_MNEMONIC_VGETEXPSD, - ZYDIS_MNEMONIC_VGETEXPSS, - ZYDIS_MNEMONIC_VGETMANTPD, - ZYDIS_MNEMONIC_VGETMANTPS, - ZYDIS_MNEMONIC_VGETMANTSD, - ZYDIS_MNEMONIC_VGETMANTSS, - ZYDIS_MNEMONIC_VGF2P8AFFINEINVQB, - ZYDIS_MNEMONIC_VGF2P8AFFINEQB, - ZYDIS_MNEMONIC_VGF2P8MULB, - ZYDIS_MNEMONIC_VGMAXABSPS, - ZYDIS_MNEMONIC_VGMAXPD, - ZYDIS_MNEMONIC_VGMAXPS, - ZYDIS_MNEMONIC_VGMINPD, - ZYDIS_MNEMONIC_VGMINPS, - ZYDIS_MNEMONIC_VHADDPD, - ZYDIS_MNEMONIC_VHADDPS, - ZYDIS_MNEMONIC_VHSUBPD, - ZYDIS_MNEMONIC_VHSUBPS, - ZYDIS_MNEMONIC_VINSERTF128, - ZYDIS_MNEMONIC_VINSERTF32X4, - ZYDIS_MNEMONIC_VINSERTF32X8, - ZYDIS_MNEMONIC_VINSERTF64X2, - ZYDIS_MNEMONIC_VINSERTF64X4, - ZYDIS_MNEMONIC_VINSERTI128, - ZYDIS_MNEMONIC_VINSERTI32X4, - ZYDIS_MNEMONIC_VINSERTI32X8, - ZYDIS_MNEMONIC_VINSERTI64X2, - ZYDIS_MNEMONIC_VINSERTI64X4, - ZYDIS_MNEMONIC_VINSERTPS, - ZYDIS_MNEMONIC_VLDDQU, - ZYDIS_MNEMONIC_VLDMXCSR, - ZYDIS_MNEMONIC_VLOADUNPACKHD, - ZYDIS_MNEMONIC_VLOADUNPACKHPD, - ZYDIS_MNEMONIC_VLOADUNPACKHPS, - ZYDIS_MNEMONIC_VLOADUNPACKHQ, - ZYDIS_MNEMONIC_VLOADUNPACKLD, - ZYDIS_MNEMONIC_VLOADUNPACKLPD, - ZYDIS_MNEMONIC_VLOADUNPACKLPS, - ZYDIS_MNEMONIC_VLOADUNPACKLQ, - ZYDIS_MNEMONIC_VLOG2PS, - ZYDIS_MNEMONIC_VMASKMOVDQU, - ZYDIS_MNEMONIC_VMASKMOVPD, - ZYDIS_MNEMONIC_VMASKMOVPS, - ZYDIS_MNEMONIC_VMAXPD, - ZYDIS_MNEMONIC_VMAXPS, - ZYDIS_MNEMONIC_VMAXSD, - ZYDIS_MNEMONIC_VMAXSS, - ZYDIS_MNEMONIC_VMCALL, - ZYDIS_MNEMONIC_VMCLEAR, - ZYDIS_MNEMONIC_VMFUNC, - ZYDIS_MNEMONIC_VMINPD, - ZYDIS_MNEMONIC_VMINPS, - ZYDIS_MNEMONIC_VMINSD, - ZYDIS_MNEMONIC_VMINSS, - ZYDIS_MNEMONIC_VMLAUNCH, - ZYDIS_MNEMONIC_VMLOAD, - ZYDIS_MNEMONIC_VMMCALL, - ZYDIS_MNEMONIC_VMOVAPD, - ZYDIS_MNEMONIC_VMOVAPS, - ZYDIS_MNEMONIC_VMOVD, - ZYDIS_MNEMONIC_VMOVDDUP, - ZYDIS_MNEMONIC_VMOVDQA, - ZYDIS_MNEMONIC_VMOVDQA32, - ZYDIS_MNEMONIC_VMOVDQA64, - ZYDIS_MNEMONIC_VMOVDQU, - ZYDIS_MNEMONIC_VMOVDQU16, - ZYDIS_MNEMONIC_VMOVDQU32, - ZYDIS_MNEMONIC_VMOVDQU64, - ZYDIS_MNEMONIC_VMOVDQU8, - ZYDIS_MNEMONIC_VMOVHLPS, - ZYDIS_MNEMONIC_VMOVHPD, - ZYDIS_MNEMONIC_VMOVHPS, - ZYDIS_MNEMONIC_VMOVLHPS, - ZYDIS_MNEMONIC_VMOVLPD, - ZYDIS_MNEMONIC_VMOVLPS, - ZYDIS_MNEMONIC_VMOVMSKPD, - ZYDIS_MNEMONIC_VMOVMSKPS, - ZYDIS_MNEMONIC_VMOVNRAPD, - ZYDIS_MNEMONIC_VMOVNRAPS, - ZYDIS_MNEMONIC_VMOVNRNGOAPD, - ZYDIS_MNEMONIC_VMOVNRNGOAPS, - ZYDIS_MNEMONIC_VMOVNTDQ, - ZYDIS_MNEMONIC_VMOVNTDQA, - ZYDIS_MNEMONIC_VMOVNTPD, - ZYDIS_MNEMONIC_VMOVNTPS, - ZYDIS_MNEMONIC_VMOVQ, - ZYDIS_MNEMONIC_VMOVSD, - ZYDIS_MNEMONIC_VMOVSHDUP, - ZYDIS_MNEMONIC_VMOVSLDUP, - ZYDIS_MNEMONIC_VMOVSS, - ZYDIS_MNEMONIC_VMOVUPD, - ZYDIS_MNEMONIC_VMOVUPS, - ZYDIS_MNEMONIC_VMPSADBW, - ZYDIS_MNEMONIC_VMPTRLD, - ZYDIS_MNEMONIC_VMPTRST, - ZYDIS_MNEMONIC_VMREAD, - ZYDIS_MNEMONIC_VMRESUME, - ZYDIS_MNEMONIC_VMRUN, - ZYDIS_MNEMONIC_VMSAVE, - ZYDIS_MNEMONIC_VMULPD, - ZYDIS_MNEMONIC_VMULPS, - ZYDIS_MNEMONIC_VMULSD, - ZYDIS_MNEMONIC_VMULSS, - ZYDIS_MNEMONIC_VMWRITE, - ZYDIS_MNEMONIC_VMXOFF, - ZYDIS_MNEMONIC_VMXON, - ZYDIS_MNEMONIC_VORPD, - ZYDIS_MNEMONIC_VORPS, - ZYDIS_MNEMONIC_VP4DPWSSD, - ZYDIS_MNEMONIC_VP4DPWSSDS, - ZYDIS_MNEMONIC_VPABSB, - ZYDIS_MNEMONIC_VPABSD, - ZYDIS_MNEMONIC_VPABSQ, - ZYDIS_MNEMONIC_VPABSW, - ZYDIS_MNEMONIC_VPACKSSDW, - ZYDIS_MNEMONIC_VPACKSSWB, - ZYDIS_MNEMONIC_VPACKSTOREHD, - ZYDIS_MNEMONIC_VPACKSTOREHPD, - ZYDIS_MNEMONIC_VPACKSTOREHPS, - ZYDIS_MNEMONIC_VPACKSTOREHQ, - ZYDIS_MNEMONIC_VPACKSTORELD, - ZYDIS_MNEMONIC_VPACKSTORELPD, - ZYDIS_MNEMONIC_VPACKSTORELPS, - ZYDIS_MNEMONIC_VPACKSTORELQ, - ZYDIS_MNEMONIC_VPACKUSDW, - ZYDIS_MNEMONIC_VPACKUSWB, - ZYDIS_MNEMONIC_VPADCD, - ZYDIS_MNEMONIC_VPADDB, - ZYDIS_MNEMONIC_VPADDD, - ZYDIS_MNEMONIC_VPADDQ, - ZYDIS_MNEMONIC_VPADDSB, - ZYDIS_MNEMONIC_VPADDSETCD, - ZYDIS_MNEMONIC_VPADDSETSD, - ZYDIS_MNEMONIC_VPADDSW, - ZYDIS_MNEMONIC_VPADDUSB, - ZYDIS_MNEMONIC_VPADDUSW, - ZYDIS_MNEMONIC_VPADDW, - ZYDIS_MNEMONIC_VPALIGNR, - ZYDIS_MNEMONIC_VPAND, - ZYDIS_MNEMONIC_VPANDD, - ZYDIS_MNEMONIC_VPANDN, - ZYDIS_MNEMONIC_VPANDND, - ZYDIS_MNEMONIC_VPANDNQ, - ZYDIS_MNEMONIC_VPANDQ, - ZYDIS_MNEMONIC_VPAVGB, - ZYDIS_MNEMONIC_VPAVGW, - ZYDIS_MNEMONIC_VPBLENDD, - ZYDIS_MNEMONIC_VPBLENDMB, - ZYDIS_MNEMONIC_VPBLENDMD, - ZYDIS_MNEMONIC_VPBLENDMQ, - ZYDIS_MNEMONIC_VPBLENDMW, - ZYDIS_MNEMONIC_VPBLENDVB, - ZYDIS_MNEMONIC_VPBLENDW, - ZYDIS_MNEMONIC_VPBROADCASTB, - ZYDIS_MNEMONIC_VPBROADCASTD, - ZYDIS_MNEMONIC_VPBROADCASTMB2Q, - ZYDIS_MNEMONIC_VPBROADCASTMW2D, - ZYDIS_MNEMONIC_VPBROADCASTQ, - ZYDIS_MNEMONIC_VPBROADCASTW, - ZYDIS_MNEMONIC_VPCLMULQDQ, - ZYDIS_MNEMONIC_VPCMOV, - ZYDIS_MNEMONIC_VPCMPB, - ZYDIS_MNEMONIC_VPCMPD, - ZYDIS_MNEMONIC_VPCMPEQB, - ZYDIS_MNEMONIC_VPCMPEQD, - ZYDIS_MNEMONIC_VPCMPEQQ, - ZYDIS_MNEMONIC_VPCMPEQW, - ZYDIS_MNEMONIC_VPCMPESTRI, - ZYDIS_MNEMONIC_VPCMPESTRM, - ZYDIS_MNEMONIC_VPCMPGTB, - ZYDIS_MNEMONIC_VPCMPGTD, - ZYDIS_MNEMONIC_VPCMPGTQ, - ZYDIS_MNEMONIC_VPCMPGTW, - ZYDIS_MNEMONIC_VPCMPISTRI, - ZYDIS_MNEMONIC_VPCMPISTRM, - ZYDIS_MNEMONIC_VPCMPLTD, - ZYDIS_MNEMONIC_VPCMPQ, - ZYDIS_MNEMONIC_VPCMPUB, - ZYDIS_MNEMONIC_VPCMPUD, - ZYDIS_MNEMONIC_VPCMPUQ, - ZYDIS_MNEMONIC_VPCMPUW, - ZYDIS_MNEMONIC_VPCMPW, - ZYDIS_MNEMONIC_VPCOMB, - ZYDIS_MNEMONIC_VPCOMD, - ZYDIS_MNEMONIC_VPCOMPRESSB, - ZYDIS_MNEMONIC_VPCOMPRESSD, - ZYDIS_MNEMONIC_VPCOMPRESSQ, - ZYDIS_MNEMONIC_VPCOMPRESSW, - ZYDIS_MNEMONIC_VPCOMQ, - ZYDIS_MNEMONIC_VPCOMUB, - ZYDIS_MNEMONIC_VPCOMUD, - ZYDIS_MNEMONIC_VPCOMUQ, - ZYDIS_MNEMONIC_VPCOMUW, - ZYDIS_MNEMONIC_VPCOMW, - ZYDIS_MNEMONIC_VPCONFLICTD, - ZYDIS_MNEMONIC_VPCONFLICTQ, - ZYDIS_MNEMONIC_VPDPBUSD, - ZYDIS_MNEMONIC_VPDPBUSDS, - ZYDIS_MNEMONIC_VPDPWSSD, - ZYDIS_MNEMONIC_VPDPWSSDS, - ZYDIS_MNEMONIC_VPERM2F128, - ZYDIS_MNEMONIC_VPERM2I128, - ZYDIS_MNEMONIC_VPERMB, - ZYDIS_MNEMONIC_VPERMD, - ZYDIS_MNEMONIC_VPERMF32X4, - ZYDIS_MNEMONIC_VPERMI2B, - ZYDIS_MNEMONIC_VPERMI2D, - ZYDIS_MNEMONIC_VPERMI2PD, - ZYDIS_MNEMONIC_VPERMI2PS, - ZYDIS_MNEMONIC_VPERMI2Q, - ZYDIS_MNEMONIC_VPERMI2W, - ZYDIS_MNEMONIC_VPERMIL2PD, - ZYDIS_MNEMONIC_VPERMIL2PS, - ZYDIS_MNEMONIC_VPERMILPD, - ZYDIS_MNEMONIC_VPERMILPS, - ZYDIS_MNEMONIC_VPERMPD, - ZYDIS_MNEMONIC_VPERMPS, - ZYDIS_MNEMONIC_VPERMQ, - ZYDIS_MNEMONIC_VPERMT2B, - ZYDIS_MNEMONIC_VPERMT2D, - ZYDIS_MNEMONIC_VPERMT2PD, - ZYDIS_MNEMONIC_VPERMT2PS, - ZYDIS_MNEMONIC_VPERMT2Q, - ZYDIS_MNEMONIC_VPERMT2W, - ZYDIS_MNEMONIC_VPERMW, - ZYDIS_MNEMONIC_VPEXPANDB, - ZYDIS_MNEMONIC_VPEXPANDD, - ZYDIS_MNEMONIC_VPEXPANDQ, - ZYDIS_MNEMONIC_VPEXPANDW, - ZYDIS_MNEMONIC_VPEXTRB, - ZYDIS_MNEMONIC_VPEXTRD, - ZYDIS_MNEMONIC_VPEXTRQ, - ZYDIS_MNEMONIC_VPEXTRW, - ZYDIS_MNEMONIC_VPGATHERDD, - ZYDIS_MNEMONIC_VPGATHERDQ, - ZYDIS_MNEMONIC_VPGATHERQD, - ZYDIS_MNEMONIC_VPGATHERQQ, - ZYDIS_MNEMONIC_VPHADDBD, - ZYDIS_MNEMONIC_VPHADDBQ, - ZYDIS_MNEMONIC_VPHADDBW, - ZYDIS_MNEMONIC_VPHADDD, - ZYDIS_MNEMONIC_VPHADDDQ, - ZYDIS_MNEMONIC_VPHADDSW, - ZYDIS_MNEMONIC_VPHADDUBD, - ZYDIS_MNEMONIC_VPHADDUBQ, - ZYDIS_MNEMONIC_VPHADDUBW, - ZYDIS_MNEMONIC_VPHADDUDQ, - ZYDIS_MNEMONIC_VPHADDUWD, - ZYDIS_MNEMONIC_VPHADDUWQ, - ZYDIS_MNEMONIC_VPHADDW, - ZYDIS_MNEMONIC_VPHADDWD, - ZYDIS_MNEMONIC_VPHADDWQ, - ZYDIS_MNEMONIC_VPHMINPOSUW, - ZYDIS_MNEMONIC_VPHSUBBW, - ZYDIS_MNEMONIC_VPHSUBD, - ZYDIS_MNEMONIC_VPHSUBDQ, - ZYDIS_MNEMONIC_VPHSUBSW, - ZYDIS_MNEMONIC_VPHSUBW, - ZYDIS_MNEMONIC_VPHSUBWD, - ZYDIS_MNEMONIC_VPINSRB, - ZYDIS_MNEMONIC_VPINSRD, - ZYDIS_MNEMONIC_VPINSRQ, - ZYDIS_MNEMONIC_VPINSRW, - ZYDIS_MNEMONIC_VPLZCNTD, - ZYDIS_MNEMONIC_VPLZCNTQ, - ZYDIS_MNEMONIC_VPMACSDD, - ZYDIS_MNEMONIC_VPMACSDQH, - ZYDIS_MNEMONIC_VPMACSDQL, - ZYDIS_MNEMONIC_VPMACSSDD, - ZYDIS_MNEMONIC_VPMACSSDQH, - ZYDIS_MNEMONIC_VPMACSSDQL, - ZYDIS_MNEMONIC_VPMACSSWD, - ZYDIS_MNEMONIC_VPMACSSWW, - ZYDIS_MNEMONIC_VPMACSWD, - ZYDIS_MNEMONIC_VPMACSWW, - ZYDIS_MNEMONIC_VPMADCSSWD, - ZYDIS_MNEMONIC_VPMADCSWD, - ZYDIS_MNEMONIC_VPMADD231D, - ZYDIS_MNEMONIC_VPMADD233D, - ZYDIS_MNEMONIC_VPMADD52HUQ, - ZYDIS_MNEMONIC_VPMADD52LUQ, - ZYDIS_MNEMONIC_VPMADDUBSW, - ZYDIS_MNEMONIC_VPMADDWD, - ZYDIS_MNEMONIC_VPMASKMOVD, - ZYDIS_MNEMONIC_VPMASKMOVQ, - ZYDIS_MNEMONIC_VPMAXSB, - ZYDIS_MNEMONIC_VPMAXSD, - ZYDIS_MNEMONIC_VPMAXSQ, - ZYDIS_MNEMONIC_VPMAXSW, - ZYDIS_MNEMONIC_VPMAXUB, - ZYDIS_MNEMONIC_VPMAXUD, - ZYDIS_MNEMONIC_VPMAXUQ, - ZYDIS_MNEMONIC_VPMAXUW, - ZYDIS_MNEMONIC_VPMINSB, - ZYDIS_MNEMONIC_VPMINSD, - ZYDIS_MNEMONIC_VPMINSQ, - ZYDIS_MNEMONIC_VPMINSW, - ZYDIS_MNEMONIC_VPMINUB, - ZYDIS_MNEMONIC_VPMINUD, - ZYDIS_MNEMONIC_VPMINUQ, - ZYDIS_MNEMONIC_VPMINUW, - ZYDIS_MNEMONIC_VPMOVB2M, - ZYDIS_MNEMONIC_VPMOVD2M, - ZYDIS_MNEMONIC_VPMOVDB, - ZYDIS_MNEMONIC_VPMOVDW, - ZYDIS_MNEMONIC_VPMOVM2B, - ZYDIS_MNEMONIC_VPMOVM2D, - ZYDIS_MNEMONIC_VPMOVM2Q, - ZYDIS_MNEMONIC_VPMOVM2W, - ZYDIS_MNEMONIC_VPMOVMSKB, - ZYDIS_MNEMONIC_VPMOVQ2M, - ZYDIS_MNEMONIC_VPMOVQB, - ZYDIS_MNEMONIC_VPMOVQD, - ZYDIS_MNEMONIC_VPMOVQW, - ZYDIS_MNEMONIC_VPMOVSDB, - ZYDIS_MNEMONIC_VPMOVSDW, - ZYDIS_MNEMONIC_VPMOVSQB, - ZYDIS_MNEMONIC_VPMOVSQD, - ZYDIS_MNEMONIC_VPMOVSQW, - ZYDIS_MNEMONIC_VPMOVSWB, - ZYDIS_MNEMONIC_VPMOVSXBD, - ZYDIS_MNEMONIC_VPMOVSXBQ, - ZYDIS_MNEMONIC_VPMOVSXBW, - ZYDIS_MNEMONIC_VPMOVSXDQ, - ZYDIS_MNEMONIC_VPMOVSXWD, - ZYDIS_MNEMONIC_VPMOVSXWQ, - ZYDIS_MNEMONIC_VPMOVUSDB, - ZYDIS_MNEMONIC_VPMOVUSDW, - ZYDIS_MNEMONIC_VPMOVUSQB, - ZYDIS_MNEMONIC_VPMOVUSQD, - ZYDIS_MNEMONIC_VPMOVUSQW, - ZYDIS_MNEMONIC_VPMOVUSWB, - ZYDIS_MNEMONIC_VPMOVW2M, - ZYDIS_MNEMONIC_VPMOVWB, - ZYDIS_MNEMONIC_VPMOVZXBD, - ZYDIS_MNEMONIC_VPMOVZXBQ, - ZYDIS_MNEMONIC_VPMOVZXBW, - ZYDIS_MNEMONIC_VPMOVZXDQ, - ZYDIS_MNEMONIC_VPMOVZXWD, - ZYDIS_MNEMONIC_VPMOVZXWQ, - ZYDIS_MNEMONIC_VPMULDQ, - ZYDIS_MNEMONIC_VPMULHD, - ZYDIS_MNEMONIC_VPMULHRSW, - ZYDIS_MNEMONIC_VPMULHUD, - ZYDIS_MNEMONIC_VPMULHUW, - ZYDIS_MNEMONIC_VPMULHW, - ZYDIS_MNEMONIC_VPMULLD, - ZYDIS_MNEMONIC_VPMULLQ, - ZYDIS_MNEMONIC_VPMULLW, - ZYDIS_MNEMONIC_VPMULTISHIFTQB, - ZYDIS_MNEMONIC_VPMULUDQ, - ZYDIS_MNEMONIC_VPOPCNTB, - ZYDIS_MNEMONIC_VPOPCNTD, - ZYDIS_MNEMONIC_VPOPCNTQ, - ZYDIS_MNEMONIC_VPOPCNTW, - ZYDIS_MNEMONIC_VPOR, - ZYDIS_MNEMONIC_VPORD, - ZYDIS_MNEMONIC_VPORQ, - ZYDIS_MNEMONIC_VPPERM, - ZYDIS_MNEMONIC_VPREFETCH0, - ZYDIS_MNEMONIC_VPREFETCH1, - ZYDIS_MNEMONIC_VPREFETCH2, - ZYDIS_MNEMONIC_VPREFETCHE0, - ZYDIS_MNEMONIC_VPREFETCHE1, - ZYDIS_MNEMONIC_VPREFETCHE2, - ZYDIS_MNEMONIC_VPREFETCHENTA, - ZYDIS_MNEMONIC_VPREFETCHNTA, - ZYDIS_MNEMONIC_VPROLD, - ZYDIS_MNEMONIC_VPROLQ, - ZYDIS_MNEMONIC_VPROLVD, - ZYDIS_MNEMONIC_VPROLVQ, - ZYDIS_MNEMONIC_VPRORD, - ZYDIS_MNEMONIC_VPRORQ, - ZYDIS_MNEMONIC_VPRORVD, - ZYDIS_MNEMONIC_VPRORVQ, - ZYDIS_MNEMONIC_VPROTB, - ZYDIS_MNEMONIC_VPROTD, - ZYDIS_MNEMONIC_VPROTQ, - ZYDIS_MNEMONIC_VPROTW, - ZYDIS_MNEMONIC_VPSADBW, - ZYDIS_MNEMONIC_VPSBBD, - ZYDIS_MNEMONIC_VPSBBRD, - ZYDIS_MNEMONIC_VPSCATTERDD, - ZYDIS_MNEMONIC_VPSCATTERDQ, - ZYDIS_MNEMONIC_VPSCATTERQD, - ZYDIS_MNEMONIC_VPSCATTERQQ, - ZYDIS_MNEMONIC_VPSHAB, - ZYDIS_MNEMONIC_VPSHAD, - ZYDIS_MNEMONIC_VPSHAQ, - ZYDIS_MNEMONIC_VPSHAW, - ZYDIS_MNEMONIC_VPSHLB, - ZYDIS_MNEMONIC_VPSHLD, - ZYDIS_MNEMONIC_VPSHLDD, - ZYDIS_MNEMONIC_VPSHLDQ, - ZYDIS_MNEMONIC_VPSHLDVD, - ZYDIS_MNEMONIC_VPSHLDVQ, - ZYDIS_MNEMONIC_VPSHLDVW, - ZYDIS_MNEMONIC_VPSHLDW, - ZYDIS_MNEMONIC_VPSHLQ, - ZYDIS_MNEMONIC_VPSHLW, - ZYDIS_MNEMONIC_VPSHRDD, - ZYDIS_MNEMONIC_VPSHRDQ, - ZYDIS_MNEMONIC_VPSHRDVD, - ZYDIS_MNEMONIC_VPSHRDVQ, - ZYDIS_MNEMONIC_VPSHRDVW, - ZYDIS_MNEMONIC_VPSHRDW, - ZYDIS_MNEMONIC_VPSHUFB, - ZYDIS_MNEMONIC_VPSHUFBITQMB, - ZYDIS_MNEMONIC_VPSHUFD, - ZYDIS_MNEMONIC_VPSHUFHW, - ZYDIS_MNEMONIC_VPSHUFLW, - ZYDIS_MNEMONIC_VPSIGNB, - ZYDIS_MNEMONIC_VPSIGND, - ZYDIS_MNEMONIC_VPSIGNW, - ZYDIS_MNEMONIC_VPSLLD, - ZYDIS_MNEMONIC_VPSLLDQ, - ZYDIS_MNEMONIC_VPSLLQ, - ZYDIS_MNEMONIC_VPSLLVD, - ZYDIS_MNEMONIC_VPSLLVQ, - ZYDIS_MNEMONIC_VPSLLVW, - ZYDIS_MNEMONIC_VPSLLW, - ZYDIS_MNEMONIC_VPSRAD, - ZYDIS_MNEMONIC_VPSRAQ, - ZYDIS_MNEMONIC_VPSRAVD, - ZYDIS_MNEMONIC_VPSRAVQ, - ZYDIS_MNEMONIC_VPSRAVW, - ZYDIS_MNEMONIC_VPSRAW, - ZYDIS_MNEMONIC_VPSRLD, - ZYDIS_MNEMONIC_VPSRLDQ, - ZYDIS_MNEMONIC_VPSRLQ, - ZYDIS_MNEMONIC_VPSRLVD, - ZYDIS_MNEMONIC_VPSRLVQ, - ZYDIS_MNEMONIC_VPSRLVW, - ZYDIS_MNEMONIC_VPSRLW, - ZYDIS_MNEMONIC_VPSUBB, - ZYDIS_MNEMONIC_VPSUBD, - ZYDIS_MNEMONIC_VPSUBQ, - ZYDIS_MNEMONIC_VPSUBRD, - ZYDIS_MNEMONIC_VPSUBRSETBD, - ZYDIS_MNEMONIC_VPSUBSB, - ZYDIS_MNEMONIC_VPSUBSETBD, - ZYDIS_MNEMONIC_VPSUBSW, - ZYDIS_MNEMONIC_VPSUBUSB, - ZYDIS_MNEMONIC_VPSUBUSW, - ZYDIS_MNEMONIC_VPSUBW, - ZYDIS_MNEMONIC_VPTERNLOGD, - ZYDIS_MNEMONIC_VPTERNLOGQ, - ZYDIS_MNEMONIC_VPTEST, - ZYDIS_MNEMONIC_VPTESTMB, - ZYDIS_MNEMONIC_VPTESTMD, - ZYDIS_MNEMONIC_VPTESTMQ, - ZYDIS_MNEMONIC_VPTESTMW, - ZYDIS_MNEMONIC_VPTESTNMB, - ZYDIS_MNEMONIC_VPTESTNMD, - ZYDIS_MNEMONIC_VPTESTNMQ, - ZYDIS_MNEMONIC_VPTESTNMW, - ZYDIS_MNEMONIC_VPUNPCKHBW, - ZYDIS_MNEMONIC_VPUNPCKHDQ, - ZYDIS_MNEMONIC_VPUNPCKHQDQ, - ZYDIS_MNEMONIC_VPUNPCKHWD, - ZYDIS_MNEMONIC_VPUNPCKLBW, - ZYDIS_MNEMONIC_VPUNPCKLDQ, - ZYDIS_MNEMONIC_VPUNPCKLQDQ, - ZYDIS_MNEMONIC_VPUNPCKLWD, - ZYDIS_MNEMONIC_VPXOR, - ZYDIS_MNEMONIC_VPXORD, - ZYDIS_MNEMONIC_VPXORQ, - ZYDIS_MNEMONIC_VRANGEPD, - ZYDIS_MNEMONIC_VRANGEPS, - ZYDIS_MNEMONIC_VRANGESD, - ZYDIS_MNEMONIC_VRANGESS, - ZYDIS_MNEMONIC_VRCP14PD, - ZYDIS_MNEMONIC_VRCP14PS, - ZYDIS_MNEMONIC_VRCP14SD, - ZYDIS_MNEMONIC_VRCP14SS, - ZYDIS_MNEMONIC_VRCP23PS, - ZYDIS_MNEMONIC_VRCP28PD, - ZYDIS_MNEMONIC_VRCP28PS, - ZYDIS_MNEMONIC_VRCP28SD, - ZYDIS_MNEMONIC_VRCP28SS, - ZYDIS_MNEMONIC_VRCPPS, - ZYDIS_MNEMONIC_VRCPSS, - ZYDIS_MNEMONIC_VREDUCEPD, - ZYDIS_MNEMONIC_VREDUCEPS, - ZYDIS_MNEMONIC_VREDUCESD, - ZYDIS_MNEMONIC_VREDUCESS, - ZYDIS_MNEMONIC_VRNDFXPNTPD, - ZYDIS_MNEMONIC_VRNDFXPNTPS, - ZYDIS_MNEMONIC_VRNDSCALEPD, - ZYDIS_MNEMONIC_VRNDSCALEPS, - ZYDIS_MNEMONIC_VRNDSCALESD, - ZYDIS_MNEMONIC_VRNDSCALESS, - ZYDIS_MNEMONIC_VROUNDPD, - ZYDIS_MNEMONIC_VROUNDPS, - ZYDIS_MNEMONIC_VROUNDSD, - ZYDIS_MNEMONIC_VROUNDSS, - ZYDIS_MNEMONIC_VRSQRT14PD, - ZYDIS_MNEMONIC_VRSQRT14PS, - ZYDIS_MNEMONIC_VRSQRT14SD, - ZYDIS_MNEMONIC_VRSQRT14SS, - ZYDIS_MNEMONIC_VRSQRT23PS, - ZYDIS_MNEMONIC_VRSQRT28PD, - ZYDIS_MNEMONIC_VRSQRT28PS, - ZYDIS_MNEMONIC_VRSQRT28SD, - ZYDIS_MNEMONIC_VRSQRT28SS, - ZYDIS_MNEMONIC_VRSQRTPS, - ZYDIS_MNEMONIC_VRSQRTSS, - ZYDIS_MNEMONIC_VSCALEFPD, - ZYDIS_MNEMONIC_VSCALEFPS, - ZYDIS_MNEMONIC_VSCALEFSD, - ZYDIS_MNEMONIC_VSCALEFSS, - ZYDIS_MNEMONIC_VSCALEPS, - ZYDIS_MNEMONIC_VSCATTERDPD, - ZYDIS_MNEMONIC_VSCATTERDPS, - ZYDIS_MNEMONIC_VSCATTERPF0DPD, - ZYDIS_MNEMONIC_VSCATTERPF0DPS, - ZYDIS_MNEMONIC_VSCATTERPF0HINTDPD, - ZYDIS_MNEMONIC_VSCATTERPF0HINTDPS, - ZYDIS_MNEMONIC_VSCATTERPF0QPD, - ZYDIS_MNEMONIC_VSCATTERPF0QPS, - ZYDIS_MNEMONIC_VSCATTERPF1DPD, - ZYDIS_MNEMONIC_VSCATTERPF1DPS, - ZYDIS_MNEMONIC_VSCATTERPF1QPD, - ZYDIS_MNEMONIC_VSCATTERPF1QPS, - ZYDIS_MNEMONIC_VSCATTERQPD, - ZYDIS_MNEMONIC_VSCATTERQPS, - ZYDIS_MNEMONIC_VSHUFF32X4, - ZYDIS_MNEMONIC_VSHUFF64X2, - ZYDIS_MNEMONIC_VSHUFI32X4, - ZYDIS_MNEMONIC_VSHUFI64X2, - ZYDIS_MNEMONIC_VSHUFPD, - ZYDIS_MNEMONIC_VSHUFPS, - ZYDIS_MNEMONIC_VSQRTPD, - ZYDIS_MNEMONIC_VSQRTPS, - ZYDIS_MNEMONIC_VSQRTSD, - ZYDIS_MNEMONIC_VSQRTSS, - ZYDIS_MNEMONIC_VSTMXCSR, - ZYDIS_MNEMONIC_VSUBPD, - ZYDIS_MNEMONIC_VSUBPS, - ZYDIS_MNEMONIC_VSUBRPD, - ZYDIS_MNEMONIC_VSUBRPS, - ZYDIS_MNEMONIC_VSUBSD, - ZYDIS_MNEMONIC_VSUBSS, - ZYDIS_MNEMONIC_VTESTPD, - ZYDIS_MNEMONIC_VTESTPS, - ZYDIS_MNEMONIC_VUCOMISD, - ZYDIS_MNEMONIC_VUCOMISS, - ZYDIS_MNEMONIC_VUNPCKHPD, - ZYDIS_MNEMONIC_VUNPCKHPS, - ZYDIS_MNEMONIC_VUNPCKLPD, - ZYDIS_MNEMONIC_VUNPCKLPS, - ZYDIS_MNEMONIC_VXORPD, - ZYDIS_MNEMONIC_VXORPS, - ZYDIS_MNEMONIC_VZEROALL, - ZYDIS_MNEMONIC_VZEROUPPER, - ZYDIS_MNEMONIC_WBINVD, - ZYDIS_MNEMONIC_WRFSBASE, - ZYDIS_MNEMONIC_WRGSBASE, - ZYDIS_MNEMONIC_WRMSR, - ZYDIS_MNEMONIC_WRPKRU, - ZYDIS_MNEMONIC_WRSSD, - ZYDIS_MNEMONIC_WRSSQ, - ZYDIS_MNEMONIC_WRUSSD, - ZYDIS_MNEMONIC_WRUSSQ, - ZYDIS_MNEMONIC_XABORT, - ZYDIS_MNEMONIC_XADD, - ZYDIS_MNEMONIC_XBEGIN, - ZYDIS_MNEMONIC_XCHG, - ZYDIS_MNEMONIC_XEND, - ZYDIS_MNEMONIC_XGETBV, - ZYDIS_MNEMONIC_XLAT, - ZYDIS_MNEMONIC_XOR, - ZYDIS_MNEMONIC_XORPD, - ZYDIS_MNEMONIC_XORPS, - ZYDIS_MNEMONIC_XRSTOR, - ZYDIS_MNEMONIC_XRSTOR64, - ZYDIS_MNEMONIC_XRSTORS, - ZYDIS_MNEMONIC_XRSTORS64, - ZYDIS_MNEMONIC_XSAVE, - ZYDIS_MNEMONIC_XSAVE64, - ZYDIS_MNEMONIC_XSAVEC, - ZYDIS_MNEMONIC_XSAVEC64, - ZYDIS_MNEMONIC_XSAVEOPT, - ZYDIS_MNEMONIC_XSAVEOPT64, - ZYDIS_MNEMONIC_XSAVES, - ZYDIS_MNEMONIC_XSAVES64, - ZYDIS_MNEMONIC_XSETBV, - ZYDIS_MNEMONIC_XTEST, - - ZYDIS_MNEMONIC_MAX_VALUE = ZYDIS_MNEMONIC_XTEST - ); diff --git a/Zydis/Generated/Zydis.Enum.Register.inc b/Zydis/Generated/Zydis.Enum.Register.inc deleted file mode 100644 index a24d0d4..0000000 --- a/Zydis/Generated/Zydis.Enum.Register.inc +++ /dev/null @@ -1,280 +0,0 @@ -type - {$Z1} - TZydisRegister = ( - ZYDIS_REGISTER_NONE, - - // 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, - // 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 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 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, - // 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 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, - // 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 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, - // Flags registers - ZYDIS_REGISTER_FLAGS, - ZYDIS_REGISTER_EFLAGS, - ZYDIS_REGISTER_RFLAGS, - // Instruction-pointer registers - ZYDIS_REGISTER_IP, - ZYDIS_REGISTER_EIP, - ZYDIS_REGISTER_RIP, - // Segment registers - ZYDIS_REGISTER_ES, - ZYDIS_REGISTER_CS, - ZYDIS_REGISTER_SS, - 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, - // Uncategorized - ZYDIS_REGISTER_MXCSR, - ZYDIS_REGISTER_PKRU, - ZYDIS_REGISTER_XCR0, - - ZYDIS_REGISTER_MAX_VALUE = ZYDIS_REGISTER_XCR0 - ); diff --git a/Zydis/Generated/zydis_enums.inc b/Zydis/Generated/zydis_enums.inc new file mode 100644 index 0000000..b563bf7 --- /dev/null +++ b/Zydis/Generated/zydis_enums.inc @@ -0,0 +1,3288 @@ +// THIS FILE IS AUTO-GENERATED USING zydis-bindgen! + +type + +// Defines the `ZydisInstructionCategory` enum. +TZydisInstructionCategory = ( + ZYDIS_CATEGORY_INVALID = 0, + ZYDIS_CATEGORY_ADOX_ADCX = 1, + ZYDIS_CATEGORY_AES = 2, + ZYDIS_CATEGORY_AMD3DNOW = 3, + ZYDIS_CATEGORY_AMX_TILE = 4, + ZYDIS_CATEGORY_AVX = 5, + ZYDIS_CATEGORY_AVX2 = 6, + ZYDIS_CATEGORY_AVX2GATHER = 7, + ZYDIS_CATEGORY_AVX512 = 8, + ZYDIS_CATEGORY_AVX512_4FMAPS = 9, + ZYDIS_CATEGORY_AVX512_4VNNIW = 10, + ZYDIS_CATEGORY_AVX512_BITALG = 11, + ZYDIS_CATEGORY_AVX512_VBMI = 12, + ZYDIS_CATEGORY_AVX512_VP2INTERSECT = 13, + ZYDIS_CATEGORY_AVX_IFMA = 14, + ZYDIS_CATEGORY_BINARY = 15, + ZYDIS_CATEGORY_BITBYTE = 16, + ZYDIS_CATEGORY_BLEND = 17, + ZYDIS_CATEGORY_BMI1 = 18, + ZYDIS_CATEGORY_BMI2 = 19, + ZYDIS_CATEGORY_BROADCAST = 20, + ZYDIS_CATEGORY_CALL = 21, + ZYDIS_CATEGORY_CET = 22, + ZYDIS_CATEGORY_CLDEMOTE = 23, + ZYDIS_CATEGORY_CLFLUSHOPT = 24, + ZYDIS_CATEGORY_CLWB = 25, + ZYDIS_CATEGORY_CLZERO = 26, + ZYDIS_CATEGORY_CMOV = 27, + ZYDIS_CATEGORY_COMPRESS = 28, + ZYDIS_CATEGORY_COND_BR = 29, + ZYDIS_CATEGORY_CONFLICT = 30, + ZYDIS_CATEGORY_CONVERT = 31, + ZYDIS_CATEGORY_DATAXFER = 32, + ZYDIS_CATEGORY_DECIMAL = 33, + ZYDIS_CATEGORY_ENQCMD = 34, + ZYDIS_CATEGORY_EXPAND = 35, + ZYDIS_CATEGORY_FCMOV = 36, + ZYDIS_CATEGORY_FLAGOP = 37, + ZYDIS_CATEGORY_FMA4 = 38, + ZYDIS_CATEGORY_FP16 = 39, + ZYDIS_CATEGORY_GATHER = 40, + ZYDIS_CATEGORY_GFNI = 41, + ZYDIS_CATEGORY_HRESET = 42, + ZYDIS_CATEGORY_IFMA = 43, + ZYDIS_CATEGORY_INTERRUPT = 44, + ZYDIS_CATEGORY_IO = 45, + ZYDIS_CATEGORY_IOSTRINGOP = 46, + ZYDIS_CATEGORY_KEYLOCKER = 47, + ZYDIS_CATEGORY_KEYLOCKER_WIDE = 48, + ZYDIS_CATEGORY_KMASK = 49, + ZYDIS_CATEGORY_KNC = 50, + ZYDIS_CATEGORY_KNCMASK = 51, + ZYDIS_CATEGORY_KNCSCALAR = 52, + ZYDIS_CATEGORY_LEGACY = 53, + ZYDIS_CATEGORY_LOGICAL = 54, + ZYDIS_CATEGORY_LOGICAL_FP = 55, + ZYDIS_CATEGORY_LZCNT = 56, + ZYDIS_CATEGORY_MISC = 57, + ZYDIS_CATEGORY_MMX = 58, + ZYDIS_CATEGORY_MOVDIR = 59, + ZYDIS_CATEGORY_MPX = 60, + ZYDIS_CATEGORY_MSRLIST = 61, + ZYDIS_CATEGORY_NOP = 62, + ZYDIS_CATEGORY_PADLOCK = 63, + ZYDIS_CATEGORY_PBNDKB = 64, + ZYDIS_CATEGORY_PCLMULQDQ = 65, + ZYDIS_CATEGORY_PCOMMIT = 66, + ZYDIS_CATEGORY_PCONFIG = 67, + ZYDIS_CATEGORY_PKU = 68, + ZYDIS_CATEGORY_POP = 69, + ZYDIS_CATEGORY_PREFETCH = 70, + ZYDIS_CATEGORY_PREFETCHWT1 = 71, + ZYDIS_CATEGORY_PT = 72, + ZYDIS_CATEGORY_PUSH = 73, + ZYDIS_CATEGORY_RDPID = 74, + ZYDIS_CATEGORY_RDPRU = 75, + ZYDIS_CATEGORY_RDRAND = 76, + ZYDIS_CATEGORY_RDSEED = 77, + ZYDIS_CATEGORY_RDWRFSGS = 78, + ZYDIS_CATEGORY_RET = 79, + ZYDIS_CATEGORY_ROTATE = 80, + ZYDIS_CATEGORY_SCATTER = 81, + ZYDIS_CATEGORY_SEGOP = 82, + ZYDIS_CATEGORY_SEMAPHORE = 83, + ZYDIS_CATEGORY_SERIALIZE = 84, + ZYDIS_CATEGORY_SETCC = 85, + ZYDIS_CATEGORY_SGX = 86, + ZYDIS_CATEGORY_SHA = 87, + ZYDIS_CATEGORY_SHA512 = 88, + ZYDIS_CATEGORY_SHIFT = 89, + ZYDIS_CATEGORY_SMAP = 90, + ZYDIS_CATEGORY_SSE = 91, + ZYDIS_CATEGORY_STRINGOP = 92, + ZYDIS_CATEGORY_STTNI = 93, + ZYDIS_CATEGORY_SYSCALL = 94, + ZYDIS_CATEGORY_SYSRET = 95, + ZYDIS_CATEGORY_SYSTEM = 96, + ZYDIS_CATEGORY_TBM = 97, + ZYDIS_CATEGORY_TSX_LDTRK = 98, + ZYDIS_CATEGORY_UFMA = 99, + ZYDIS_CATEGORY_UINTR = 100, + ZYDIS_CATEGORY_UNCOND_BR = 101, + ZYDIS_CATEGORY_VAES = 102, + ZYDIS_CATEGORY_VBMI2 = 103, + ZYDIS_CATEGORY_VEX = 104, + ZYDIS_CATEGORY_VFMA = 105, + ZYDIS_CATEGORY_VPCLMULQDQ = 106, + ZYDIS_CATEGORY_VTX = 107, + ZYDIS_CATEGORY_WAITPKG = 108, + ZYDIS_CATEGORY_WIDENOP = 109, + ZYDIS_CATEGORY_WRMSRNS = 110, + ZYDIS_CATEGORY_X87_ALU = 111, + ZYDIS_CATEGORY_XOP = 112, + ZYDIS_CATEGORY_XSAVE = 113, + ZYDIS_CATEGORY_XSAVEOPT = 114, + // Maximum value of this enum. + ZYDIS_CATEGORY_MAX_VALUE = 114, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_CATEGORY_REQUIRED_BITS = 7 +); + +// Defines the `ZydisISASet` enum. +TZydisISASet = ( + ZYDIS_ISA_SET_INVALID = 0, + ZYDIS_ISA_SET_ADOX_ADCX = 1, + ZYDIS_ISA_SET_AES = 2, + ZYDIS_ISA_SET_AMD = 3, + ZYDIS_ISA_SET_AMD3DNOW = 4, + ZYDIS_ISA_SET_AMD_INVLPGB = 5, + ZYDIS_ISA_SET_AMX_BF16 = 6, + ZYDIS_ISA_SET_AMX_FP16 = 7, + ZYDIS_ISA_SET_AMX_INT8 = 8, + ZYDIS_ISA_SET_AMX_TILE = 9, + ZYDIS_ISA_SET_AVX = 10, + ZYDIS_ISA_SET_AVX2 = 11, + ZYDIS_ISA_SET_AVX2GATHER = 12, + ZYDIS_ISA_SET_AVX512BW_128 = 13, + ZYDIS_ISA_SET_AVX512BW_128N = 14, + ZYDIS_ISA_SET_AVX512BW_256 = 15, + ZYDIS_ISA_SET_AVX512BW_512 = 16, + ZYDIS_ISA_SET_AVX512BW_KOP = 17, + ZYDIS_ISA_SET_AVX512CD_128 = 18, + ZYDIS_ISA_SET_AVX512CD_256 = 19, + ZYDIS_ISA_SET_AVX512CD_512 = 20, + ZYDIS_ISA_SET_AVX512DQ_128 = 21, + ZYDIS_ISA_SET_AVX512DQ_128N = 22, + ZYDIS_ISA_SET_AVX512DQ_256 = 23, + ZYDIS_ISA_SET_AVX512DQ_512 = 24, + ZYDIS_ISA_SET_AVX512DQ_KOP = 25, + ZYDIS_ISA_SET_AVX512DQ_SCALAR = 26, + ZYDIS_ISA_SET_AVX512ER_512 = 27, + ZYDIS_ISA_SET_AVX512ER_SCALAR = 28, + ZYDIS_ISA_SET_AVX512F_128 = 29, + ZYDIS_ISA_SET_AVX512F_128N = 30, + ZYDIS_ISA_SET_AVX512F_256 = 31, + ZYDIS_ISA_SET_AVX512F_512 = 32, + ZYDIS_ISA_SET_AVX512F_KOP = 33, + ZYDIS_ISA_SET_AVX512F_SCALAR = 34, + ZYDIS_ISA_SET_AVX512PF_512 = 35, + ZYDIS_ISA_SET_AVX512_4FMAPS_512 = 36, + ZYDIS_ISA_SET_AVX512_4FMAPS_SCALAR = 37, + ZYDIS_ISA_SET_AVX512_4VNNIW_512 = 38, + ZYDIS_ISA_SET_AVX512_BF16_128 = 39, + ZYDIS_ISA_SET_AVX512_BF16_256 = 40, + ZYDIS_ISA_SET_AVX512_BF16_512 = 41, + ZYDIS_ISA_SET_AVX512_BITALG_128 = 42, + ZYDIS_ISA_SET_AVX512_BITALG_256 = 43, + ZYDIS_ISA_SET_AVX512_BITALG_512 = 44, + ZYDIS_ISA_SET_AVX512_FP16_128 = 45, + ZYDIS_ISA_SET_AVX512_FP16_128N = 46, + ZYDIS_ISA_SET_AVX512_FP16_256 = 47, + ZYDIS_ISA_SET_AVX512_FP16_512 = 48, + ZYDIS_ISA_SET_AVX512_FP16_SCALAR = 49, + ZYDIS_ISA_SET_AVX512_GFNI_128 = 50, + ZYDIS_ISA_SET_AVX512_GFNI_256 = 51, + ZYDIS_ISA_SET_AVX512_GFNI_512 = 52, + ZYDIS_ISA_SET_AVX512_IFMA_128 = 53, + ZYDIS_ISA_SET_AVX512_IFMA_256 = 54, + ZYDIS_ISA_SET_AVX512_IFMA_512 = 55, + ZYDIS_ISA_SET_AVX512_VAES_128 = 56, + ZYDIS_ISA_SET_AVX512_VAES_256 = 57, + ZYDIS_ISA_SET_AVX512_VAES_512 = 58, + ZYDIS_ISA_SET_AVX512_VBMI2_128 = 59, + ZYDIS_ISA_SET_AVX512_VBMI2_256 = 60, + ZYDIS_ISA_SET_AVX512_VBMI2_512 = 61, + ZYDIS_ISA_SET_AVX512_VBMI_128 = 62, + ZYDIS_ISA_SET_AVX512_VBMI_256 = 63, + ZYDIS_ISA_SET_AVX512_VBMI_512 = 64, + ZYDIS_ISA_SET_AVX512_VNNI_128 = 65, + ZYDIS_ISA_SET_AVX512_VNNI_256 = 66, + ZYDIS_ISA_SET_AVX512_VNNI_512 = 67, + ZYDIS_ISA_SET_AVX512_VP2INTERSECT_128 = 68, + ZYDIS_ISA_SET_AVX512_VP2INTERSECT_256 = 69, + ZYDIS_ISA_SET_AVX512_VP2INTERSECT_512 = 70, + ZYDIS_ISA_SET_AVX512_VPCLMULQDQ_128 = 71, + ZYDIS_ISA_SET_AVX512_VPCLMULQDQ_256 = 72, + ZYDIS_ISA_SET_AVX512_VPCLMULQDQ_512 = 73, + ZYDIS_ISA_SET_AVX512_VPOPCNTDQ_128 = 74, + ZYDIS_ISA_SET_AVX512_VPOPCNTDQ_256 = 75, + ZYDIS_ISA_SET_AVX512_VPOPCNTDQ_512 = 76, + ZYDIS_ISA_SET_AVXAES = 77, + ZYDIS_ISA_SET_AVX_GFNI = 78, + ZYDIS_ISA_SET_AVX_IFMA = 79, + ZYDIS_ISA_SET_AVX_NE_CONVERT = 80, + ZYDIS_ISA_SET_AVX_VNNI = 81, + ZYDIS_ISA_SET_AVX_VNNI_INT16 = 82, + ZYDIS_ISA_SET_AVX_VNNI_INT8 = 83, + ZYDIS_ISA_SET_BMI1 = 84, + ZYDIS_ISA_SET_BMI2 = 85, + ZYDIS_ISA_SET_CET = 86, + ZYDIS_ISA_SET_CLDEMOTE = 87, + ZYDIS_ISA_SET_CLFLUSHOPT = 88, + ZYDIS_ISA_SET_CLFSH = 89, + ZYDIS_ISA_SET_CLWB = 90, + ZYDIS_ISA_SET_CLZERO = 91, + ZYDIS_ISA_SET_CMOV = 92, + ZYDIS_ISA_SET_CMPXCHG16B = 93, + ZYDIS_ISA_SET_ENQCMD = 94, + ZYDIS_ISA_SET_F16C = 95, + ZYDIS_ISA_SET_FAT_NOP = 96, + ZYDIS_ISA_SET_FCMOV = 97, + ZYDIS_ISA_SET_FCOMI = 98, + ZYDIS_ISA_SET_FMA = 99, + ZYDIS_ISA_SET_FMA4 = 100, + ZYDIS_ISA_SET_FXSAVE = 101, + ZYDIS_ISA_SET_FXSAVE64 = 102, + ZYDIS_ISA_SET_GFNI = 103, + ZYDIS_ISA_SET_HRESET = 104, + ZYDIS_ISA_SET_I186 = 105, + ZYDIS_ISA_SET_I286PROTECTED = 106, + ZYDIS_ISA_SET_I286REAL = 107, + ZYDIS_ISA_SET_I386 = 108, + ZYDIS_ISA_SET_I486 = 109, + ZYDIS_ISA_SET_I486REAL = 110, + ZYDIS_ISA_SET_I86 = 111, + ZYDIS_ISA_SET_ICACHE_PREFETCH = 112, + ZYDIS_ISA_SET_INVPCID = 113, + ZYDIS_ISA_SET_KEYLOCKER = 114, + ZYDIS_ISA_SET_KEYLOCKER_WIDE = 115, + ZYDIS_ISA_SET_KNCE = 116, + ZYDIS_ISA_SET_KNCJKBR = 117, + ZYDIS_ISA_SET_KNCSTREAM = 118, + ZYDIS_ISA_SET_KNCV = 119, + ZYDIS_ISA_SET_KNC_MISC = 120, + ZYDIS_ISA_SET_KNC_PF_HINT = 121, + ZYDIS_ISA_SET_LAHF = 122, + ZYDIS_ISA_SET_LONGMODE = 123, + ZYDIS_ISA_SET_LWP = 124, + ZYDIS_ISA_SET_LZCNT = 125, + ZYDIS_ISA_SET_MCOMMIT = 126, + ZYDIS_ISA_SET_MONITOR = 127, + ZYDIS_ISA_SET_MONITORX = 128, + ZYDIS_ISA_SET_MOVBE = 129, + ZYDIS_ISA_SET_MOVDIR = 130, + ZYDIS_ISA_SET_MPX = 131, + ZYDIS_ISA_SET_MSRLIST = 132, + ZYDIS_ISA_SET_PADLOCK_ACE = 133, + ZYDIS_ISA_SET_PADLOCK_PHE = 134, + ZYDIS_ISA_SET_PADLOCK_PMM = 135, + ZYDIS_ISA_SET_PADLOCK_RNG = 136, + ZYDIS_ISA_SET_PAUSE = 137, + ZYDIS_ISA_SET_PBNDKB = 138, + ZYDIS_ISA_SET_PCLMULQDQ = 139, + ZYDIS_ISA_SET_PCOMMIT = 140, + ZYDIS_ISA_SET_PCONFIG = 141, + ZYDIS_ISA_SET_PENTIUMMMX = 142, + ZYDIS_ISA_SET_PENTIUMREAL = 143, + ZYDIS_ISA_SET_PKU = 144, + ZYDIS_ISA_SET_POPCNT = 145, + ZYDIS_ISA_SET_PPRO = 146, + ZYDIS_ISA_SET_PREFETCHWT1 = 147, + ZYDIS_ISA_SET_PREFETCH_NOP = 148, + ZYDIS_ISA_SET_PT = 149, + ZYDIS_ISA_SET_RAO_INT = 150, + ZYDIS_ISA_SET_RDPID = 151, + ZYDIS_ISA_SET_RDPMC = 152, + ZYDIS_ISA_SET_RDPRU = 153, + ZYDIS_ISA_SET_RDRAND = 154, + ZYDIS_ISA_SET_RDSEED = 155, + ZYDIS_ISA_SET_RDTSCP = 156, + ZYDIS_ISA_SET_RDWRFSGS = 157, + ZYDIS_ISA_SET_RTM = 158, + ZYDIS_ISA_SET_SERIALIZE = 159, + ZYDIS_ISA_SET_SGX = 160, + ZYDIS_ISA_SET_SGX_ENCLV = 161, + ZYDIS_ISA_SET_SHA = 162, + ZYDIS_ISA_SET_SHA512 = 163, + ZYDIS_ISA_SET_SM3 = 164, + ZYDIS_ISA_SET_SM4 = 165, + ZYDIS_ISA_SET_SMAP = 166, + ZYDIS_ISA_SET_SMX = 167, + ZYDIS_ISA_SET_SNP = 168, + ZYDIS_ISA_SET_SSE = 169, + ZYDIS_ISA_SET_SSE2 = 170, + ZYDIS_ISA_SET_SSE2MMX = 171, + ZYDIS_ISA_SET_SSE3 = 172, + ZYDIS_ISA_SET_SSE3X87 = 173, + ZYDIS_ISA_SET_SSE4 = 174, + ZYDIS_ISA_SET_SSE42 = 175, + ZYDIS_ISA_SET_SSE4A = 176, + ZYDIS_ISA_SET_SSEMXCSR = 177, + ZYDIS_ISA_SET_SSE_PREFETCH = 178, + ZYDIS_ISA_SET_SSSE3 = 179, + ZYDIS_ISA_SET_SSSE3MMX = 180, + ZYDIS_ISA_SET_SVM = 181, + ZYDIS_ISA_SET_TBM = 182, + ZYDIS_ISA_SET_TDX = 183, + ZYDIS_ISA_SET_TSX_LDTRK = 184, + ZYDIS_ISA_SET_UINTR = 185, + ZYDIS_ISA_SET_VAES = 186, + ZYDIS_ISA_SET_VMFUNC = 187, + ZYDIS_ISA_SET_VPCLMULQDQ = 188, + ZYDIS_ISA_SET_VTX = 189, + ZYDIS_ISA_SET_WAITPKG = 190, + ZYDIS_ISA_SET_WRMSRNS = 191, + ZYDIS_ISA_SET_X87 = 192, + ZYDIS_ISA_SET_XOP = 193, + ZYDIS_ISA_SET_XSAVE = 194, + ZYDIS_ISA_SET_XSAVEC = 195, + ZYDIS_ISA_SET_XSAVEOPT = 196, + ZYDIS_ISA_SET_XSAVES = 197, + // Maximum value of this enum. + ZYDIS_ISA_SET_MAX_VALUE = 197, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_ISA_SET_REQUIRED_BITS = 8 +); + +// Defines the `ZydisISAExt` enum. +TZydisISAExt = ( + ZYDIS_ISA_EXT_INVALID = 0, + ZYDIS_ISA_EXT_ADOX_ADCX = 1, + ZYDIS_ISA_EXT_AES = 2, + ZYDIS_ISA_EXT_AMD3DNOW = 3, + ZYDIS_ISA_EXT_AMD3DNOW_PREFETCH = 4, + ZYDIS_ISA_EXT_AMD_INVLPGB = 5, + ZYDIS_ISA_EXT_AMX_BF16 = 6, + ZYDIS_ISA_EXT_AMX_FP16 = 7, + ZYDIS_ISA_EXT_AMX_INT8 = 8, + ZYDIS_ISA_EXT_AMX_TILE = 9, + ZYDIS_ISA_EXT_AVX = 10, + ZYDIS_ISA_EXT_AVX2 = 11, + ZYDIS_ISA_EXT_AVX2GATHER = 12, + ZYDIS_ISA_EXT_AVX512EVEX = 13, + ZYDIS_ISA_EXT_AVX512VEX = 14, + ZYDIS_ISA_EXT_AVXAES = 15, + ZYDIS_ISA_EXT_AVX_IFMA = 16, + ZYDIS_ISA_EXT_AVX_NE_CONVERT = 17, + ZYDIS_ISA_EXT_AVX_VNNI = 18, + ZYDIS_ISA_EXT_AVX_VNNI_INT16 = 19, + ZYDIS_ISA_EXT_AVX_VNNI_INT8 = 20, + ZYDIS_ISA_EXT_BASE = 21, + ZYDIS_ISA_EXT_BMI1 = 22, + ZYDIS_ISA_EXT_BMI2 = 23, + ZYDIS_ISA_EXT_CET = 24, + ZYDIS_ISA_EXT_CLDEMOTE = 25, + ZYDIS_ISA_EXT_CLFLUSHOPT = 26, + ZYDIS_ISA_EXT_CLFSH = 27, + ZYDIS_ISA_EXT_CLWB = 28, + ZYDIS_ISA_EXT_CLZERO = 29, + ZYDIS_ISA_EXT_ENQCMD = 30, + ZYDIS_ISA_EXT_F16C = 31, + ZYDIS_ISA_EXT_FMA = 32, + ZYDIS_ISA_EXT_FMA4 = 33, + ZYDIS_ISA_EXT_GFNI = 34, + ZYDIS_ISA_EXT_HRESET = 35, + ZYDIS_ISA_EXT_ICACHE_PREFETCH = 36, + ZYDIS_ISA_EXT_INVPCID = 37, + ZYDIS_ISA_EXT_KEYLOCKER = 38, + ZYDIS_ISA_EXT_KEYLOCKER_WIDE = 39, + ZYDIS_ISA_EXT_KNC = 40, + ZYDIS_ISA_EXT_KNCE = 41, + ZYDIS_ISA_EXT_KNCV = 42, + ZYDIS_ISA_EXT_LONGMODE = 43, + ZYDIS_ISA_EXT_LZCNT = 44, + ZYDIS_ISA_EXT_MCOMMIT = 45, + ZYDIS_ISA_EXT_MMX = 46, + ZYDIS_ISA_EXT_MONITOR = 47, + ZYDIS_ISA_EXT_MONITORX = 48, + ZYDIS_ISA_EXT_MOVBE = 49, + ZYDIS_ISA_EXT_MOVDIR = 50, + ZYDIS_ISA_EXT_MPX = 51, + ZYDIS_ISA_EXT_MSRLIST = 52, + ZYDIS_ISA_EXT_PADLOCK = 53, + ZYDIS_ISA_EXT_PAUSE = 54, + ZYDIS_ISA_EXT_PBNDKB = 55, + ZYDIS_ISA_EXT_PCLMULQDQ = 56, + ZYDIS_ISA_EXT_PCOMMIT = 57, + ZYDIS_ISA_EXT_PCONFIG = 58, + ZYDIS_ISA_EXT_PKU = 59, + ZYDIS_ISA_EXT_PREFETCHWT1 = 60, + ZYDIS_ISA_EXT_PT = 61, + ZYDIS_ISA_EXT_RAO_INT = 62, + ZYDIS_ISA_EXT_RDPID = 63, + ZYDIS_ISA_EXT_RDPRU = 64, + ZYDIS_ISA_EXT_RDRAND = 65, + ZYDIS_ISA_EXT_RDSEED = 66, + ZYDIS_ISA_EXT_RDTSCP = 67, + ZYDIS_ISA_EXT_RDWRFSGS = 68, + ZYDIS_ISA_EXT_RTM = 69, + ZYDIS_ISA_EXT_SERIALIZE = 70, + ZYDIS_ISA_EXT_SGX = 71, + ZYDIS_ISA_EXT_SGX_ENCLV = 72, + ZYDIS_ISA_EXT_SHA = 73, + ZYDIS_ISA_EXT_SHA512 = 74, + ZYDIS_ISA_EXT_SM3 = 75, + ZYDIS_ISA_EXT_SM4 = 76, + ZYDIS_ISA_EXT_SMAP = 77, + ZYDIS_ISA_EXT_SMX = 78, + ZYDIS_ISA_EXT_SNP = 79, + ZYDIS_ISA_EXT_SSE = 80, + ZYDIS_ISA_EXT_SSE2 = 81, + ZYDIS_ISA_EXT_SSE3 = 82, + ZYDIS_ISA_EXT_SSE4 = 83, + ZYDIS_ISA_EXT_SSE4A = 84, + ZYDIS_ISA_EXT_SSSE3 = 85, + ZYDIS_ISA_EXT_SVM = 86, + ZYDIS_ISA_EXT_TBM = 87, + ZYDIS_ISA_EXT_TDX = 88, + ZYDIS_ISA_EXT_TSX_LDTRK = 89, + ZYDIS_ISA_EXT_UINTR = 90, + ZYDIS_ISA_EXT_VAES = 91, + ZYDIS_ISA_EXT_VMFUNC = 92, + ZYDIS_ISA_EXT_VPCLMULQDQ = 93, + ZYDIS_ISA_EXT_VTX = 94, + ZYDIS_ISA_EXT_WAITPKG = 95, + ZYDIS_ISA_EXT_WRMSRNS = 96, + ZYDIS_ISA_EXT_X87 = 97, + ZYDIS_ISA_EXT_XOP = 98, + ZYDIS_ISA_EXT_XSAVE = 99, + ZYDIS_ISA_EXT_XSAVEC = 100, + ZYDIS_ISA_EXT_XSAVEOPT = 101, + ZYDIS_ISA_EXT_XSAVES = 102, + // Maximum value of this enum. + ZYDIS_ISA_EXT_MAX_VALUE = 102, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_ISA_EXT_REQUIRED_BITS = 7 +); + +// Defines the `ZydisMnemonic` enum. +TZydisMnemonic = ( + ZYDIS_MNEMONIC_INVALID = 0, + ZYDIS_MNEMONIC_AAA = 1, + ZYDIS_MNEMONIC_AAD = 2, + ZYDIS_MNEMONIC_AADD = 3, + ZYDIS_MNEMONIC_AAM = 4, + ZYDIS_MNEMONIC_AAND = 5, + ZYDIS_MNEMONIC_AAS = 6, + ZYDIS_MNEMONIC_ADC = 7, + ZYDIS_MNEMONIC_ADCX = 8, + ZYDIS_MNEMONIC_ADD = 9, + ZYDIS_MNEMONIC_ADDPD = 10, + ZYDIS_MNEMONIC_ADDPS = 11, + ZYDIS_MNEMONIC_ADDSD = 12, + ZYDIS_MNEMONIC_ADDSS = 13, + ZYDIS_MNEMONIC_ADDSUBPD = 14, + ZYDIS_MNEMONIC_ADDSUBPS = 15, + ZYDIS_MNEMONIC_ADOX = 16, + ZYDIS_MNEMONIC_AESDEC = 17, + ZYDIS_MNEMONIC_AESDEC128KL = 18, + ZYDIS_MNEMONIC_AESDEC256KL = 19, + ZYDIS_MNEMONIC_AESDECLAST = 20, + ZYDIS_MNEMONIC_AESDECWIDE128KL = 21, + ZYDIS_MNEMONIC_AESDECWIDE256KL = 22, + ZYDIS_MNEMONIC_AESENC = 23, + ZYDIS_MNEMONIC_AESENC128KL = 24, + ZYDIS_MNEMONIC_AESENC256KL = 25, + ZYDIS_MNEMONIC_AESENCLAST = 26, + ZYDIS_MNEMONIC_AESENCWIDE128KL = 27, + ZYDIS_MNEMONIC_AESENCWIDE256KL = 28, + ZYDIS_MNEMONIC_AESIMC = 29, + ZYDIS_MNEMONIC_AESKEYGENASSIST = 30, + ZYDIS_MNEMONIC_AND = 31, + ZYDIS_MNEMONIC_ANDN = 32, + ZYDIS_MNEMONIC_ANDNPD = 33, + ZYDIS_MNEMONIC_ANDNPS = 34, + ZYDIS_MNEMONIC_ANDPD = 35, + ZYDIS_MNEMONIC_ANDPS = 36, + ZYDIS_MNEMONIC_AOR = 37, + ZYDIS_MNEMONIC_ARPL = 38, + ZYDIS_MNEMONIC_AXOR = 39, + ZYDIS_MNEMONIC_BEXTR = 40, + ZYDIS_MNEMONIC_BLCFILL = 41, + ZYDIS_MNEMONIC_BLCI = 42, + ZYDIS_MNEMONIC_BLCIC = 43, + ZYDIS_MNEMONIC_BLCMSK = 44, + ZYDIS_MNEMONIC_BLCS = 45, + ZYDIS_MNEMONIC_BLENDPD = 46, + ZYDIS_MNEMONIC_BLENDPS = 47, + ZYDIS_MNEMONIC_BLENDVPD = 48, + ZYDIS_MNEMONIC_BLENDVPS = 49, + ZYDIS_MNEMONIC_BLSFILL = 50, + ZYDIS_MNEMONIC_BLSI = 51, + ZYDIS_MNEMONIC_BLSIC = 52, + ZYDIS_MNEMONIC_BLSMSK = 53, + ZYDIS_MNEMONIC_BLSR = 54, + ZYDIS_MNEMONIC_BNDCL = 55, + ZYDIS_MNEMONIC_BNDCN = 56, + ZYDIS_MNEMONIC_BNDCU = 57, + ZYDIS_MNEMONIC_BNDLDX = 58, + ZYDIS_MNEMONIC_BNDMK = 59, + ZYDIS_MNEMONIC_BNDMOV = 60, + ZYDIS_MNEMONIC_BNDSTX = 61, + ZYDIS_MNEMONIC_BOUND = 62, + ZYDIS_MNEMONIC_BSF = 63, + ZYDIS_MNEMONIC_BSR = 64, + ZYDIS_MNEMONIC_BSWAP = 65, + ZYDIS_MNEMONIC_BT = 66, + ZYDIS_MNEMONIC_BTC = 67, + ZYDIS_MNEMONIC_BTR = 68, + ZYDIS_MNEMONIC_BTS = 69, + ZYDIS_MNEMONIC_BZHI = 70, + ZYDIS_MNEMONIC_CALL = 71, + ZYDIS_MNEMONIC_CBW = 72, + ZYDIS_MNEMONIC_CDQ = 73, + ZYDIS_MNEMONIC_CDQE = 74, + ZYDIS_MNEMONIC_CLAC = 75, + ZYDIS_MNEMONIC_CLC = 76, + ZYDIS_MNEMONIC_CLD = 77, + ZYDIS_MNEMONIC_CLDEMOTE = 78, + ZYDIS_MNEMONIC_CLEVICT0 = 79, + ZYDIS_MNEMONIC_CLEVICT1 = 80, + ZYDIS_MNEMONIC_CLFLUSH = 81, + ZYDIS_MNEMONIC_CLFLUSHOPT = 82, + ZYDIS_MNEMONIC_CLGI = 83, + ZYDIS_MNEMONIC_CLI = 84, + ZYDIS_MNEMONIC_CLRSSBSY = 85, + ZYDIS_MNEMONIC_CLTS = 86, + ZYDIS_MNEMONIC_CLUI = 87, + ZYDIS_MNEMONIC_CLWB = 88, + ZYDIS_MNEMONIC_CLZERO = 89, + ZYDIS_MNEMONIC_CMC = 90, + ZYDIS_MNEMONIC_CMOVB = 91, + ZYDIS_MNEMONIC_CMOVBE = 92, + ZYDIS_MNEMONIC_CMOVL = 93, + ZYDIS_MNEMONIC_CMOVLE = 94, + ZYDIS_MNEMONIC_CMOVNB = 95, + ZYDIS_MNEMONIC_CMOVNBE = 96, + ZYDIS_MNEMONIC_CMOVNL = 97, + ZYDIS_MNEMONIC_CMOVNLE = 98, + ZYDIS_MNEMONIC_CMOVNO = 99, + ZYDIS_MNEMONIC_CMOVNP = 100, + ZYDIS_MNEMONIC_CMOVNS = 101, + ZYDIS_MNEMONIC_CMOVNZ = 102, + ZYDIS_MNEMONIC_CMOVO = 103, + ZYDIS_MNEMONIC_CMOVP = 104, + ZYDIS_MNEMONIC_CMOVS = 105, + ZYDIS_MNEMONIC_CMOVZ = 106, + ZYDIS_MNEMONIC_CMP = 107, + ZYDIS_MNEMONIC_CMPPD = 108, + ZYDIS_MNEMONIC_CMPPS = 109, + ZYDIS_MNEMONIC_CMPSB = 110, + ZYDIS_MNEMONIC_CMPSD = 111, + ZYDIS_MNEMONIC_CMPSQ = 112, + ZYDIS_MNEMONIC_CMPSS = 113, + ZYDIS_MNEMONIC_CMPSW = 114, + ZYDIS_MNEMONIC_CMPXCHG = 115, + ZYDIS_MNEMONIC_CMPXCHG16B = 116, + ZYDIS_MNEMONIC_CMPXCHG8B = 117, + ZYDIS_MNEMONIC_COMISD = 118, + ZYDIS_MNEMONIC_COMISS = 119, + ZYDIS_MNEMONIC_CPUID = 120, + ZYDIS_MNEMONIC_CQO = 121, + ZYDIS_MNEMONIC_CRC32 = 122, + ZYDIS_MNEMONIC_CVTDQ2PD = 123, + ZYDIS_MNEMONIC_CVTDQ2PS = 124, + ZYDIS_MNEMONIC_CVTPD2DQ = 125, + ZYDIS_MNEMONIC_CVTPD2PI = 126, + ZYDIS_MNEMONIC_CVTPD2PS = 127, + ZYDIS_MNEMONIC_CVTPI2PD = 128, + ZYDIS_MNEMONIC_CVTPI2PS = 129, + ZYDIS_MNEMONIC_CVTPS2DQ = 130, + ZYDIS_MNEMONIC_CVTPS2PD = 131, + ZYDIS_MNEMONIC_CVTPS2PI = 132, + ZYDIS_MNEMONIC_CVTSD2SI = 133, + ZYDIS_MNEMONIC_CVTSD2SS = 134, + ZYDIS_MNEMONIC_CVTSI2SD = 135, + ZYDIS_MNEMONIC_CVTSI2SS = 136, + ZYDIS_MNEMONIC_CVTSS2SD = 137, + ZYDIS_MNEMONIC_CVTSS2SI = 138, + ZYDIS_MNEMONIC_CVTTPD2DQ = 139, + ZYDIS_MNEMONIC_CVTTPD2PI = 140, + ZYDIS_MNEMONIC_CVTTPS2DQ = 141, + ZYDIS_MNEMONIC_CVTTPS2PI = 142, + ZYDIS_MNEMONIC_CVTTSD2SI = 143, + ZYDIS_MNEMONIC_CVTTSS2SI = 144, + ZYDIS_MNEMONIC_CWD = 145, + ZYDIS_MNEMONIC_CWDE = 146, + ZYDIS_MNEMONIC_DAA = 147, + ZYDIS_MNEMONIC_DAS = 148, + ZYDIS_MNEMONIC_DEC = 149, + ZYDIS_MNEMONIC_DELAY = 150, + ZYDIS_MNEMONIC_DIV = 151, + ZYDIS_MNEMONIC_DIVPD = 152, + ZYDIS_MNEMONIC_DIVPS = 153, + ZYDIS_MNEMONIC_DIVSD = 154, + ZYDIS_MNEMONIC_DIVSS = 155, + ZYDIS_MNEMONIC_DPPD = 156, + ZYDIS_MNEMONIC_DPPS = 157, + ZYDIS_MNEMONIC_EMMS = 158, + ZYDIS_MNEMONIC_ENCLS = 159, + ZYDIS_MNEMONIC_ENCLU = 160, + ZYDIS_MNEMONIC_ENCLV = 161, + ZYDIS_MNEMONIC_ENCODEKEY128 = 162, + ZYDIS_MNEMONIC_ENCODEKEY256 = 163, + ZYDIS_MNEMONIC_ENDBR32 = 164, + ZYDIS_MNEMONIC_ENDBR64 = 165, + ZYDIS_MNEMONIC_ENQCMD = 166, + ZYDIS_MNEMONIC_ENQCMDS = 167, + ZYDIS_MNEMONIC_ENTER = 168, + ZYDIS_MNEMONIC_EXTRACTPS = 169, + ZYDIS_MNEMONIC_EXTRQ = 170, + ZYDIS_MNEMONIC_F2XM1 = 171, + ZYDIS_MNEMONIC_FABS = 172, + ZYDIS_MNEMONIC_FADD = 173, + ZYDIS_MNEMONIC_FADDP = 174, + ZYDIS_MNEMONIC_FBLD = 175, + ZYDIS_MNEMONIC_FBSTP = 176, + ZYDIS_MNEMONIC_FCHS = 177, + ZYDIS_MNEMONIC_FCMOVB = 178, + ZYDIS_MNEMONIC_FCMOVBE = 179, + ZYDIS_MNEMONIC_FCMOVE = 180, + ZYDIS_MNEMONIC_FCMOVNB = 181, + ZYDIS_MNEMONIC_FCMOVNBE = 182, + ZYDIS_MNEMONIC_FCMOVNE = 183, + ZYDIS_MNEMONIC_FCMOVNU = 184, + ZYDIS_MNEMONIC_FCMOVU = 185, + ZYDIS_MNEMONIC_FCOM = 186, + ZYDIS_MNEMONIC_FCOMI = 187, + ZYDIS_MNEMONIC_FCOMIP = 188, + ZYDIS_MNEMONIC_FCOMP = 189, + ZYDIS_MNEMONIC_FCOMPP = 190, + ZYDIS_MNEMONIC_FCOS = 191, + ZYDIS_MNEMONIC_FDECSTP = 192, + ZYDIS_MNEMONIC_FDISI8087_NOP = 193, + ZYDIS_MNEMONIC_FDIV = 194, + ZYDIS_MNEMONIC_FDIVP = 195, + ZYDIS_MNEMONIC_FDIVR = 196, + ZYDIS_MNEMONIC_FDIVRP = 197, + ZYDIS_MNEMONIC_FEMMS = 198, + ZYDIS_MNEMONIC_FENI8087_NOP = 199, + ZYDIS_MNEMONIC_FFREE = 200, + ZYDIS_MNEMONIC_FFREEP = 201, + ZYDIS_MNEMONIC_FIADD = 202, + ZYDIS_MNEMONIC_FICOM = 203, + ZYDIS_MNEMONIC_FICOMP = 204, + ZYDIS_MNEMONIC_FIDIV = 205, + ZYDIS_MNEMONIC_FIDIVR = 206, + ZYDIS_MNEMONIC_FILD = 207, + ZYDIS_MNEMONIC_FIMUL = 208, + ZYDIS_MNEMONIC_FINCSTP = 209, + ZYDIS_MNEMONIC_FIST = 210, + ZYDIS_MNEMONIC_FISTP = 211, + ZYDIS_MNEMONIC_FISTTP = 212, + ZYDIS_MNEMONIC_FISUB = 213, + ZYDIS_MNEMONIC_FISUBR = 214, + ZYDIS_MNEMONIC_FLD = 215, + ZYDIS_MNEMONIC_FLD1 = 216, + ZYDIS_MNEMONIC_FLDCW = 217, + ZYDIS_MNEMONIC_FLDENV = 218, + ZYDIS_MNEMONIC_FLDL2E = 219, + ZYDIS_MNEMONIC_FLDL2T = 220, + ZYDIS_MNEMONIC_FLDLG2 = 221, + ZYDIS_MNEMONIC_FLDLN2 = 222, + ZYDIS_MNEMONIC_FLDPI = 223, + ZYDIS_MNEMONIC_FLDZ = 224, + ZYDIS_MNEMONIC_FMUL = 225, + ZYDIS_MNEMONIC_FMULP = 226, + ZYDIS_MNEMONIC_FNCLEX = 227, + ZYDIS_MNEMONIC_FNINIT = 228, + ZYDIS_MNEMONIC_FNOP = 229, + ZYDIS_MNEMONIC_FNSAVE = 230, + ZYDIS_MNEMONIC_FNSTCW = 231, + ZYDIS_MNEMONIC_FNSTENV = 232, + ZYDIS_MNEMONIC_FNSTSW = 233, + ZYDIS_MNEMONIC_FPATAN = 234, + ZYDIS_MNEMONIC_FPREM = 235, + ZYDIS_MNEMONIC_FPREM1 = 236, + ZYDIS_MNEMONIC_FPTAN = 237, + ZYDIS_MNEMONIC_FRNDINT = 238, + ZYDIS_MNEMONIC_FRSTOR = 239, + ZYDIS_MNEMONIC_FSCALE = 240, + ZYDIS_MNEMONIC_FSETPM287_NOP = 241, + ZYDIS_MNEMONIC_FSIN = 242, + ZYDIS_MNEMONIC_FSINCOS = 243, + ZYDIS_MNEMONIC_FSQRT = 244, + ZYDIS_MNEMONIC_FST = 245, + ZYDIS_MNEMONIC_FSTP = 246, + ZYDIS_MNEMONIC_FSTPNCE = 247, + ZYDIS_MNEMONIC_FSUB = 248, + ZYDIS_MNEMONIC_FSUBP = 249, + ZYDIS_MNEMONIC_FSUBR = 250, + ZYDIS_MNEMONIC_FSUBRP = 251, + ZYDIS_MNEMONIC_FTST = 252, + ZYDIS_MNEMONIC_FUCOM = 253, + ZYDIS_MNEMONIC_FUCOMI = 254, + ZYDIS_MNEMONIC_FUCOMIP = 255, + ZYDIS_MNEMONIC_FUCOMP = 256, + ZYDIS_MNEMONIC_FUCOMPP = 257, + ZYDIS_MNEMONIC_FWAIT = 258, + ZYDIS_MNEMONIC_FXAM = 259, + ZYDIS_MNEMONIC_FXCH = 260, + ZYDIS_MNEMONIC_FXRSTOR = 261, + ZYDIS_MNEMONIC_FXRSTOR64 = 262, + ZYDIS_MNEMONIC_FXSAVE = 263, + ZYDIS_MNEMONIC_FXSAVE64 = 264, + ZYDIS_MNEMONIC_FXTRACT = 265, + ZYDIS_MNEMONIC_FYL2X = 266, + ZYDIS_MNEMONIC_FYL2XP1 = 267, + ZYDIS_MNEMONIC_GETSEC = 268, + ZYDIS_MNEMONIC_GF2P8AFFINEINVQB = 269, + ZYDIS_MNEMONIC_GF2P8AFFINEQB = 270, + ZYDIS_MNEMONIC_GF2P8MULB = 271, + ZYDIS_MNEMONIC_HADDPD = 272, + ZYDIS_MNEMONIC_HADDPS = 273, + ZYDIS_MNEMONIC_HLT = 274, + ZYDIS_MNEMONIC_HRESET = 275, + ZYDIS_MNEMONIC_HSUBPD = 276, + ZYDIS_MNEMONIC_HSUBPS = 277, + ZYDIS_MNEMONIC_IDIV = 278, + ZYDIS_MNEMONIC_IMUL = 279, + ZYDIS_MNEMONIC_IN = 280, + ZYDIS_MNEMONIC_INC = 281, + ZYDIS_MNEMONIC_INCSSPD = 282, + ZYDIS_MNEMONIC_INCSSPQ = 283, + ZYDIS_MNEMONIC_INSB = 284, + ZYDIS_MNEMONIC_INSD = 285, + ZYDIS_MNEMONIC_INSERTPS = 286, + ZYDIS_MNEMONIC_INSERTQ = 287, + ZYDIS_MNEMONIC_INSW = 288, + ZYDIS_MNEMONIC_INT = 289, + ZYDIS_MNEMONIC_INT1 = 290, + ZYDIS_MNEMONIC_INT3 = 291, + ZYDIS_MNEMONIC_INTO = 292, + ZYDIS_MNEMONIC_INVD = 293, + ZYDIS_MNEMONIC_INVEPT = 294, + ZYDIS_MNEMONIC_INVLPG = 295, + ZYDIS_MNEMONIC_INVLPGA = 296, + ZYDIS_MNEMONIC_INVLPGB = 297, + ZYDIS_MNEMONIC_INVPCID = 298, + ZYDIS_MNEMONIC_INVVPID = 299, + ZYDIS_MNEMONIC_IRET = 300, + ZYDIS_MNEMONIC_IRETD = 301, + ZYDIS_MNEMONIC_IRETQ = 302, + ZYDIS_MNEMONIC_JB = 303, + ZYDIS_MNEMONIC_JBE = 304, + ZYDIS_MNEMONIC_JCXZ = 305, + ZYDIS_MNEMONIC_JECXZ = 306, + ZYDIS_MNEMONIC_JKNZD = 307, + ZYDIS_MNEMONIC_JKZD = 308, + ZYDIS_MNEMONIC_JL = 309, + ZYDIS_MNEMONIC_JLE = 310, + ZYDIS_MNEMONIC_JMP = 311, + ZYDIS_MNEMONIC_JNB = 312, + ZYDIS_MNEMONIC_JNBE = 313, + ZYDIS_MNEMONIC_JNL = 314, + ZYDIS_MNEMONIC_JNLE = 315, + ZYDIS_MNEMONIC_JNO = 316, + ZYDIS_MNEMONIC_JNP = 317, + ZYDIS_MNEMONIC_JNS = 318, + ZYDIS_MNEMONIC_JNZ = 319, + ZYDIS_MNEMONIC_JO = 320, + ZYDIS_MNEMONIC_JP = 321, + ZYDIS_MNEMONIC_JRCXZ = 322, + ZYDIS_MNEMONIC_JS = 323, + ZYDIS_MNEMONIC_JZ = 324, + ZYDIS_MNEMONIC_KADDB = 325, + ZYDIS_MNEMONIC_KADDD = 326, + ZYDIS_MNEMONIC_KADDQ = 327, + ZYDIS_MNEMONIC_KADDW = 328, + ZYDIS_MNEMONIC_KAND = 329, + ZYDIS_MNEMONIC_KANDB = 330, + ZYDIS_MNEMONIC_KANDD = 331, + ZYDIS_MNEMONIC_KANDN = 332, + ZYDIS_MNEMONIC_KANDNB = 333, + ZYDIS_MNEMONIC_KANDND = 334, + ZYDIS_MNEMONIC_KANDNQ = 335, + ZYDIS_MNEMONIC_KANDNR = 336, + ZYDIS_MNEMONIC_KANDNW = 337, + ZYDIS_MNEMONIC_KANDQ = 338, + ZYDIS_MNEMONIC_KANDW = 339, + ZYDIS_MNEMONIC_KCONCATH = 340, + ZYDIS_MNEMONIC_KCONCATL = 341, + ZYDIS_MNEMONIC_KEXTRACT = 342, + ZYDIS_MNEMONIC_KMERGE2L1H = 343, + ZYDIS_MNEMONIC_KMERGE2L1L = 344, + ZYDIS_MNEMONIC_KMOV = 345, + ZYDIS_MNEMONIC_KMOVB = 346, + ZYDIS_MNEMONIC_KMOVD = 347, + ZYDIS_MNEMONIC_KMOVQ = 348, + ZYDIS_MNEMONIC_KMOVW = 349, + ZYDIS_MNEMONIC_KNOT = 350, + ZYDIS_MNEMONIC_KNOTB = 351, + ZYDIS_MNEMONIC_KNOTD = 352, + ZYDIS_MNEMONIC_KNOTQ = 353, + ZYDIS_MNEMONIC_KNOTW = 354, + ZYDIS_MNEMONIC_KOR = 355, + ZYDIS_MNEMONIC_KORB = 356, + ZYDIS_MNEMONIC_KORD = 357, + ZYDIS_MNEMONIC_KORQ = 358, + ZYDIS_MNEMONIC_KORTEST = 359, + ZYDIS_MNEMONIC_KORTESTB = 360, + ZYDIS_MNEMONIC_KORTESTD = 361, + ZYDIS_MNEMONIC_KORTESTQ = 362, + ZYDIS_MNEMONIC_KORTESTW = 363, + ZYDIS_MNEMONIC_KORW = 364, + ZYDIS_MNEMONIC_KSHIFTLB = 365, + ZYDIS_MNEMONIC_KSHIFTLD = 366, + ZYDIS_MNEMONIC_KSHIFTLQ = 367, + ZYDIS_MNEMONIC_KSHIFTLW = 368, + ZYDIS_MNEMONIC_KSHIFTRB = 369, + ZYDIS_MNEMONIC_KSHIFTRD = 370, + ZYDIS_MNEMONIC_KSHIFTRQ = 371, + ZYDIS_MNEMONIC_KSHIFTRW = 372, + ZYDIS_MNEMONIC_KTESTB = 373, + ZYDIS_MNEMONIC_KTESTD = 374, + ZYDIS_MNEMONIC_KTESTQ = 375, + ZYDIS_MNEMONIC_KTESTW = 376, + ZYDIS_MNEMONIC_KUNPCKBW = 377, + ZYDIS_MNEMONIC_KUNPCKDQ = 378, + ZYDIS_MNEMONIC_KUNPCKWD = 379, + ZYDIS_MNEMONIC_KXNOR = 380, + ZYDIS_MNEMONIC_KXNORB = 381, + ZYDIS_MNEMONIC_KXNORD = 382, + ZYDIS_MNEMONIC_KXNORQ = 383, + ZYDIS_MNEMONIC_KXNORW = 384, + ZYDIS_MNEMONIC_KXOR = 385, + ZYDIS_MNEMONIC_KXORB = 386, + ZYDIS_MNEMONIC_KXORD = 387, + ZYDIS_MNEMONIC_KXORQ = 388, + ZYDIS_MNEMONIC_KXORW = 389, + ZYDIS_MNEMONIC_LAHF = 390, + ZYDIS_MNEMONIC_LAR = 391, + ZYDIS_MNEMONIC_LDDQU = 392, + ZYDIS_MNEMONIC_LDMXCSR = 393, + ZYDIS_MNEMONIC_LDS = 394, + ZYDIS_MNEMONIC_LDTILECFG = 395, + ZYDIS_MNEMONIC_LEA = 396, + ZYDIS_MNEMONIC_LEAVE = 397, + ZYDIS_MNEMONIC_LES = 398, + ZYDIS_MNEMONIC_LFENCE = 399, + ZYDIS_MNEMONIC_LFS = 400, + ZYDIS_MNEMONIC_LGDT = 401, + ZYDIS_MNEMONIC_LGS = 402, + ZYDIS_MNEMONIC_LIDT = 403, + ZYDIS_MNEMONIC_LLDT = 404, + ZYDIS_MNEMONIC_LLWPCB = 405, + ZYDIS_MNEMONIC_LMSW = 406, + ZYDIS_MNEMONIC_LOADIWKEY = 407, + ZYDIS_MNEMONIC_LODSB = 408, + ZYDIS_MNEMONIC_LODSD = 409, + ZYDIS_MNEMONIC_LODSQ = 410, + ZYDIS_MNEMONIC_LODSW = 411, + ZYDIS_MNEMONIC_LOOP = 412, + ZYDIS_MNEMONIC_LOOPE = 413, + ZYDIS_MNEMONIC_LOOPNE = 414, + ZYDIS_MNEMONIC_LSL = 415, + ZYDIS_MNEMONIC_LSS = 416, + ZYDIS_MNEMONIC_LTR = 417, + ZYDIS_MNEMONIC_LWPINS = 418, + ZYDIS_MNEMONIC_LWPVAL = 419, + ZYDIS_MNEMONIC_LZCNT = 420, + ZYDIS_MNEMONIC_MASKMOVDQU = 421, + ZYDIS_MNEMONIC_MASKMOVQ = 422, + ZYDIS_MNEMONIC_MAXPD = 423, + ZYDIS_MNEMONIC_MAXPS = 424, + ZYDIS_MNEMONIC_MAXSD = 425, + ZYDIS_MNEMONIC_MAXSS = 426, + ZYDIS_MNEMONIC_MCOMMIT = 427, + ZYDIS_MNEMONIC_MFENCE = 428, + ZYDIS_MNEMONIC_MINPD = 429, + ZYDIS_MNEMONIC_MINPS = 430, + ZYDIS_MNEMONIC_MINSD = 431, + ZYDIS_MNEMONIC_MINSS = 432, + ZYDIS_MNEMONIC_MONITOR = 433, + ZYDIS_MNEMONIC_MONITORX = 434, + ZYDIS_MNEMONIC_MONTMUL = 435, + ZYDIS_MNEMONIC_MOV = 436, + ZYDIS_MNEMONIC_MOVAPD = 437, + ZYDIS_MNEMONIC_MOVAPS = 438, + ZYDIS_MNEMONIC_MOVBE = 439, + ZYDIS_MNEMONIC_MOVD = 440, + ZYDIS_MNEMONIC_MOVDDUP = 441, + ZYDIS_MNEMONIC_MOVDIR64B = 442, + ZYDIS_MNEMONIC_MOVDIRI = 443, + ZYDIS_MNEMONIC_MOVDQ2Q = 444, + ZYDIS_MNEMONIC_MOVDQA = 445, + ZYDIS_MNEMONIC_MOVDQU = 446, + ZYDIS_MNEMONIC_MOVHLPS = 447, + ZYDIS_MNEMONIC_MOVHPD = 448, + ZYDIS_MNEMONIC_MOVHPS = 449, + ZYDIS_MNEMONIC_MOVLHPS = 450, + ZYDIS_MNEMONIC_MOVLPD = 451, + ZYDIS_MNEMONIC_MOVLPS = 452, + ZYDIS_MNEMONIC_MOVMSKPD = 453, + ZYDIS_MNEMONIC_MOVMSKPS = 454, + ZYDIS_MNEMONIC_MOVNTDQ = 455, + ZYDIS_MNEMONIC_MOVNTDQA = 456, + ZYDIS_MNEMONIC_MOVNTI = 457, + ZYDIS_MNEMONIC_MOVNTPD = 458, + ZYDIS_MNEMONIC_MOVNTPS = 459, + ZYDIS_MNEMONIC_MOVNTQ = 460, + ZYDIS_MNEMONIC_MOVNTSD = 461, + ZYDIS_MNEMONIC_MOVNTSS = 462, + ZYDIS_MNEMONIC_MOVQ = 463, + ZYDIS_MNEMONIC_MOVQ2DQ = 464, + ZYDIS_MNEMONIC_MOVSB = 465, + ZYDIS_MNEMONIC_MOVSD = 466, + ZYDIS_MNEMONIC_MOVSHDUP = 467, + ZYDIS_MNEMONIC_MOVSLDUP = 468, + ZYDIS_MNEMONIC_MOVSQ = 469, + ZYDIS_MNEMONIC_MOVSS = 470, + ZYDIS_MNEMONIC_MOVSW = 471, + ZYDIS_MNEMONIC_MOVSX = 472, + ZYDIS_MNEMONIC_MOVSXD = 473, + ZYDIS_MNEMONIC_MOVUPD = 474, + ZYDIS_MNEMONIC_MOVUPS = 475, + ZYDIS_MNEMONIC_MOVZX = 476, + ZYDIS_MNEMONIC_MPSADBW = 477, + ZYDIS_MNEMONIC_MUL = 478, + ZYDIS_MNEMONIC_MULPD = 479, + ZYDIS_MNEMONIC_MULPS = 480, + ZYDIS_MNEMONIC_MULSD = 481, + ZYDIS_MNEMONIC_MULSS = 482, + ZYDIS_MNEMONIC_MULX = 483, + ZYDIS_MNEMONIC_MWAIT = 484, + ZYDIS_MNEMONIC_MWAITX = 485, + ZYDIS_MNEMONIC_NEG = 486, + ZYDIS_MNEMONIC_NOP = 487, + ZYDIS_MNEMONIC_NOT = 488, + ZYDIS_MNEMONIC_OR = 489, + ZYDIS_MNEMONIC_ORPD = 490, + ZYDIS_MNEMONIC_ORPS = 491, + ZYDIS_MNEMONIC_OUT = 492, + ZYDIS_MNEMONIC_OUTSB = 493, + ZYDIS_MNEMONIC_OUTSD = 494, + ZYDIS_MNEMONIC_OUTSW = 495, + ZYDIS_MNEMONIC_PABSB = 496, + ZYDIS_MNEMONIC_PABSD = 497, + ZYDIS_MNEMONIC_PABSW = 498, + ZYDIS_MNEMONIC_PACKSSDW = 499, + ZYDIS_MNEMONIC_PACKSSWB = 500, + ZYDIS_MNEMONIC_PACKUSDW = 501, + ZYDIS_MNEMONIC_PACKUSWB = 502, + ZYDIS_MNEMONIC_PADDB = 503, + ZYDIS_MNEMONIC_PADDD = 504, + ZYDIS_MNEMONIC_PADDQ = 505, + ZYDIS_MNEMONIC_PADDSB = 506, + ZYDIS_MNEMONIC_PADDSW = 507, + ZYDIS_MNEMONIC_PADDUSB = 508, + ZYDIS_MNEMONIC_PADDUSW = 509, + ZYDIS_MNEMONIC_PADDW = 510, + ZYDIS_MNEMONIC_PALIGNR = 511, + ZYDIS_MNEMONIC_PAND = 512, + ZYDIS_MNEMONIC_PANDN = 513, + ZYDIS_MNEMONIC_PAUSE = 514, + ZYDIS_MNEMONIC_PAVGB = 515, + ZYDIS_MNEMONIC_PAVGUSB = 516, + ZYDIS_MNEMONIC_PAVGW = 517, + ZYDIS_MNEMONIC_PBLENDVB = 518, + ZYDIS_MNEMONIC_PBLENDW = 519, + ZYDIS_MNEMONIC_PBNDKB = 520, + ZYDIS_MNEMONIC_PCLMULQDQ = 521, + ZYDIS_MNEMONIC_PCMPEQB = 522, + ZYDIS_MNEMONIC_PCMPEQD = 523, + ZYDIS_MNEMONIC_PCMPEQQ = 524, + ZYDIS_MNEMONIC_PCMPEQW = 525, + ZYDIS_MNEMONIC_PCMPESTRI = 526, + ZYDIS_MNEMONIC_PCMPESTRM = 527, + ZYDIS_MNEMONIC_PCMPGTB = 528, + ZYDIS_MNEMONIC_PCMPGTD = 529, + ZYDIS_MNEMONIC_PCMPGTQ = 530, + ZYDIS_MNEMONIC_PCMPGTW = 531, + ZYDIS_MNEMONIC_PCMPISTRI = 532, + ZYDIS_MNEMONIC_PCMPISTRM = 533, + ZYDIS_MNEMONIC_PCOMMIT = 534, + ZYDIS_MNEMONIC_PCONFIG = 535, + ZYDIS_MNEMONIC_PDEP = 536, + ZYDIS_MNEMONIC_PEXT = 537, + ZYDIS_MNEMONIC_PEXTRB = 538, + ZYDIS_MNEMONIC_PEXTRD = 539, + ZYDIS_MNEMONIC_PEXTRQ = 540, + ZYDIS_MNEMONIC_PEXTRW = 541, + ZYDIS_MNEMONIC_PF2ID = 542, + ZYDIS_MNEMONIC_PF2IW = 543, + ZYDIS_MNEMONIC_PFACC = 544, + ZYDIS_MNEMONIC_PFADD = 545, + ZYDIS_MNEMONIC_PFCMPEQ = 546, + ZYDIS_MNEMONIC_PFCMPGE = 547, + ZYDIS_MNEMONIC_PFCMPGT = 548, + ZYDIS_MNEMONIC_PFCPIT1 = 549, + ZYDIS_MNEMONIC_PFMAX = 550, + ZYDIS_MNEMONIC_PFMIN = 551, + ZYDIS_MNEMONIC_PFMUL = 552, + ZYDIS_MNEMONIC_PFNACC = 553, + ZYDIS_MNEMONIC_PFPNACC = 554, + ZYDIS_MNEMONIC_PFRCP = 555, + ZYDIS_MNEMONIC_PFRCPIT2 = 556, + ZYDIS_MNEMONIC_PFRSQIT1 = 557, + ZYDIS_MNEMONIC_PFSQRT = 558, + ZYDIS_MNEMONIC_PFSUB = 559, + ZYDIS_MNEMONIC_PFSUBR = 560, + ZYDIS_MNEMONIC_PHADDD = 561, + ZYDIS_MNEMONIC_PHADDSW = 562, + ZYDIS_MNEMONIC_PHADDW = 563, + ZYDIS_MNEMONIC_PHMINPOSUW = 564, + ZYDIS_MNEMONIC_PHSUBD = 565, + ZYDIS_MNEMONIC_PHSUBSW = 566, + ZYDIS_MNEMONIC_PHSUBW = 567, + ZYDIS_MNEMONIC_PI2FD = 568, + ZYDIS_MNEMONIC_PI2FW = 569, + ZYDIS_MNEMONIC_PINSRB = 570, + ZYDIS_MNEMONIC_PINSRD = 571, + ZYDIS_MNEMONIC_PINSRQ = 572, + ZYDIS_MNEMONIC_PINSRW = 573, + ZYDIS_MNEMONIC_PMADDUBSW = 574, + ZYDIS_MNEMONIC_PMADDWD = 575, + ZYDIS_MNEMONIC_PMAXSB = 576, + ZYDIS_MNEMONIC_PMAXSD = 577, + ZYDIS_MNEMONIC_PMAXSW = 578, + ZYDIS_MNEMONIC_PMAXUB = 579, + ZYDIS_MNEMONIC_PMAXUD = 580, + ZYDIS_MNEMONIC_PMAXUW = 581, + ZYDIS_MNEMONIC_PMINSB = 582, + ZYDIS_MNEMONIC_PMINSD = 583, + ZYDIS_MNEMONIC_PMINSW = 584, + ZYDIS_MNEMONIC_PMINUB = 585, + ZYDIS_MNEMONIC_PMINUD = 586, + ZYDIS_MNEMONIC_PMINUW = 587, + ZYDIS_MNEMONIC_PMOVMSKB = 588, + ZYDIS_MNEMONIC_PMOVSXBD = 589, + ZYDIS_MNEMONIC_PMOVSXBQ = 590, + ZYDIS_MNEMONIC_PMOVSXBW = 591, + ZYDIS_MNEMONIC_PMOVSXDQ = 592, + ZYDIS_MNEMONIC_PMOVSXWD = 593, + ZYDIS_MNEMONIC_PMOVSXWQ = 594, + ZYDIS_MNEMONIC_PMOVZXBD = 595, + ZYDIS_MNEMONIC_PMOVZXBQ = 596, + ZYDIS_MNEMONIC_PMOVZXBW = 597, + ZYDIS_MNEMONIC_PMOVZXDQ = 598, + ZYDIS_MNEMONIC_PMOVZXWD = 599, + ZYDIS_MNEMONIC_PMOVZXWQ = 600, + ZYDIS_MNEMONIC_PMULDQ = 601, + ZYDIS_MNEMONIC_PMULHRSW = 602, + ZYDIS_MNEMONIC_PMULHRW = 603, + ZYDIS_MNEMONIC_PMULHUW = 604, + ZYDIS_MNEMONIC_PMULHW = 605, + ZYDIS_MNEMONIC_PMULLD = 606, + ZYDIS_MNEMONIC_PMULLW = 607, + ZYDIS_MNEMONIC_PMULUDQ = 608, + ZYDIS_MNEMONIC_POP = 609, + ZYDIS_MNEMONIC_POPA = 610, + ZYDIS_MNEMONIC_POPAD = 611, + ZYDIS_MNEMONIC_POPCNT = 612, + ZYDIS_MNEMONIC_POPF = 613, + ZYDIS_MNEMONIC_POPFD = 614, + ZYDIS_MNEMONIC_POPFQ = 615, + ZYDIS_MNEMONIC_POR = 616, + ZYDIS_MNEMONIC_PREFETCH = 617, + ZYDIS_MNEMONIC_PREFETCHIT0 = 618, + ZYDIS_MNEMONIC_PREFETCHIT1 = 619, + ZYDIS_MNEMONIC_PREFETCHNTA = 620, + ZYDIS_MNEMONIC_PREFETCHT0 = 621, + ZYDIS_MNEMONIC_PREFETCHT1 = 622, + ZYDIS_MNEMONIC_PREFETCHT2 = 623, + ZYDIS_MNEMONIC_PREFETCHW = 624, + ZYDIS_MNEMONIC_PREFETCHWT1 = 625, + ZYDIS_MNEMONIC_PSADBW = 626, + ZYDIS_MNEMONIC_PSHUFB = 627, + ZYDIS_MNEMONIC_PSHUFD = 628, + ZYDIS_MNEMONIC_PSHUFHW = 629, + ZYDIS_MNEMONIC_PSHUFLW = 630, + ZYDIS_MNEMONIC_PSHUFW = 631, + ZYDIS_MNEMONIC_PSIGNB = 632, + ZYDIS_MNEMONIC_PSIGND = 633, + ZYDIS_MNEMONIC_PSIGNW = 634, + ZYDIS_MNEMONIC_PSLLD = 635, + ZYDIS_MNEMONIC_PSLLDQ = 636, + ZYDIS_MNEMONIC_PSLLQ = 637, + ZYDIS_MNEMONIC_PSLLW = 638, + ZYDIS_MNEMONIC_PSMASH = 639, + ZYDIS_MNEMONIC_PSRAD = 640, + ZYDIS_MNEMONIC_PSRAW = 641, + ZYDIS_MNEMONIC_PSRLD = 642, + ZYDIS_MNEMONIC_PSRLDQ = 643, + ZYDIS_MNEMONIC_PSRLQ = 644, + ZYDIS_MNEMONIC_PSRLW = 645, + ZYDIS_MNEMONIC_PSUBB = 646, + ZYDIS_MNEMONIC_PSUBD = 647, + ZYDIS_MNEMONIC_PSUBQ = 648, + ZYDIS_MNEMONIC_PSUBSB = 649, + ZYDIS_MNEMONIC_PSUBSW = 650, + ZYDIS_MNEMONIC_PSUBUSB = 651, + ZYDIS_MNEMONIC_PSUBUSW = 652, + ZYDIS_MNEMONIC_PSUBW = 653, + ZYDIS_MNEMONIC_PSWAPD = 654, + ZYDIS_MNEMONIC_PTEST = 655, + ZYDIS_MNEMONIC_PTWRITE = 656, + ZYDIS_MNEMONIC_PUNPCKHBW = 657, + ZYDIS_MNEMONIC_PUNPCKHDQ = 658, + ZYDIS_MNEMONIC_PUNPCKHQDQ = 659, + ZYDIS_MNEMONIC_PUNPCKHWD = 660, + ZYDIS_MNEMONIC_PUNPCKLBW = 661, + ZYDIS_MNEMONIC_PUNPCKLDQ = 662, + ZYDIS_MNEMONIC_PUNPCKLQDQ = 663, + ZYDIS_MNEMONIC_PUNPCKLWD = 664, + ZYDIS_MNEMONIC_PUSH = 665, + ZYDIS_MNEMONIC_PUSHA = 666, + ZYDIS_MNEMONIC_PUSHAD = 667, + ZYDIS_MNEMONIC_PUSHF = 668, + ZYDIS_MNEMONIC_PUSHFD = 669, + ZYDIS_MNEMONIC_PUSHFQ = 670, + ZYDIS_MNEMONIC_PVALIDATE = 671, + ZYDIS_MNEMONIC_PXOR = 672, + ZYDIS_MNEMONIC_RCL = 673, + ZYDIS_MNEMONIC_RCPPS = 674, + ZYDIS_MNEMONIC_RCPSS = 675, + ZYDIS_MNEMONIC_RCR = 676, + ZYDIS_MNEMONIC_RDFSBASE = 677, + ZYDIS_MNEMONIC_RDGSBASE = 678, + ZYDIS_MNEMONIC_RDMSR = 679, + ZYDIS_MNEMONIC_RDMSRLIST = 680, + ZYDIS_MNEMONIC_RDPID = 681, + ZYDIS_MNEMONIC_RDPKRU = 682, + ZYDIS_MNEMONIC_RDPMC = 683, + ZYDIS_MNEMONIC_RDPRU = 684, + ZYDIS_MNEMONIC_RDRAND = 685, + ZYDIS_MNEMONIC_RDSEED = 686, + ZYDIS_MNEMONIC_RDSSPD = 687, + ZYDIS_MNEMONIC_RDSSPQ = 688, + ZYDIS_MNEMONIC_RDTSC = 689, + ZYDIS_MNEMONIC_RDTSCP = 690, + ZYDIS_MNEMONIC_RET = 691, + ZYDIS_MNEMONIC_RMPADJUST = 692, + ZYDIS_MNEMONIC_RMPUPDATE = 693, + ZYDIS_MNEMONIC_ROL = 694, + ZYDIS_MNEMONIC_ROR = 695, + ZYDIS_MNEMONIC_RORX = 696, + ZYDIS_MNEMONIC_ROUNDPD = 697, + ZYDIS_MNEMONIC_ROUNDPS = 698, + ZYDIS_MNEMONIC_ROUNDSD = 699, + ZYDIS_MNEMONIC_ROUNDSS = 700, + ZYDIS_MNEMONIC_RSM = 701, + ZYDIS_MNEMONIC_RSQRTPS = 702, + ZYDIS_MNEMONIC_RSQRTSS = 703, + ZYDIS_MNEMONIC_RSTORSSP = 704, + ZYDIS_MNEMONIC_SAHF = 705, + ZYDIS_MNEMONIC_SALC = 706, + ZYDIS_MNEMONIC_SAR = 707, + ZYDIS_MNEMONIC_SARX = 708, + ZYDIS_MNEMONIC_SAVEPREVSSP = 709, + ZYDIS_MNEMONIC_SBB = 710, + ZYDIS_MNEMONIC_SCASB = 711, + ZYDIS_MNEMONIC_SCASD = 712, + ZYDIS_MNEMONIC_SCASQ = 713, + ZYDIS_MNEMONIC_SCASW = 714, + ZYDIS_MNEMONIC_SEAMCALL = 715, + ZYDIS_MNEMONIC_SEAMOPS = 716, + ZYDIS_MNEMONIC_SEAMRET = 717, + ZYDIS_MNEMONIC_SENDUIPI = 718, + ZYDIS_MNEMONIC_SERIALIZE = 719, + ZYDIS_MNEMONIC_SETB = 720, + ZYDIS_MNEMONIC_SETBE = 721, + ZYDIS_MNEMONIC_SETL = 722, + ZYDIS_MNEMONIC_SETLE = 723, + ZYDIS_MNEMONIC_SETNB = 724, + ZYDIS_MNEMONIC_SETNBE = 725, + ZYDIS_MNEMONIC_SETNL = 726, + ZYDIS_MNEMONIC_SETNLE = 727, + ZYDIS_MNEMONIC_SETNO = 728, + ZYDIS_MNEMONIC_SETNP = 729, + ZYDIS_MNEMONIC_SETNS = 730, + ZYDIS_MNEMONIC_SETNZ = 731, + ZYDIS_MNEMONIC_SETO = 732, + ZYDIS_MNEMONIC_SETP = 733, + ZYDIS_MNEMONIC_SETS = 734, + ZYDIS_MNEMONIC_SETSSBSY = 735, + ZYDIS_MNEMONIC_SETZ = 736, + ZYDIS_MNEMONIC_SFENCE = 737, + ZYDIS_MNEMONIC_SGDT = 738, + ZYDIS_MNEMONIC_SHA1MSG1 = 739, + ZYDIS_MNEMONIC_SHA1MSG2 = 740, + ZYDIS_MNEMONIC_SHA1NEXTE = 741, + ZYDIS_MNEMONIC_SHA1RNDS4 = 742, + ZYDIS_MNEMONIC_SHA256MSG1 = 743, + ZYDIS_MNEMONIC_SHA256MSG2 = 744, + ZYDIS_MNEMONIC_SHA256RNDS2 = 745, + ZYDIS_MNEMONIC_SHL = 746, + ZYDIS_MNEMONIC_SHLD = 747, + ZYDIS_MNEMONIC_SHLX = 748, + ZYDIS_MNEMONIC_SHR = 749, + ZYDIS_MNEMONIC_SHRD = 750, + ZYDIS_MNEMONIC_SHRX = 751, + ZYDIS_MNEMONIC_SHUFPD = 752, + ZYDIS_MNEMONIC_SHUFPS = 753, + ZYDIS_MNEMONIC_SIDT = 754, + ZYDIS_MNEMONIC_SKINIT = 755, + ZYDIS_MNEMONIC_SLDT = 756, + ZYDIS_MNEMONIC_SLWPCB = 757, + ZYDIS_MNEMONIC_SMSW = 758, + ZYDIS_MNEMONIC_SPFLT = 759, + ZYDIS_MNEMONIC_SQRTPD = 760, + ZYDIS_MNEMONIC_SQRTPS = 761, + ZYDIS_MNEMONIC_SQRTSD = 762, + ZYDIS_MNEMONIC_SQRTSS = 763, + ZYDIS_MNEMONIC_STAC = 764, + ZYDIS_MNEMONIC_STC = 765, + ZYDIS_MNEMONIC_STD = 766, + ZYDIS_MNEMONIC_STGI = 767, + ZYDIS_MNEMONIC_STI = 768, + ZYDIS_MNEMONIC_STMXCSR = 769, + ZYDIS_MNEMONIC_STOSB = 770, + ZYDIS_MNEMONIC_STOSD = 771, + ZYDIS_MNEMONIC_STOSQ = 772, + ZYDIS_MNEMONIC_STOSW = 773, + ZYDIS_MNEMONIC_STR = 774, + ZYDIS_MNEMONIC_STTILECFG = 775, + ZYDIS_MNEMONIC_STUI = 776, + ZYDIS_MNEMONIC_SUB = 777, + ZYDIS_MNEMONIC_SUBPD = 778, + ZYDIS_MNEMONIC_SUBPS = 779, + ZYDIS_MNEMONIC_SUBSD = 780, + ZYDIS_MNEMONIC_SUBSS = 781, + ZYDIS_MNEMONIC_SWAPGS = 782, + ZYDIS_MNEMONIC_SYSCALL = 783, + ZYDIS_MNEMONIC_SYSENTER = 784, + ZYDIS_MNEMONIC_SYSEXIT = 785, + ZYDIS_MNEMONIC_SYSRET = 786, + ZYDIS_MNEMONIC_T1MSKC = 787, + ZYDIS_MNEMONIC_TDCALL = 788, + ZYDIS_MNEMONIC_TDPBF16PS = 789, + ZYDIS_MNEMONIC_TDPBSSD = 790, + ZYDIS_MNEMONIC_TDPBSUD = 791, + ZYDIS_MNEMONIC_TDPBUSD = 792, + ZYDIS_MNEMONIC_TDPBUUD = 793, + ZYDIS_MNEMONIC_TDPFP16PS = 794, + ZYDIS_MNEMONIC_TEST = 795, + ZYDIS_MNEMONIC_TESTUI = 796, + ZYDIS_MNEMONIC_TILELOADD = 797, + ZYDIS_MNEMONIC_TILELOADDT1 = 798, + ZYDIS_MNEMONIC_TILERELEASE = 799, + ZYDIS_MNEMONIC_TILESTORED = 800, + ZYDIS_MNEMONIC_TILEZERO = 801, + ZYDIS_MNEMONIC_TLBSYNC = 802, + ZYDIS_MNEMONIC_TPAUSE = 803, + ZYDIS_MNEMONIC_TZCNT = 804, + ZYDIS_MNEMONIC_TZCNTI = 805, + ZYDIS_MNEMONIC_TZMSK = 806, + ZYDIS_MNEMONIC_UCOMISD = 807, + ZYDIS_MNEMONIC_UCOMISS = 808, + ZYDIS_MNEMONIC_UD0 = 809, + ZYDIS_MNEMONIC_UD1 = 810, + ZYDIS_MNEMONIC_UD2 = 811, + ZYDIS_MNEMONIC_UIRET = 812, + ZYDIS_MNEMONIC_UMONITOR = 813, + ZYDIS_MNEMONIC_UMWAIT = 814, + ZYDIS_MNEMONIC_UNPCKHPD = 815, + ZYDIS_MNEMONIC_UNPCKHPS = 816, + ZYDIS_MNEMONIC_UNPCKLPD = 817, + ZYDIS_MNEMONIC_UNPCKLPS = 818, + ZYDIS_MNEMONIC_V4FMADDPS = 819, + ZYDIS_MNEMONIC_V4FMADDSS = 820, + ZYDIS_MNEMONIC_V4FNMADDPS = 821, + ZYDIS_MNEMONIC_V4FNMADDSS = 822, + ZYDIS_MNEMONIC_VADDNPD = 823, + ZYDIS_MNEMONIC_VADDNPS = 824, + ZYDIS_MNEMONIC_VADDPD = 825, + ZYDIS_MNEMONIC_VADDPH = 826, + ZYDIS_MNEMONIC_VADDPS = 827, + ZYDIS_MNEMONIC_VADDSD = 828, + ZYDIS_MNEMONIC_VADDSETSPS = 829, + ZYDIS_MNEMONIC_VADDSH = 830, + ZYDIS_MNEMONIC_VADDSS = 831, + ZYDIS_MNEMONIC_VADDSUBPD = 832, + ZYDIS_MNEMONIC_VADDSUBPS = 833, + ZYDIS_MNEMONIC_VAESDEC = 834, + ZYDIS_MNEMONIC_VAESDECLAST = 835, + ZYDIS_MNEMONIC_VAESENC = 836, + ZYDIS_MNEMONIC_VAESENCLAST = 837, + ZYDIS_MNEMONIC_VAESIMC = 838, + ZYDIS_MNEMONIC_VAESKEYGENASSIST = 839, + ZYDIS_MNEMONIC_VALIGND = 840, + ZYDIS_MNEMONIC_VALIGNQ = 841, + ZYDIS_MNEMONIC_VANDNPD = 842, + ZYDIS_MNEMONIC_VANDNPS = 843, + ZYDIS_MNEMONIC_VANDPD = 844, + ZYDIS_MNEMONIC_VANDPS = 845, + ZYDIS_MNEMONIC_VBCSTNEBF162PS = 846, + ZYDIS_MNEMONIC_VBCSTNESH2PS = 847, + ZYDIS_MNEMONIC_VBLENDMPD = 848, + ZYDIS_MNEMONIC_VBLENDMPS = 849, + ZYDIS_MNEMONIC_VBLENDPD = 850, + ZYDIS_MNEMONIC_VBLENDPS = 851, + ZYDIS_MNEMONIC_VBLENDVPD = 852, + ZYDIS_MNEMONIC_VBLENDVPS = 853, + ZYDIS_MNEMONIC_VBROADCASTF128 = 854, + ZYDIS_MNEMONIC_VBROADCASTF32X2 = 855, + ZYDIS_MNEMONIC_VBROADCASTF32X4 = 856, + ZYDIS_MNEMONIC_VBROADCASTF32X8 = 857, + ZYDIS_MNEMONIC_VBROADCASTF64X2 = 858, + ZYDIS_MNEMONIC_VBROADCASTF64X4 = 859, + ZYDIS_MNEMONIC_VBROADCASTI128 = 860, + ZYDIS_MNEMONIC_VBROADCASTI32X2 = 861, + ZYDIS_MNEMONIC_VBROADCASTI32X4 = 862, + ZYDIS_MNEMONIC_VBROADCASTI32X8 = 863, + ZYDIS_MNEMONIC_VBROADCASTI64X2 = 864, + ZYDIS_MNEMONIC_VBROADCASTI64X4 = 865, + ZYDIS_MNEMONIC_VBROADCASTSD = 866, + ZYDIS_MNEMONIC_VBROADCASTSS = 867, + ZYDIS_MNEMONIC_VCMPPD = 868, + ZYDIS_MNEMONIC_VCMPPH = 869, + ZYDIS_MNEMONIC_VCMPPS = 870, + ZYDIS_MNEMONIC_VCMPSD = 871, + ZYDIS_MNEMONIC_VCMPSH = 872, + ZYDIS_MNEMONIC_VCMPSS = 873, + ZYDIS_MNEMONIC_VCOMISD = 874, + ZYDIS_MNEMONIC_VCOMISH = 875, + ZYDIS_MNEMONIC_VCOMISS = 876, + ZYDIS_MNEMONIC_VCOMPRESSPD = 877, + ZYDIS_MNEMONIC_VCOMPRESSPS = 878, + ZYDIS_MNEMONIC_VCVTDQ2PD = 879, + ZYDIS_MNEMONIC_VCVTDQ2PH = 880, + ZYDIS_MNEMONIC_VCVTDQ2PS = 881, + ZYDIS_MNEMONIC_VCVTFXPNTDQ2PS = 882, + ZYDIS_MNEMONIC_VCVTFXPNTPD2DQ = 883, + ZYDIS_MNEMONIC_VCVTFXPNTPD2UDQ = 884, + ZYDIS_MNEMONIC_VCVTFXPNTPS2DQ = 885, + ZYDIS_MNEMONIC_VCVTFXPNTPS2UDQ = 886, + ZYDIS_MNEMONIC_VCVTFXPNTUDQ2PS = 887, + ZYDIS_MNEMONIC_VCVTNE2PS2BF16 = 888, + ZYDIS_MNEMONIC_VCVTNEEBF162PS = 889, + ZYDIS_MNEMONIC_VCVTNEEPH2PS = 890, + ZYDIS_MNEMONIC_VCVTNEOBF162PS = 891, + ZYDIS_MNEMONIC_VCVTNEOPH2PS = 892, + ZYDIS_MNEMONIC_VCVTNEPS2BF16 = 893, + ZYDIS_MNEMONIC_VCVTPD2DQ = 894, + ZYDIS_MNEMONIC_VCVTPD2PH = 895, + ZYDIS_MNEMONIC_VCVTPD2PS = 896, + ZYDIS_MNEMONIC_VCVTPD2QQ = 897, + ZYDIS_MNEMONIC_VCVTPD2UDQ = 898, + ZYDIS_MNEMONIC_VCVTPD2UQQ = 899, + ZYDIS_MNEMONIC_VCVTPH2DQ = 900, + ZYDIS_MNEMONIC_VCVTPH2PD = 901, + ZYDIS_MNEMONIC_VCVTPH2PS = 902, + ZYDIS_MNEMONIC_VCVTPH2PSX = 903, + ZYDIS_MNEMONIC_VCVTPH2QQ = 904, + ZYDIS_MNEMONIC_VCVTPH2UDQ = 905, + ZYDIS_MNEMONIC_VCVTPH2UQQ = 906, + ZYDIS_MNEMONIC_VCVTPH2UW = 907, + ZYDIS_MNEMONIC_VCVTPH2W = 908, + ZYDIS_MNEMONIC_VCVTPS2DQ = 909, + ZYDIS_MNEMONIC_VCVTPS2PD = 910, + ZYDIS_MNEMONIC_VCVTPS2PH = 911, + ZYDIS_MNEMONIC_VCVTPS2PHX = 912, + ZYDIS_MNEMONIC_VCVTPS2QQ = 913, + ZYDIS_MNEMONIC_VCVTPS2UDQ = 914, + ZYDIS_MNEMONIC_VCVTPS2UQQ = 915, + ZYDIS_MNEMONIC_VCVTQQ2PD = 916, + ZYDIS_MNEMONIC_VCVTQQ2PH = 917, + ZYDIS_MNEMONIC_VCVTQQ2PS = 918, + ZYDIS_MNEMONIC_VCVTSD2SH = 919, + ZYDIS_MNEMONIC_VCVTSD2SI = 920, + ZYDIS_MNEMONIC_VCVTSD2SS = 921, + ZYDIS_MNEMONIC_VCVTSD2USI = 922, + ZYDIS_MNEMONIC_VCVTSH2SD = 923, + ZYDIS_MNEMONIC_VCVTSH2SI = 924, + ZYDIS_MNEMONIC_VCVTSH2SS = 925, + ZYDIS_MNEMONIC_VCVTSH2USI = 926, + ZYDIS_MNEMONIC_VCVTSI2SD = 927, + ZYDIS_MNEMONIC_VCVTSI2SH = 928, + ZYDIS_MNEMONIC_VCVTSI2SS = 929, + ZYDIS_MNEMONIC_VCVTSS2SD = 930, + ZYDIS_MNEMONIC_VCVTSS2SH = 931, + ZYDIS_MNEMONIC_VCVTSS2SI = 932, + ZYDIS_MNEMONIC_VCVTSS2USI = 933, + ZYDIS_MNEMONIC_VCVTTPD2DQ = 934, + ZYDIS_MNEMONIC_VCVTTPD2QQ = 935, + ZYDIS_MNEMONIC_VCVTTPD2UDQ = 936, + ZYDIS_MNEMONIC_VCVTTPD2UQQ = 937, + ZYDIS_MNEMONIC_VCVTTPH2DQ = 938, + ZYDIS_MNEMONIC_VCVTTPH2QQ = 939, + ZYDIS_MNEMONIC_VCVTTPH2UDQ = 940, + ZYDIS_MNEMONIC_VCVTTPH2UQQ = 941, + ZYDIS_MNEMONIC_VCVTTPH2UW = 942, + ZYDIS_MNEMONIC_VCVTTPH2W = 943, + ZYDIS_MNEMONIC_VCVTTPS2DQ = 944, + ZYDIS_MNEMONIC_VCVTTPS2QQ = 945, + ZYDIS_MNEMONIC_VCVTTPS2UDQ = 946, + ZYDIS_MNEMONIC_VCVTTPS2UQQ = 947, + ZYDIS_MNEMONIC_VCVTTSD2SI = 948, + ZYDIS_MNEMONIC_VCVTTSD2USI = 949, + ZYDIS_MNEMONIC_VCVTTSH2SI = 950, + ZYDIS_MNEMONIC_VCVTTSH2USI = 951, + ZYDIS_MNEMONIC_VCVTTSS2SI = 952, + ZYDIS_MNEMONIC_VCVTTSS2USI = 953, + ZYDIS_MNEMONIC_VCVTUDQ2PD = 954, + ZYDIS_MNEMONIC_VCVTUDQ2PH = 955, + ZYDIS_MNEMONIC_VCVTUDQ2PS = 956, + ZYDIS_MNEMONIC_VCVTUQQ2PD = 957, + ZYDIS_MNEMONIC_VCVTUQQ2PH = 958, + ZYDIS_MNEMONIC_VCVTUQQ2PS = 959, + ZYDIS_MNEMONIC_VCVTUSI2SD = 960, + ZYDIS_MNEMONIC_VCVTUSI2SH = 961, + ZYDIS_MNEMONIC_VCVTUSI2SS = 962, + ZYDIS_MNEMONIC_VCVTUW2PH = 963, + ZYDIS_MNEMONIC_VCVTW2PH = 964, + ZYDIS_MNEMONIC_VDBPSADBW = 965, + ZYDIS_MNEMONIC_VDIVPD = 966, + ZYDIS_MNEMONIC_VDIVPH = 967, + ZYDIS_MNEMONIC_VDIVPS = 968, + ZYDIS_MNEMONIC_VDIVSD = 969, + ZYDIS_MNEMONIC_VDIVSH = 970, + ZYDIS_MNEMONIC_VDIVSS = 971, + ZYDIS_MNEMONIC_VDPBF16PS = 972, + ZYDIS_MNEMONIC_VDPPD = 973, + ZYDIS_MNEMONIC_VDPPS = 974, + ZYDIS_MNEMONIC_VERR = 975, + ZYDIS_MNEMONIC_VERW = 976, + ZYDIS_MNEMONIC_VEXP223PS = 977, + ZYDIS_MNEMONIC_VEXP2PD = 978, + ZYDIS_MNEMONIC_VEXP2PS = 979, + ZYDIS_MNEMONIC_VEXPANDPD = 980, + ZYDIS_MNEMONIC_VEXPANDPS = 981, + ZYDIS_MNEMONIC_VEXTRACTF128 = 982, + ZYDIS_MNEMONIC_VEXTRACTF32X4 = 983, + ZYDIS_MNEMONIC_VEXTRACTF32X8 = 984, + ZYDIS_MNEMONIC_VEXTRACTF64X2 = 985, + ZYDIS_MNEMONIC_VEXTRACTF64X4 = 986, + ZYDIS_MNEMONIC_VEXTRACTI128 = 987, + ZYDIS_MNEMONIC_VEXTRACTI32X4 = 988, + ZYDIS_MNEMONIC_VEXTRACTI32X8 = 989, + ZYDIS_MNEMONIC_VEXTRACTI64X2 = 990, + ZYDIS_MNEMONIC_VEXTRACTI64X4 = 991, + ZYDIS_MNEMONIC_VEXTRACTPS = 992, + ZYDIS_MNEMONIC_VFCMADDCPH = 993, + ZYDIS_MNEMONIC_VFCMADDCSH = 994, + ZYDIS_MNEMONIC_VFCMULCPH = 995, + ZYDIS_MNEMONIC_VFCMULCSH = 996, + ZYDIS_MNEMONIC_VFIXUPIMMPD = 997, + ZYDIS_MNEMONIC_VFIXUPIMMPS = 998, + ZYDIS_MNEMONIC_VFIXUPIMMSD = 999, + ZYDIS_MNEMONIC_VFIXUPIMMSS = 1000, + ZYDIS_MNEMONIC_VFIXUPNANPD = 1001, + ZYDIS_MNEMONIC_VFIXUPNANPS = 1002, + ZYDIS_MNEMONIC_VFMADD132PD = 1003, + ZYDIS_MNEMONIC_VFMADD132PH = 1004, + ZYDIS_MNEMONIC_VFMADD132PS = 1005, + ZYDIS_MNEMONIC_VFMADD132SD = 1006, + ZYDIS_MNEMONIC_VFMADD132SH = 1007, + ZYDIS_MNEMONIC_VFMADD132SS = 1008, + ZYDIS_MNEMONIC_VFMADD213PD = 1009, + ZYDIS_MNEMONIC_VFMADD213PH = 1010, + ZYDIS_MNEMONIC_VFMADD213PS = 1011, + ZYDIS_MNEMONIC_VFMADD213SD = 1012, + ZYDIS_MNEMONIC_VFMADD213SH = 1013, + ZYDIS_MNEMONIC_VFMADD213SS = 1014, + ZYDIS_MNEMONIC_VFMADD231PD = 1015, + ZYDIS_MNEMONIC_VFMADD231PH = 1016, + ZYDIS_MNEMONIC_VFMADD231PS = 1017, + ZYDIS_MNEMONIC_VFMADD231SD = 1018, + ZYDIS_MNEMONIC_VFMADD231SH = 1019, + ZYDIS_MNEMONIC_VFMADD231SS = 1020, + ZYDIS_MNEMONIC_VFMADD233PS = 1021, + ZYDIS_MNEMONIC_VFMADDCPH = 1022, + ZYDIS_MNEMONIC_VFMADDCSH = 1023, + ZYDIS_MNEMONIC_VFMADDPD = 1024, + ZYDIS_MNEMONIC_VFMADDPS = 1025, + ZYDIS_MNEMONIC_VFMADDSD = 1026, + ZYDIS_MNEMONIC_VFMADDSS = 1027, + ZYDIS_MNEMONIC_VFMADDSUB132PD = 1028, + ZYDIS_MNEMONIC_VFMADDSUB132PH = 1029, + ZYDIS_MNEMONIC_VFMADDSUB132PS = 1030, + ZYDIS_MNEMONIC_VFMADDSUB213PD = 1031, + ZYDIS_MNEMONIC_VFMADDSUB213PH = 1032, + ZYDIS_MNEMONIC_VFMADDSUB213PS = 1033, + ZYDIS_MNEMONIC_VFMADDSUB231PD = 1034, + ZYDIS_MNEMONIC_VFMADDSUB231PH = 1035, + ZYDIS_MNEMONIC_VFMADDSUB231PS = 1036, + ZYDIS_MNEMONIC_VFMADDSUBPD = 1037, + ZYDIS_MNEMONIC_VFMADDSUBPS = 1038, + ZYDIS_MNEMONIC_VFMSUB132PD = 1039, + ZYDIS_MNEMONIC_VFMSUB132PH = 1040, + ZYDIS_MNEMONIC_VFMSUB132PS = 1041, + ZYDIS_MNEMONIC_VFMSUB132SD = 1042, + ZYDIS_MNEMONIC_VFMSUB132SH = 1043, + ZYDIS_MNEMONIC_VFMSUB132SS = 1044, + ZYDIS_MNEMONIC_VFMSUB213PD = 1045, + ZYDIS_MNEMONIC_VFMSUB213PH = 1046, + ZYDIS_MNEMONIC_VFMSUB213PS = 1047, + ZYDIS_MNEMONIC_VFMSUB213SD = 1048, + ZYDIS_MNEMONIC_VFMSUB213SH = 1049, + ZYDIS_MNEMONIC_VFMSUB213SS = 1050, + ZYDIS_MNEMONIC_VFMSUB231PD = 1051, + ZYDIS_MNEMONIC_VFMSUB231PH = 1052, + ZYDIS_MNEMONIC_VFMSUB231PS = 1053, + ZYDIS_MNEMONIC_VFMSUB231SD = 1054, + ZYDIS_MNEMONIC_VFMSUB231SH = 1055, + ZYDIS_MNEMONIC_VFMSUB231SS = 1056, + ZYDIS_MNEMONIC_VFMSUBADD132PD = 1057, + ZYDIS_MNEMONIC_VFMSUBADD132PH = 1058, + ZYDIS_MNEMONIC_VFMSUBADD132PS = 1059, + ZYDIS_MNEMONIC_VFMSUBADD213PD = 1060, + ZYDIS_MNEMONIC_VFMSUBADD213PH = 1061, + ZYDIS_MNEMONIC_VFMSUBADD213PS = 1062, + ZYDIS_MNEMONIC_VFMSUBADD231PD = 1063, + ZYDIS_MNEMONIC_VFMSUBADD231PH = 1064, + ZYDIS_MNEMONIC_VFMSUBADD231PS = 1065, + ZYDIS_MNEMONIC_VFMSUBADDPD = 1066, + ZYDIS_MNEMONIC_VFMSUBADDPS = 1067, + ZYDIS_MNEMONIC_VFMSUBPD = 1068, + ZYDIS_MNEMONIC_VFMSUBPS = 1069, + ZYDIS_MNEMONIC_VFMSUBSD = 1070, + ZYDIS_MNEMONIC_VFMSUBSS = 1071, + ZYDIS_MNEMONIC_VFMULCPH = 1072, + ZYDIS_MNEMONIC_VFMULCSH = 1073, + ZYDIS_MNEMONIC_VFNMADD132PD = 1074, + ZYDIS_MNEMONIC_VFNMADD132PH = 1075, + ZYDIS_MNEMONIC_VFNMADD132PS = 1076, + ZYDIS_MNEMONIC_VFNMADD132SD = 1077, + ZYDIS_MNEMONIC_VFNMADD132SH = 1078, + ZYDIS_MNEMONIC_VFNMADD132SS = 1079, + ZYDIS_MNEMONIC_VFNMADD213PD = 1080, + ZYDIS_MNEMONIC_VFNMADD213PH = 1081, + ZYDIS_MNEMONIC_VFNMADD213PS = 1082, + ZYDIS_MNEMONIC_VFNMADD213SD = 1083, + ZYDIS_MNEMONIC_VFNMADD213SH = 1084, + ZYDIS_MNEMONIC_VFNMADD213SS = 1085, + ZYDIS_MNEMONIC_VFNMADD231PD = 1086, + ZYDIS_MNEMONIC_VFNMADD231PH = 1087, + ZYDIS_MNEMONIC_VFNMADD231PS = 1088, + ZYDIS_MNEMONIC_VFNMADD231SD = 1089, + ZYDIS_MNEMONIC_VFNMADD231SH = 1090, + ZYDIS_MNEMONIC_VFNMADD231SS = 1091, + ZYDIS_MNEMONIC_VFNMADDPD = 1092, + ZYDIS_MNEMONIC_VFNMADDPS = 1093, + ZYDIS_MNEMONIC_VFNMADDSD = 1094, + ZYDIS_MNEMONIC_VFNMADDSS = 1095, + ZYDIS_MNEMONIC_VFNMSUB132PD = 1096, + ZYDIS_MNEMONIC_VFNMSUB132PH = 1097, + ZYDIS_MNEMONIC_VFNMSUB132PS = 1098, + ZYDIS_MNEMONIC_VFNMSUB132SD = 1099, + ZYDIS_MNEMONIC_VFNMSUB132SH = 1100, + ZYDIS_MNEMONIC_VFNMSUB132SS = 1101, + ZYDIS_MNEMONIC_VFNMSUB213PD = 1102, + ZYDIS_MNEMONIC_VFNMSUB213PH = 1103, + ZYDIS_MNEMONIC_VFNMSUB213PS = 1104, + ZYDIS_MNEMONIC_VFNMSUB213SD = 1105, + ZYDIS_MNEMONIC_VFNMSUB213SH = 1106, + ZYDIS_MNEMONIC_VFNMSUB213SS = 1107, + ZYDIS_MNEMONIC_VFNMSUB231PD = 1108, + ZYDIS_MNEMONIC_VFNMSUB231PH = 1109, + ZYDIS_MNEMONIC_VFNMSUB231PS = 1110, + ZYDIS_MNEMONIC_VFNMSUB231SD = 1111, + ZYDIS_MNEMONIC_VFNMSUB231SH = 1112, + ZYDIS_MNEMONIC_VFNMSUB231SS = 1113, + ZYDIS_MNEMONIC_VFNMSUBPD = 1114, + ZYDIS_MNEMONIC_VFNMSUBPS = 1115, + ZYDIS_MNEMONIC_VFNMSUBSD = 1116, + ZYDIS_MNEMONIC_VFNMSUBSS = 1117, + ZYDIS_MNEMONIC_VFPCLASSPD = 1118, + ZYDIS_MNEMONIC_VFPCLASSPH = 1119, + ZYDIS_MNEMONIC_VFPCLASSPS = 1120, + ZYDIS_MNEMONIC_VFPCLASSSD = 1121, + ZYDIS_MNEMONIC_VFPCLASSSH = 1122, + ZYDIS_MNEMONIC_VFPCLASSSS = 1123, + ZYDIS_MNEMONIC_VFRCZPD = 1124, + ZYDIS_MNEMONIC_VFRCZPS = 1125, + ZYDIS_MNEMONIC_VFRCZSD = 1126, + ZYDIS_MNEMONIC_VFRCZSS = 1127, + ZYDIS_MNEMONIC_VGATHERDPD = 1128, + ZYDIS_MNEMONIC_VGATHERDPS = 1129, + ZYDIS_MNEMONIC_VGATHERPF0DPD = 1130, + ZYDIS_MNEMONIC_VGATHERPF0DPS = 1131, + ZYDIS_MNEMONIC_VGATHERPF0HINTDPD = 1132, + ZYDIS_MNEMONIC_VGATHERPF0HINTDPS = 1133, + ZYDIS_MNEMONIC_VGATHERPF0QPD = 1134, + ZYDIS_MNEMONIC_VGATHERPF0QPS = 1135, + ZYDIS_MNEMONIC_VGATHERPF1DPD = 1136, + ZYDIS_MNEMONIC_VGATHERPF1DPS = 1137, + ZYDIS_MNEMONIC_VGATHERPF1QPD = 1138, + ZYDIS_MNEMONIC_VGATHERPF1QPS = 1139, + ZYDIS_MNEMONIC_VGATHERQPD = 1140, + ZYDIS_MNEMONIC_VGATHERQPS = 1141, + ZYDIS_MNEMONIC_VGETEXPPD = 1142, + ZYDIS_MNEMONIC_VGETEXPPH = 1143, + ZYDIS_MNEMONIC_VGETEXPPS = 1144, + ZYDIS_MNEMONIC_VGETEXPSD = 1145, + ZYDIS_MNEMONIC_VGETEXPSH = 1146, + ZYDIS_MNEMONIC_VGETEXPSS = 1147, + ZYDIS_MNEMONIC_VGETMANTPD = 1148, + ZYDIS_MNEMONIC_VGETMANTPH = 1149, + ZYDIS_MNEMONIC_VGETMANTPS = 1150, + ZYDIS_MNEMONIC_VGETMANTSD = 1151, + ZYDIS_MNEMONIC_VGETMANTSH = 1152, + ZYDIS_MNEMONIC_VGETMANTSS = 1153, + ZYDIS_MNEMONIC_VGF2P8AFFINEINVQB = 1154, + ZYDIS_MNEMONIC_VGF2P8AFFINEQB = 1155, + ZYDIS_MNEMONIC_VGF2P8MULB = 1156, + ZYDIS_MNEMONIC_VGMAXABSPS = 1157, + ZYDIS_MNEMONIC_VGMAXPD = 1158, + ZYDIS_MNEMONIC_VGMAXPS = 1159, + ZYDIS_MNEMONIC_VGMINPD = 1160, + ZYDIS_MNEMONIC_VGMINPS = 1161, + ZYDIS_MNEMONIC_VHADDPD = 1162, + ZYDIS_MNEMONIC_VHADDPS = 1163, + ZYDIS_MNEMONIC_VHSUBPD = 1164, + ZYDIS_MNEMONIC_VHSUBPS = 1165, + ZYDIS_MNEMONIC_VINSERTF128 = 1166, + ZYDIS_MNEMONIC_VINSERTF32X4 = 1167, + ZYDIS_MNEMONIC_VINSERTF32X8 = 1168, + ZYDIS_MNEMONIC_VINSERTF64X2 = 1169, + ZYDIS_MNEMONIC_VINSERTF64X4 = 1170, + ZYDIS_MNEMONIC_VINSERTI128 = 1171, + ZYDIS_MNEMONIC_VINSERTI32X4 = 1172, + ZYDIS_MNEMONIC_VINSERTI32X8 = 1173, + ZYDIS_MNEMONIC_VINSERTI64X2 = 1174, + ZYDIS_MNEMONIC_VINSERTI64X4 = 1175, + ZYDIS_MNEMONIC_VINSERTPS = 1176, + ZYDIS_MNEMONIC_VLDDQU = 1177, + ZYDIS_MNEMONIC_VLDMXCSR = 1178, + ZYDIS_MNEMONIC_VLOADUNPACKHD = 1179, + ZYDIS_MNEMONIC_VLOADUNPACKHPD = 1180, + ZYDIS_MNEMONIC_VLOADUNPACKHPS = 1181, + ZYDIS_MNEMONIC_VLOADUNPACKHQ = 1182, + ZYDIS_MNEMONIC_VLOADUNPACKLD = 1183, + ZYDIS_MNEMONIC_VLOADUNPACKLPD = 1184, + ZYDIS_MNEMONIC_VLOADUNPACKLPS = 1185, + ZYDIS_MNEMONIC_VLOADUNPACKLQ = 1186, + ZYDIS_MNEMONIC_VLOG2PS = 1187, + ZYDIS_MNEMONIC_VMASKMOVDQU = 1188, + ZYDIS_MNEMONIC_VMASKMOVPD = 1189, + ZYDIS_MNEMONIC_VMASKMOVPS = 1190, + ZYDIS_MNEMONIC_VMAXPD = 1191, + ZYDIS_MNEMONIC_VMAXPH = 1192, + ZYDIS_MNEMONIC_VMAXPS = 1193, + ZYDIS_MNEMONIC_VMAXSD = 1194, + ZYDIS_MNEMONIC_VMAXSH = 1195, + ZYDIS_MNEMONIC_VMAXSS = 1196, + ZYDIS_MNEMONIC_VMCALL = 1197, + ZYDIS_MNEMONIC_VMCLEAR = 1198, + ZYDIS_MNEMONIC_VMFUNC = 1199, + ZYDIS_MNEMONIC_VMINPD = 1200, + ZYDIS_MNEMONIC_VMINPH = 1201, + ZYDIS_MNEMONIC_VMINPS = 1202, + ZYDIS_MNEMONIC_VMINSD = 1203, + ZYDIS_MNEMONIC_VMINSH = 1204, + ZYDIS_MNEMONIC_VMINSS = 1205, + ZYDIS_MNEMONIC_VMLAUNCH = 1206, + ZYDIS_MNEMONIC_VMLOAD = 1207, + ZYDIS_MNEMONIC_VMMCALL = 1208, + ZYDIS_MNEMONIC_VMOVAPD = 1209, + ZYDIS_MNEMONIC_VMOVAPS = 1210, + ZYDIS_MNEMONIC_VMOVD = 1211, + ZYDIS_MNEMONIC_VMOVDDUP = 1212, + ZYDIS_MNEMONIC_VMOVDQA = 1213, + ZYDIS_MNEMONIC_VMOVDQA32 = 1214, + ZYDIS_MNEMONIC_VMOVDQA64 = 1215, + ZYDIS_MNEMONIC_VMOVDQU = 1216, + ZYDIS_MNEMONIC_VMOVDQU16 = 1217, + ZYDIS_MNEMONIC_VMOVDQU32 = 1218, + ZYDIS_MNEMONIC_VMOVDQU64 = 1219, + ZYDIS_MNEMONIC_VMOVDQU8 = 1220, + ZYDIS_MNEMONIC_VMOVHLPS = 1221, + ZYDIS_MNEMONIC_VMOVHPD = 1222, + ZYDIS_MNEMONIC_VMOVHPS = 1223, + ZYDIS_MNEMONIC_VMOVLHPS = 1224, + ZYDIS_MNEMONIC_VMOVLPD = 1225, + ZYDIS_MNEMONIC_VMOVLPS = 1226, + ZYDIS_MNEMONIC_VMOVMSKPD = 1227, + ZYDIS_MNEMONIC_VMOVMSKPS = 1228, + ZYDIS_MNEMONIC_VMOVNRAPD = 1229, + ZYDIS_MNEMONIC_VMOVNRAPS = 1230, + ZYDIS_MNEMONIC_VMOVNRNGOAPD = 1231, + ZYDIS_MNEMONIC_VMOVNRNGOAPS = 1232, + ZYDIS_MNEMONIC_VMOVNTDQ = 1233, + ZYDIS_MNEMONIC_VMOVNTDQA = 1234, + ZYDIS_MNEMONIC_VMOVNTPD = 1235, + ZYDIS_MNEMONIC_VMOVNTPS = 1236, + ZYDIS_MNEMONIC_VMOVQ = 1237, + ZYDIS_MNEMONIC_VMOVSD = 1238, + ZYDIS_MNEMONIC_VMOVSH = 1239, + ZYDIS_MNEMONIC_VMOVSHDUP = 1240, + ZYDIS_MNEMONIC_VMOVSLDUP = 1241, + ZYDIS_MNEMONIC_VMOVSS = 1242, + ZYDIS_MNEMONIC_VMOVUPD = 1243, + ZYDIS_MNEMONIC_VMOVUPS = 1244, + ZYDIS_MNEMONIC_VMOVW = 1245, + ZYDIS_MNEMONIC_VMPSADBW = 1246, + ZYDIS_MNEMONIC_VMPTRLD = 1247, + ZYDIS_MNEMONIC_VMPTRST = 1248, + ZYDIS_MNEMONIC_VMREAD = 1249, + ZYDIS_MNEMONIC_VMRESUME = 1250, + ZYDIS_MNEMONIC_VMRUN = 1251, + ZYDIS_MNEMONIC_VMSAVE = 1252, + ZYDIS_MNEMONIC_VMULPD = 1253, + ZYDIS_MNEMONIC_VMULPH = 1254, + ZYDIS_MNEMONIC_VMULPS = 1255, + ZYDIS_MNEMONIC_VMULSD = 1256, + ZYDIS_MNEMONIC_VMULSH = 1257, + ZYDIS_MNEMONIC_VMULSS = 1258, + ZYDIS_MNEMONIC_VMWRITE = 1259, + ZYDIS_MNEMONIC_VMXOFF = 1260, + ZYDIS_MNEMONIC_VMXON = 1261, + ZYDIS_MNEMONIC_VORPD = 1262, + ZYDIS_MNEMONIC_VORPS = 1263, + ZYDIS_MNEMONIC_VP2INTERSECTD = 1264, + ZYDIS_MNEMONIC_VP2INTERSECTQ = 1265, + ZYDIS_MNEMONIC_VP4DPWSSD = 1266, + ZYDIS_MNEMONIC_VP4DPWSSDS = 1267, + ZYDIS_MNEMONIC_VPABSB = 1268, + ZYDIS_MNEMONIC_VPABSD = 1269, + ZYDIS_MNEMONIC_VPABSQ = 1270, + ZYDIS_MNEMONIC_VPABSW = 1271, + ZYDIS_MNEMONIC_VPACKSSDW = 1272, + ZYDIS_MNEMONIC_VPACKSSWB = 1273, + ZYDIS_MNEMONIC_VPACKSTOREHD = 1274, + ZYDIS_MNEMONIC_VPACKSTOREHPD = 1275, + ZYDIS_MNEMONIC_VPACKSTOREHPS = 1276, + ZYDIS_MNEMONIC_VPACKSTOREHQ = 1277, + ZYDIS_MNEMONIC_VPACKSTORELD = 1278, + ZYDIS_MNEMONIC_VPACKSTORELPD = 1279, + ZYDIS_MNEMONIC_VPACKSTORELPS = 1280, + ZYDIS_MNEMONIC_VPACKSTORELQ = 1281, + ZYDIS_MNEMONIC_VPACKUSDW = 1282, + ZYDIS_MNEMONIC_VPACKUSWB = 1283, + ZYDIS_MNEMONIC_VPADCD = 1284, + ZYDIS_MNEMONIC_VPADDB = 1285, + ZYDIS_MNEMONIC_VPADDD = 1286, + ZYDIS_MNEMONIC_VPADDQ = 1287, + ZYDIS_MNEMONIC_VPADDSB = 1288, + ZYDIS_MNEMONIC_VPADDSETCD = 1289, + ZYDIS_MNEMONIC_VPADDSETSD = 1290, + ZYDIS_MNEMONIC_VPADDSW = 1291, + ZYDIS_MNEMONIC_VPADDUSB = 1292, + ZYDIS_MNEMONIC_VPADDUSW = 1293, + ZYDIS_MNEMONIC_VPADDW = 1294, + ZYDIS_MNEMONIC_VPALIGNR = 1295, + ZYDIS_MNEMONIC_VPAND = 1296, + ZYDIS_MNEMONIC_VPANDD = 1297, + ZYDIS_MNEMONIC_VPANDN = 1298, + ZYDIS_MNEMONIC_VPANDND = 1299, + ZYDIS_MNEMONIC_VPANDNQ = 1300, + ZYDIS_MNEMONIC_VPANDQ = 1301, + ZYDIS_MNEMONIC_VPAVGB = 1302, + ZYDIS_MNEMONIC_VPAVGW = 1303, + ZYDIS_MNEMONIC_VPBLENDD = 1304, + ZYDIS_MNEMONIC_VPBLENDMB = 1305, + ZYDIS_MNEMONIC_VPBLENDMD = 1306, + ZYDIS_MNEMONIC_VPBLENDMQ = 1307, + ZYDIS_MNEMONIC_VPBLENDMW = 1308, + ZYDIS_MNEMONIC_VPBLENDVB = 1309, + ZYDIS_MNEMONIC_VPBLENDW = 1310, + ZYDIS_MNEMONIC_VPBROADCASTB = 1311, + ZYDIS_MNEMONIC_VPBROADCASTD = 1312, + ZYDIS_MNEMONIC_VPBROADCASTMB2Q = 1313, + ZYDIS_MNEMONIC_VPBROADCASTMW2D = 1314, + ZYDIS_MNEMONIC_VPBROADCASTQ = 1315, + ZYDIS_MNEMONIC_VPBROADCASTW = 1316, + ZYDIS_MNEMONIC_VPCLMULQDQ = 1317, + ZYDIS_MNEMONIC_VPCMOV = 1318, + ZYDIS_MNEMONIC_VPCMPB = 1319, + ZYDIS_MNEMONIC_VPCMPD = 1320, + ZYDIS_MNEMONIC_VPCMPEQB = 1321, + ZYDIS_MNEMONIC_VPCMPEQD = 1322, + ZYDIS_MNEMONIC_VPCMPEQQ = 1323, + ZYDIS_MNEMONIC_VPCMPEQW = 1324, + ZYDIS_MNEMONIC_VPCMPESTRI = 1325, + ZYDIS_MNEMONIC_VPCMPESTRM = 1326, + ZYDIS_MNEMONIC_VPCMPGTB = 1327, + ZYDIS_MNEMONIC_VPCMPGTD = 1328, + ZYDIS_MNEMONIC_VPCMPGTQ = 1329, + ZYDIS_MNEMONIC_VPCMPGTW = 1330, + ZYDIS_MNEMONIC_VPCMPISTRI = 1331, + ZYDIS_MNEMONIC_VPCMPISTRM = 1332, + ZYDIS_MNEMONIC_VPCMPLTD = 1333, + ZYDIS_MNEMONIC_VPCMPQ = 1334, + ZYDIS_MNEMONIC_VPCMPUB = 1335, + ZYDIS_MNEMONIC_VPCMPUD = 1336, + ZYDIS_MNEMONIC_VPCMPUQ = 1337, + ZYDIS_MNEMONIC_VPCMPUW = 1338, + ZYDIS_MNEMONIC_VPCMPW = 1339, + ZYDIS_MNEMONIC_VPCOMB = 1340, + ZYDIS_MNEMONIC_VPCOMD = 1341, + ZYDIS_MNEMONIC_VPCOMPRESSB = 1342, + ZYDIS_MNEMONIC_VPCOMPRESSD = 1343, + ZYDIS_MNEMONIC_VPCOMPRESSQ = 1344, + ZYDIS_MNEMONIC_VPCOMPRESSW = 1345, + ZYDIS_MNEMONIC_VPCOMQ = 1346, + ZYDIS_MNEMONIC_VPCOMUB = 1347, + ZYDIS_MNEMONIC_VPCOMUD = 1348, + ZYDIS_MNEMONIC_VPCOMUQ = 1349, + ZYDIS_MNEMONIC_VPCOMUW = 1350, + ZYDIS_MNEMONIC_VPCOMW = 1351, + ZYDIS_MNEMONIC_VPCONFLICTD = 1352, + ZYDIS_MNEMONIC_VPCONFLICTQ = 1353, + ZYDIS_MNEMONIC_VPDPBSSD = 1354, + ZYDIS_MNEMONIC_VPDPBSSDS = 1355, + ZYDIS_MNEMONIC_VPDPBSUD = 1356, + ZYDIS_MNEMONIC_VPDPBSUDS = 1357, + ZYDIS_MNEMONIC_VPDPBUSD = 1358, + ZYDIS_MNEMONIC_VPDPBUSDS = 1359, + ZYDIS_MNEMONIC_VPDPBUUD = 1360, + ZYDIS_MNEMONIC_VPDPBUUDS = 1361, + ZYDIS_MNEMONIC_VPDPWSSD = 1362, + ZYDIS_MNEMONIC_VPDPWSSDS = 1363, + ZYDIS_MNEMONIC_VPDPWSUD = 1364, + ZYDIS_MNEMONIC_VPDPWSUDS = 1365, + ZYDIS_MNEMONIC_VPDPWUSD = 1366, + ZYDIS_MNEMONIC_VPDPWUSDS = 1367, + ZYDIS_MNEMONIC_VPDPWUUD = 1368, + ZYDIS_MNEMONIC_VPDPWUUDS = 1369, + ZYDIS_MNEMONIC_VPERM2F128 = 1370, + ZYDIS_MNEMONIC_VPERM2I128 = 1371, + ZYDIS_MNEMONIC_VPERMB = 1372, + ZYDIS_MNEMONIC_VPERMD = 1373, + ZYDIS_MNEMONIC_VPERMF32X4 = 1374, + ZYDIS_MNEMONIC_VPERMI2B = 1375, + ZYDIS_MNEMONIC_VPERMI2D = 1376, + ZYDIS_MNEMONIC_VPERMI2PD = 1377, + ZYDIS_MNEMONIC_VPERMI2PS = 1378, + ZYDIS_MNEMONIC_VPERMI2Q = 1379, + ZYDIS_MNEMONIC_VPERMI2W = 1380, + ZYDIS_MNEMONIC_VPERMIL2PD = 1381, + ZYDIS_MNEMONIC_VPERMIL2PS = 1382, + ZYDIS_MNEMONIC_VPERMILPD = 1383, + ZYDIS_MNEMONIC_VPERMILPS = 1384, + ZYDIS_MNEMONIC_VPERMPD = 1385, + ZYDIS_MNEMONIC_VPERMPS = 1386, + ZYDIS_MNEMONIC_VPERMQ = 1387, + ZYDIS_MNEMONIC_VPERMT2B = 1388, + ZYDIS_MNEMONIC_VPERMT2D = 1389, + ZYDIS_MNEMONIC_VPERMT2PD = 1390, + ZYDIS_MNEMONIC_VPERMT2PS = 1391, + ZYDIS_MNEMONIC_VPERMT2Q = 1392, + ZYDIS_MNEMONIC_VPERMT2W = 1393, + ZYDIS_MNEMONIC_VPERMW = 1394, + ZYDIS_MNEMONIC_VPEXPANDB = 1395, + ZYDIS_MNEMONIC_VPEXPANDD = 1396, + ZYDIS_MNEMONIC_VPEXPANDQ = 1397, + ZYDIS_MNEMONIC_VPEXPANDW = 1398, + ZYDIS_MNEMONIC_VPEXTRB = 1399, + ZYDIS_MNEMONIC_VPEXTRD = 1400, + ZYDIS_MNEMONIC_VPEXTRQ = 1401, + ZYDIS_MNEMONIC_VPEXTRW = 1402, + ZYDIS_MNEMONIC_VPGATHERDD = 1403, + ZYDIS_MNEMONIC_VPGATHERDQ = 1404, + ZYDIS_MNEMONIC_VPGATHERQD = 1405, + ZYDIS_MNEMONIC_VPGATHERQQ = 1406, + ZYDIS_MNEMONIC_VPHADDBD = 1407, + ZYDIS_MNEMONIC_VPHADDBQ = 1408, + ZYDIS_MNEMONIC_VPHADDBW = 1409, + ZYDIS_MNEMONIC_VPHADDD = 1410, + ZYDIS_MNEMONIC_VPHADDDQ = 1411, + ZYDIS_MNEMONIC_VPHADDSW = 1412, + ZYDIS_MNEMONIC_VPHADDUBD = 1413, + ZYDIS_MNEMONIC_VPHADDUBQ = 1414, + ZYDIS_MNEMONIC_VPHADDUBW = 1415, + ZYDIS_MNEMONIC_VPHADDUDQ = 1416, + ZYDIS_MNEMONIC_VPHADDUWD = 1417, + ZYDIS_MNEMONIC_VPHADDUWQ = 1418, + ZYDIS_MNEMONIC_VPHADDW = 1419, + ZYDIS_MNEMONIC_VPHADDWD = 1420, + ZYDIS_MNEMONIC_VPHADDWQ = 1421, + ZYDIS_MNEMONIC_VPHMINPOSUW = 1422, + ZYDIS_MNEMONIC_VPHSUBBW = 1423, + ZYDIS_MNEMONIC_VPHSUBD = 1424, + ZYDIS_MNEMONIC_VPHSUBDQ = 1425, + ZYDIS_MNEMONIC_VPHSUBSW = 1426, + ZYDIS_MNEMONIC_VPHSUBW = 1427, + ZYDIS_MNEMONIC_VPHSUBWD = 1428, + ZYDIS_MNEMONIC_VPINSRB = 1429, + ZYDIS_MNEMONIC_VPINSRD = 1430, + ZYDIS_MNEMONIC_VPINSRQ = 1431, + ZYDIS_MNEMONIC_VPINSRW = 1432, + ZYDIS_MNEMONIC_VPLZCNTD = 1433, + ZYDIS_MNEMONIC_VPLZCNTQ = 1434, + ZYDIS_MNEMONIC_VPMACSDD = 1435, + ZYDIS_MNEMONIC_VPMACSDQH = 1436, + ZYDIS_MNEMONIC_VPMACSDQL = 1437, + ZYDIS_MNEMONIC_VPMACSSDD = 1438, + ZYDIS_MNEMONIC_VPMACSSDQH = 1439, + ZYDIS_MNEMONIC_VPMACSSDQL = 1440, + ZYDIS_MNEMONIC_VPMACSSWD = 1441, + ZYDIS_MNEMONIC_VPMACSSWW = 1442, + ZYDIS_MNEMONIC_VPMACSWD = 1443, + ZYDIS_MNEMONIC_VPMACSWW = 1444, + ZYDIS_MNEMONIC_VPMADCSSWD = 1445, + ZYDIS_MNEMONIC_VPMADCSWD = 1446, + ZYDIS_MNEMONIC_VPMADD231D = 1447, + ZYDIS_MNEMONIC_VPMADD233D = 1448, + ZYDIS_MNEMONIC_VPMADD52HUQ = 1449, + ZYDIS_MNEMONIC_VPMADD52LUQ = 1450, + ZYDIS_MNEMONIC_VPMADDUBSW = 1451, + ZYDIS_MNEMONIC_VPMADDWD = 1452, + ZYDIS_MNEMONIC_VPMASKMOVD = 1453, + ZYDIS_MNEMONIC_VPMASKMOVQ = 1454, + ZYDIS_MNEMONIC_VPMAXSB = 1455, + ZYDIS_MNEMONIC_VPMAXSD = 1456, + ZYDIS_MNEMONIC_VPMAXSQ = 1457, + ZYDIS_MNEMONIC_VPMAXSW = 1458, + ZYDIS_MNEMONIC_VPMAXUB = 1459, + ZYDIS_MNEMONIC_VPMAXUD = 1460, + ZYDIS_MNEMONIC_VPMAXUQ = 1461, + ZYDIS_MNEMONIC_VPMAXUW = 1462, + ZYDIS_MNEMONIC_VPMINSB = 1463, + ZYDIS_MNEMONIC_VPMINSD = 1464, + ZYDIS_MNEMONIC_VPMINSQ = 1465, + ZYDIS_MNEMONIC_VPMINSW = 1466, + ZYDIS_MNEMONIC_VPMINUB = 1467, + ZYDIS_MNEMONIC_VPMINUD = 1468, + ZYDIS_MNEMONIC_VPMINUQ = 1469, + ZYDIS_MNEMONIC_VPMINUW = 1470, + ZYDIS_MNEMONIC_VPMOVB2M = 1471, + ZYDIS_MNEMONIC_VPMOVD2M = 1472, + ZYDIS_MNEMONIC_VPMOVDB = 1473, + ZYDIS_MNEMONIC_VPMOVDW = 1474, + ZYDIS_MNEMONIC_VPMOVM2B = 1475, + ZYDIS_MNEMONIC_VPMOVM2D = 1476, + ZYDIS_MNEMONIC_VPMOVM2Q = 1477, + ZYDIS_MNEMONIC_VPMOVM2W = 1478, + ZYDIS_MNEMONIC_VPMOVMSKB = 1479, + ZYDIS_MNEMONIC_VPMOVQ2M = 1480, + ZYDIS_MNEMONIC_VPMOVQB = 1481, + ZYDIS_MNEMONIC_VPMOVQD = 1482, + ZYDIS_MNEMONIC_VPMOVQW = 1483, + ZYDIS_MNEMONIC_VPMOVSDB = 1484, + ZYDIS_MNEMONIC_VPMOVSDW = 1485, + ZYDIS_MNEMONIC_VPMOVSQB = 1486, + ZYDIS_MNEMONIC_VPMOVSQD = 1487, + ZYDIS_MNEMONIC_VPMOVSQW = 1488, + ZYDIS_MNEMONIC_VPMOVSWB = 1489, + ZYDIS_MNEMONIC_VPMOVSXBD = 1490, + ZYDIS_MNEMONIC_VPMOVSXBQ = 1491, + ZYDIS_MNEMONIC_VPMOVSXBW = 1492, + ZYDIS_MNEMONIC_VPMOVSXDQ = 1493, + ZYDIS_MNEMONIC_VPMOVSXWD = 1494, + ZYDIS_MNEMONIC_VPMOVSXWQ = 1495, + ZYDIS_MNEMONIC_VPMOVUSDB = 1496, + ZYDIS_MNEMONIC_VPMOVUSDW = 1497, + ZYDIS_MNEMONIC_VPMOVUSQB = 1498, + ZYDIS_MNEMONIC_VPMOVUSQD = 1499, + ZYDIS_MNEMONIC_VPMOVUSQW = 1500, + ZYDIS_MNEMONIC_VPMOVUSWB = 1501, + ZYDIS_MNEMONIC_VPMOVW2M = 1502, + ZYDIS_MNEMONIC_VPMOVWB = 1503, + ZYDIS_MNEMONIC_VPMOVZXBD = 1504, + ZYDIS_MNEMONIC_VPMOVZXBQ = 1505, + ZYDIS_MNEMONIC_VPMOVZXBW = 1506, + ZYDIS_MNEMONIC_VPMOVZXDQ = 1507, + ZYDIS_MNEMONIC_VPMOVZXWD = 1508, + ZYDIS_MNEMONIC_VPMOVZXWQ = 1509, + ZYDIS_MNEMONIC_VPMULDQ = 1510, + ZYDIS_MNEMONIC_VPMULHD = 1511, + ZYDIS_MNEMONIC_VPMULHRSW = 1512, + ZYDIS_MNEMONIC_VPMULHUD = 1513, + ZYDIS_MNEMONIC_VPMULHUW = 1514, + ZYDIS_MNEMONIC_VPMULHW = 1515, + ZYDIS_MNEMONIC_VPMULLD = 1516, + ZYDIS_MNEMONIC_VPMULLQ = 1517, + ZYDIS_MNEMONIC_VPMULLW = 1518, + ZYDIS_MNEMONIC_VPMULTISHIFTQB = 1519, + ZYDIS_MNEMONIC_VPMULUDQ = 1520, + ZYDIS_MNEMONIC_VPOPCNTB = 1521, + ZYDIS_MNEMONIC_VPOPCNTD = 1522, + ZYDIS_MNEMONIC_VPOPCNTQ = 1523, + ZYDIS_MNEMONIC_VPOPCNTW = 1524, + ZYDIS_MNEMONIC_VPOR = 1525, + ZYDIS_MNEMONIC_VPORD = 1526, + ZYDIS_MNEMONIC_VPORQ = 1527, + ZYDIS_MNEMONIC_VPPERM = 1528, + ZYDIS_MNEMONIC_VPREFETCH0 = 1529, + ZYDIS_MNEMONIC_VPREFETCH1 = 1530, + ZYDIS_MNEMONIC_VPREFETCH2 = 1531, + ZYDIS_MNEMONIC_VPREFETCHE0 = 1532, + ZYDIS_MNEMONIC_VPREFETCHE1 = 1533, + ZYDIS_MNEMONIC_VPREFETCHE2 = 1534, + ZYDIS_MNEMONIC_VPREFETCHENTA = 1535, + ZYDIS_MNEMONIC_VPREFETCHNTA = 1536, + ZYDIS_MNEMONIC_VPROLD = 1537, + ZYDIS_MNEMONIC_VPROLQ = 1538, + ZYDIS_MNEMONIC_VPROLVD = 1539, + ZYDIS_MNEMONIC_VPROLVQ = 1540, + ZYDIS_MNEMONIC_VPRORD = 1541, + ZYDIS_MNEMONIC_VPRORQ = 1542, + ZYDIS_MNEMONIC_VPRORVD = 1543, + ZYDIS_MNEMONIC_VPRORVQ = 1544, + ZYDIS_MNEMONIC_VPROTB = 1545, + ZYDIS_MNEMONIC_VPROTD = 1546, + ZYDIS_MNEMONIC_VPROTQ = 1547, + ZYDIS_MNEMONIC_VPROTW = 1548, + ZYDIS_MNEMONIC_VPSADBW = 1549, + ZYDIS_MNEMONIC_VPSBBD = 1550, + ZYDIS_MNEMONIC_VPSBBRD = 1551, + ZYDIS_MNEMONIC_VPSCATTERDD = 1552, + ZYDIS_MNEMONIC_VPSCATTERDQ = 1553, + ZYDIS_MNEMONIC_VPSCATTERQD = 1554, + ZYDIS_MNEMONIC_VPSCATTERQQ = 1555, + ZYDIS_MNEMONIC_VPSHAB = 1556, + ZYDIS_MNEMONIC_VPSHAD = 1557, + ZYDIS_MNEMONIC_VPSHAQ = 1558, + ZYDIS_MNEMONIC_VPSHAW = 1559, + ZYDIS_MNEMONIC_VPSHLB = 1560, + ZYDIS_MNEMONIC_VPSHLD = 1561, + ZYDIS_MNEMONIC_VPSHLDD = 1562, + ZYDIS_MNEMONIC_VPSHLDQ = 1563, + ZYDIS_MNEMONIC_VPSHLDVD = 1564, + ZYDIS_MNEMONIC_VPSHLDVQ = 1565, + ZYDIS_MNEMONIC_VPSHLDVW = 1566, + ZYDIS_MNEMONIC_VPSHLDW = 1567, + ZYDIS_MNEMONIC_VPSHLQ = 1568, + ZYDIS_MNEMONIC_VPSHLW = 1569, + ZYDIS_MNEMONIC_VPSHRDD = 1570, + ZYDIS_MNEMONIC_VPSHRDQ = 1571, + ZYDIS_MNEMONIC_VPSHRDVD = 1572, + ZYDIS_MNEMONIC_VPSHRDVQ = 1573, + ZYDIS_MNEMONIC_VPSHRDVW = 1574, + ZYDIS_MNEMONIC_VPSHRDW = 1575, + ZYDIS_MNEMONIC_VPSHUFB = 1576, + ZYDIS_MNEMONIC_VPSHUFBITQMB = 1577, + ZYDIS_MNEMONIC_VPSHUFD = 1578, + ZYDIS_MNEMONIC_VPSHUFHW = 1579, + ZYDIS_MNEMONIC_VPSHUFLW = 1580, + ZYDIS_MNEMONIC_VPSIGNB = 1581, + ZYDIS_MNEMONIC_VPSIGND = 1582, + ZYDIS_MNEMONIC_VPSIGNW = 1583, + ZYDIS_MNEMONIC_VPSLLD = 1584, + ZYDIS_MNEMONIC_VPSLLDQ = 1585, + ZYDIS_MNEMONIC_VPSLLQ = 1586, + ZYDIS_MNEMONIC_VPSLLVD = 1587, + ZYDIS_MNEMONIC_VPSLLVQ = 1588, + ZYDIS_MNEMONIC_VPSLLVW = 1589, + ZYDIS_MNEMONIC_VPSLLW = 1590, + ZYDIS_MNEMONIC_VPSRAD = 1591, + ZYDIS_MNEMONIC_VPSRAQ = 1592, + ZYDIS_MNEMONIC_VPSRAVD = 1593, + ZYDIS_MNEMONIC_VPSRAVQ = 1594, + ZYDIS_MNEMONIC_VPSRAVW = 1595, + ZYDIS_MNEMONIC_VPSRAW = 1596, + ZYDIS_MNEMONIC_VPSRLD = 1597, + ZYDIS_MNEMONIC_VPSRLDQ = 1598, + ZYDIS_MNEMONIC_VPSRLQ = 1599, + ZYDIS_MNEMONIC_VPSRLVD = 1600, + ZYDIS_MNEMONIC_VPSRLVQ = 1601, + ZYDIS_MNEMONIC_VPSRLVW = 1602, + ZYDIS_MNEMONIC_VPSRLW = 1603, + ZYDIS_MNEMONIC_VPSUBB = 1604, + ZYDIS_MNEMONIC_VPSUBD = 1605, + ZYDIS_MNEMONIC_VPSUBQ = 1606, + ZYDIS_MNEMONIC_VPSUBRD = 1607, + ZYDIS_MNEMONIC_VPSUBRSETBD = 1608, + ZYDIS_MNEMONIC_VPSUBSB = 1609, + ZYDIS_MNEMONIC_VPSUBSETBD = 1610, + ZYDIS_MNEMONIC_VPSUBSW = 1611, + ZYDIS_MNEMONIC_VPSUBUSB = 1612, + ZYDIS_MNEMONIC_VPSUBUSW = 1613, + ZYDIS_MNEMONIC_VPSUBW = 1614, + ZYDIS_MNEMONIC_VPTERNLOGD = 1615, + ZYDIS_MNEMONIC_VPTERNLOGQ = 1616, + ZYDIS_MNEMONIC_VPTEST = 1617, + ZYDIS_MNEMONIC_VPTESTMB = 1618, + ZYDIS_MNEMONIC_VPTESTMD = 1619, + ZYDIS_MNEMONIC_VPTESTMQ = 1620, + ZYDIS_MNEMONIC_VPTESTMW = 1621, + ZYDIS_MNEMONIC_VPTESTNMB = 1622, + ZYDIS_MNEMONIC_VPTESTNMD = 1623, + ZYDIS_MNEMONIC_VPTESTNMQ = 1624, + ZYDIS_MNEMONIC_VPTESTNMW = 1625, + ZYDIS_MNEMONIC_VPUNPCKHBW = 1626, + ZYDIS_MNEMONIC_VPUNPCKHDQ = 1627, + ZYDIS_MNEMONIC_VPUNPCKHQDQ = 1628, + ZYDIS_MNEMONIC_VPUNPCKHWD = 1629, + ZYDIS_MNEMONIC_VPUNPCKLBW = 1630, + ZYDIS_MNEMONIC_VPUNPCKLDQ = 1631, + ZYDIS_MNEMONIC_VPUNPCKLQDQ = 1632, + ZYDIS_MNEMONIC_VPUNPCKLWD = 1633, + ZYDIS_MNEMONIC_VPXOR = 1634, + ZYDIS_MNEMONIC_VPXORD = 1635, + ZYDIS_MNEMONIC_VPXORQ = 1636, + ZYDIS_MNEMONIC_VRANGEPD = 1637, + ZYDIS_MNEMONIC_VRANGEPS = 1638, + ZYDIS_MNEMONIC_VRANGESD = 1639, + ZYDIS_MNEMONIC_VRANGESS = 1640, + ZYDIS_MNEMONIC_VRCP14PD = 1641, + ZYDIS_MNEMONIC_VRCP14PS = 1642, + ZYDIS_MNEMONIC_VRCP14SD = 1643, + ZYDIS_MNEMONIC_VRCP14SS = 1644, + ZYDIS_MNEMONIC_VRCP23PS = 1645, + ZYDIS_MNEMONIC_VRCP28PD = 1646, + ZYDIS_MNEMONIC_VRCP28PS = 1647, + ZYDIS_MNEMONIC_VRCP28SD = 1648, + ZYDIS_MNEMONIC_VRCP28SS = 1649, + ZYDIS_MNEMONIC_VRCPPH = 1650, + ZYDIS_MNEMONIC_VRCPPS = 1651, + ZYDIS_MNEMONIC_VRCPSH = 1652, + ZYDIS_MNEMONIC_VRCPSS = 1653, + ZYDIS_MNEMONIC_VREDUCEPD = 1654, + ZYDIS_MNEMONIC_VREDUCEPH = 1655, + ZYDIS_MNEMONIC_VREDUCEPS = 1656, + ZYDIS_MNEMONIC_VREDUCESD = 1657, + ZYDIS_MNEMONIC_VREDUCESH = 1658, + ZYDIS_MNEMONIC_VREDUCESS = 1659, + ZYDIS_MNEMONIC_VRNDFXPNTPD = 1660, + ZYDIS_MNEMONIC_VRNDFXPNTPS = 1661, + ZYDIS_MNEMONIC_VRNDSCALEPD = 1662, + ZYDIS_MNEMONIC_VRNDSCALEPH = 1663, + ZYDIS_MNEMONIC_VRNDSCALEPS = 1664, + ZYDIS_MNEMONIC_VRNDSCALESD = 1665, + ZYDIS_MNEMONIC_VRNDSCALESH = 1666, + ZYDIS_MNEMONIC_VRNDSCALESS = 1667, + ZYDIS_MNEMONIC_VROUNDPD = 1668, + ZYDIS_MNEMONIC_VROUNDPS = 1669, + ZYDIS_MNEMONIC_VROUNDSD = 1670, + ZYDIS_MNEMONIC_VROUNDSS = 1671, + ZYDIS_MNEMONIC_VRSQRT14PD = 1672, + ZYDIS_MNEMONIC_VRSQRT14PS = 1673, + ZYDIS_MNEMONIC_VRSQRT14SD = 1674, + ZYDIS_MNEMONIC_VRSQRT14SS = 1675, + ZYDIS_MNEMONIC_VRSQRT23PS = 1676, + ZYDIS_MNEMONIC_VRSQRT28PD = 1677, + ZYDIS_MNEMONIC_VRSQRT28PS = 1678, + ZYDIS_MNEMONIC_VRSQRT28SD = 1679, + ZYDIS_MNEMONIC_VRSQRT28SS = 1680, + ZYDIS_MNEMONIC_VRSQRTPH = 1681, + ZYDIS_MNEMONIC_VRSQRTPS = 1682, + ZYDIS_MNEMONIC_VRSQRTSH = 1683, + ZYDIS_MNEMONIC_VRSQRTSS = 1684, + ZYDIS_MNEMONIC_VSCALEFPD = 1685, + ZYDIS_MNEMONIC_VSCALEFPH = 1686, + ZYDIS_MNEMONIC_VSCALEFPS = 1687, + ZYDIS_MNEMONIC_VSCALEFSD = 1688, + ZYDIS_MNEMONIC_VSCALEFSH = 1689, + ZYDIS_MNEMONIC_VSCALEFSS = 1690, + ZYDIS_MNEMONIC_VSCALEPS = 1691, + ZYDIS_MNEMONIC_VSCATTERDPD = 1692, + ZYDIS_MNEMONIC_VSCATTERDPS = 1693, + ZYDIS_MNEMONIC_VSCATTERPF0DPD = 1694, + ZYDIS_MNEMONIC_VSCATTERPF0DPS = 1695, + ZYDIS_MNEMONIC_VSCATTERPF0HINTDPD = 1696, + ZYDIS_MNEMONIC_VSCATTERPF0HINTDPS = 1697, + ZYDIS_MNEMONIC_VSCATTERPF0QPD = 1698, + ZYDIS_MNEMONIC_VSCATTERPF0QPS = 1699, + ZYDIS_MNEMONIC_VSCATTERPF1DPD = 1700, + ZYDIS_MNEMONIC_VSCATTERPF1DPS = 1701, + ZYDIS_MNEMONIC_VSCATTERPF1QPD = 1702, + ZYDIS_MNEMONIC_VSCATTERPF1QPS = 1703, + ZYDIS_MNEMONIC_VSCATTERQPD = 1704, + ZYDIS_MNEMONIC_VSCATTERQPS = 1705, + ZYDIS_MNEMONIC_VSHA512MSG1 = 1706, + ZYDIS_MNEMONIC_VSHA512MSG2 = 1707, + ZYDIS_MNEMONIC_VSHA512RNDS2 = 1708, + ZYDIS_MNEMONIC_VSHUFF32X4 = 1709, + ZYDIS_MNEMONIC_VSHUFF64X2 = 1710, + ZYDIS_MNEMONIC_VSHUFI32X4 = 1711, + ZYDIS_MNEMONIC_VSHUFI64X2 = 1712, + ZYDIS_MNEMONIC_VSHUFPD = 1713, + ZYDIS_MNEMONIC_VSHUFPS = 1714, + ZYDIS_MNEMONIC_VSM3MSG1 = 1715, + ZYDIS_MNEMONIC_VSM3MSG2 = 1716, + ZYDIS_MNEMONIC_VSM3RNDS2 = 1717, + ZYDIS_MNEMONIC_VSM4KEY4 = 1718, + ZYDIS_MNEMONIC_VSM4RNDS4 = 1719, + ZYDIS_MNEMONIC_VSQRTPD = 1720, + ZYDIS_MNEMONIC_VSQRTPH = 1721, + ZYDIS_MNEMONIC_VSQRTPS = 1722, + ZYDIS_MNEMONIC_VSQRTSD = 1723, + ZYDIS_MNEMONIC_VSQRTSH = 1724, + ZYDIS_MNEMONIC_VSQRTSS = 1725, + ZYDIS_MNEMONIC_VSTMXCSR = 1726, + ZYDIS_MNEMONIC_VSUBPD = 1727, + ZYDIS_MNEMONIC_VSUBPH = 1728, + ZYDIS_MNEMONIC_VSUBPS = 1729, + ZYDIS_MNEMONIC_VSUBRPD = 1730, + ZYDIS_MNEMONIC_VSUBRPS = 1731, + ZYDIS_MNEMONIC_VSUBSD = 1732, + ZYDIS_MNEMONIC_VSUBSH = 1733, + ZYDIS_MNEMONIC_VSUBSS = 1734, + ZYDIS_MNEMONIC_VTESTPD = 1735, + ZYDIS_MNEMONIC_VTESTPS = 1736, + ZYDIS_MNEMONIC_VUCOMISD = 1737, + ZYDIS_MNEMONIC_VUCOMISH = 1738, + ZYDIS_MNEMONIC_VUCOMISS = 1739, + ZYDIS_MNEMONIC_VUNPCKHPD = 1740, + ZYDIS_MNEMONIC_VUNPCKHPS = 1741, + ZYDIS_MNEMONIC_VUNPCKLPD = 1742, + ZYDIS_MNEMONIC_VUNPCKLPS = 1743, + ZYDIS_MNEMONIC_VXORPD = 1744, + ZYDIS_MNEMONIC_VXORPS = 1745, + ZYDIS_MNEMONIC_VZEROALL = 1746, + ZYDIS_MNEMONIC_VZEROUPPER = 1747, + ZYDIS_MNEMONIC_WBINVD = 1748, + ZYDIS_MNEMONIC_WRFSBASE = 1749, + ZYDIS_MNEMONIC_WRGSBASE = 1750, + ZYDIS_MNEMONIC_WRMSR = 1751, + ZYDIS_MNEMONIC_WRMSRLIST = 1752, + ZYDIS_MNEMONIC_WRMSRNS = 1753, + ZYDIS_MNEMONIC_WRPKRU = 1754, + ZYDIS_MNEMONIC_WRSSD = 1755, + ZYDIS_MNEMONIC_WRSSQ = 1756, + ZYDIS_MNEMONIC_WRUSSD = 1757, + ZYDIS_MNEMONIC_WRUSSQ = 1758, + ZYDIS_MNEMONIC_XABORT = 1759, + ZYDIS_MNEMONIC_XADD = 1760, + ZYDIS_MNEMONIC_XBEGIN = 1761, + ZYDIS_MNEMONIC_XCHG = 1762, + ZYDIS_MNEMONIC_XCRYPT_CBC = 1763, + ZYDIS_MNEMONIC_XCRYPT_CFB = 1764, + ZYDIS_MNEMONIC_XCRYPT_CTR = 1765, + ZYDIS_MNEMONIC_XCRYPT_ECB = 1766, + ZYDIS_MNEMONIC_XCRYPT_OFB = 1767, + ZYDIS_MNEMONIC_XEND = 1768, + ZYDIS_MNEMONIC_XGETBV = 1769, + ZYDIS_MNEMONIC_XLAT = 1770, + ZYDIS_MNEMONIC_XOR = 1771, + ZYDIS_MNEMONIC_XORPD = 1772, + ZYDIS_MNEMONIC_XORPS = 1773, + ZYDIS_MNEMONIC_XRESLDTRK = 1774, + ZYDIS_MNEMONIC_XRSTOR = 1775, + ZYDIS_MNEMONIC_XRSTOR64 = 1776, + ZYDIS_MNEMONIC_XRSTORS = 1777, + ZYDIS_MNEMONIC_XRSTORS64 = 1778, + ZYDIS_MNEMONIC_XSAVE = 1779, + ZYDIS_MNEMONIC_XSAVE64 = 1780, + ZYDIS_MNEMONIC_XSAVEC = 1781, + ZYDIS_MNEMONIC_XSAVEC64 = 1782, + ZYDIS_MNEMONIC_XSAVEOPT = 1783, + ZYDIS_MNEMONIC_XSAVEOPT64 = 1784, + ZYDIS_MNEMONIC_XSAVES = 1785, + ZYDIS_MNEMONIC_XSAVES64 = 1786, + ZYDIS_MNEMONIC_XSETBV = 1787, + ZYDIS_MNEMONIC_XSHA1 = 1788, + ZYDIS_MNEMONIC_XSHA256 = 1789, + ZYDIS_MNEMONIC_XSTORE = 1790, + ZYDIS_MNEMONIC_XSUSLDTRK = 1791, + ZYDIS_MNEMONIC_XTEST = 1792, + // Maximum value of this enum. + ZYDIS_MNEMONIC_MAX_VALUE = 1792, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_MNEMONIC_REQUIRED_BITS = 11 +); + +// Defines the `ZydisMachineMode` enum. +TZydisMachineMode = ( + // 64 bit mode. + ZYDIS_MACHINE_MODE_LONG_64 = 0, + // 32 bit protected mode. + ZYDIS_MACHINE_MODE_LONG_COMPAT_32 = 1, + // 16 bit protected mode. + ZYDIS_MACHINE_MODE_LONG_COMPAT_16 = 2, + // 32 bit protected mode. + ZYDIS_MACHINE_MODE_LEGACY_32 = 3, + // 16 bit protected mode. + ZYDIS_MACHINE_MODE_LEGACY_16 = 4, + // 16 bit real mode. + ZYDIS_MACHINE_MODE_REAL_16 = 5, + // Maximum value of this enum. + ZYDIS_MACHINE_MODE_MAX_VALUE = 5, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_MACHINE_MODE_REQUIRED_BITS = 3 +); + +// Defines the `ZydisStackWidth` enum. +TZydisStackWidth = ( + ZYDIS_STACK_WIDTH_16 = 0, + ZYDIS_STACK_WIDTH_32 = 1, + ZYDIS_STACK_WIDTH_64 = 2, + // Maximum value of this enum. + ZYDIS_STACK_WIDTH_MAX_VALUE = 2, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_STACK_WIDTH_REQUIRED_BITS = 2 +); + +// Defines the `ZydisElementType` enum. +TZydisElementType = ( + ZYDIS_ELEMENT_TYPE_INVALID = 0, + // A struct type. + ZYDIS_ELEMENT_TYPE_STRUCT = 1, + // Unsigned integer value. + ZYDIS_ELEMENT_TYPE_UINT = 2, + // Signed integer value. + ZYDIS_ELEMENT_TYPE_INT = 3, + // 16-bit floating point value (`half`). + ZYDIS_ELEMENT_TYPE_FLOAT16 = 4, + // 32-bit floating point value (`single`). + ZYDIS_ELEMENT_TYPE_FLOAT32 = 5, + // 64-bit floating point value (`double`). + ZYDIS_ELEMENT_TYPE_FLOAT64 = 6, + // 80-bit floating point value (`extended`). + ZYDIS_ELEMENT_TYPE_FLOAT80 = 7, + // 16-bit brain floating point value. + ZYDIS_ELEMENT_TYPE_BFLOAT16 = 8, + // Binary coded decimal value. + ZYDIS_ELEMENT_TYPE_LONGBCD = 9, + // A condition code (e.g. used by `CMPPD`, `VCMPPD`, ...). + ZYDIS_ELEMENT_TYPE_CC = 10, + // Maximum value of this enum. + ZYDIS_ELEMENT_TYPE_MAX_VALUE = 10, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_ELEMENT_TYPE_REQUIRED_BITS = 4 +); + +// Defines the `ZydisOperandType` enum. +TZydisOperandType = ( + // The operand is not used. + ZYDIS_OPERAND_TYPE_UNUSED = 0, + // The operand is a register operand. + ZYDIS_OPERAND_TYPE_REGISTER = 1, + // The operand is a memory operand. + ZYDIS_OPERAND_TYPE_MEMORY = 2, + // The operand is a pointer operand with a segment:offset lvalue. + ZYDIS_OPERAND_TYPE_POINTER = 3, + // The operand is an immediate operand. + ZYDIS_OPERAND_TYPE_IMMEDIATE = 4, + // Maximum value of this enum. + ZYDIS_OPERAND_TYPE_MAX_VALUE = 4, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_OPERAND_TYPE_REQUIRED_BITS = 3 +); + +// Defines the `ZydisOperandEncoding` enum. +TZydisOperandEncoding = ( + ZYDIS_OPERAND_ENCODING_NONE = 0, + ZYDIS_OPERAND_ENCODING_MODRM_REG = 1, + ZYDIS_OPERAND_ENCODING_MODRM_RM = 2, + ZYDIS_OPERAND_ENCODING_OPCODE = 3, + ZYDIS_OPERAND_ENCODING_NDSNDD = 4, + ZYDIS_OPERAND_ENCODING_IS4 = 5, + ZYDIS_OPERAND_ENCODING_MASK = 6, + ZYDIS_OPERAND_ENCODING_DISP8 = 7, + ZYDIS_OPERAND_ENCODING_DISP16 = 8, + ZYDIS_OPERAND_ENCODING_DISP32 = 9, + ZYDIS_OPERAND_ENCODING_DISP64 = 10, + ZYDIS_OPERAND_ENCODING_DISP16_32_64 = 11, + ZYDIS_OPERAND_ENCODING_DISP32_32_64 = 12, + ZYDIS_OPERAND_ENCODING_DISP16_32_32 = 13, + ZYDIS_OPERAND_ENCODING_UIMM8 = 14, + ZYDIS_OPERAND_ENCODING_UIMM16 = 15, + ZYDIS_OPERAND_ENCODING_UIMM32 = 16, + ZYDIS_OPERAND_ENCODING_UIMM64 = 17, + ZYDIS_OPERAND_ENCODING_UIMM16_32_64 = 18, + ZYDIS_OPERAND_ENCODING_UIMM32_32_64 = 19, + ZYDIS_OPERAND_ENCODING_UIMM16_32_32 = 20, + ZYDIS_OPERAND_ENCODING_SIMM8 = 21, + ZYDIS_OPERAND_ENCODING_SIMM16 = 22, + ZYDIS_OPERAND_ENCODING_SIMM32 = 23, + ZYDIS_OPERAND_ENCODING_SIMM64 = 24, + ZYDIS_OPERAND_ENCODING_SIMM16_32_64 = 25, + ZYDIS_OPERAND_ENCODING_SIMM32_32_64 = 26, + ZYDIS_OPERAND_ENCODING_SIMM16_32_32 = 27, + ZYDIS_OPERAND_ENCODING_JIMM8 = 28, + ZYDIS_OPERAND_ENCODING_JIMM16 = 29, + ZYDIS_OPERAND_ENCODING_JIMM32 = 30, + ZYDIS_OPERAND_ENCODING_JIMM64 = 31, + ZYDIS_OPERAND_ENCODING_JIMM16_32_64 = 32, + ZYDIS_OPERAND_ENCODING_JIMM32_32_64 = 33, + ZYDIS_OPERAND_ENCODING_JIMM16_32_32 = 34, + // Maximum value of this enum. + ZYDIS_OPERAND_ENCODING_MAX_VALUE = 34, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_OPERAND_ENCODING_REQUIRED_BITS = 6 +); + +// Defines the `ZydisOperandVisibility` enum. +TZydisOperandVisibility = ( + ZYDIS_OPERAND_VISIBILITY_INVALID = 0, + // The operand is explicitly encoded in the instruction. + ZYDIS_OPERAND_VISIBILITY_EXPLICIT = 1, + // The operand is part of the opcode, but listed as an operand. + ZYDIS_OPERAND_VISIBILITY_IMPLICIT = 2, + // The operand is part of the opcode, and not typically listed as an operand. + ZYDIS_OPERAND_VISIBILITY_HIDDEN = 3, + // Maximum value of this enum. + ZYDIS_OPERAND_VISIBILITY_MAX_VALUE = 3, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_OPERAND_VISIBILITY_REQUIRED_BITS = 2 +); + +// Defines the `ZydisOperandAction` enum. +TZydisOperandAction = ( + // The operand is read by the instruction. + ZYDIS_OPERAND_ACTION_READ = 1, + // The operand is written by the instruction (must write). + ZYDIS_OPERAND_ACTION_WRITE = 2, + // The operand is conditionally read by the instruction. + ZYDIS_OPERAND_ACTION_CONDREAD = 4, + // The operand is conditionally written by the instruction (may write). + ZYDIS_OPERAND_ACTION_CONDWRITE = 8, + // The operand is read (must read) and written by the instruction (must write). + ZYDIS_OPERAND_ACTION_READWRITE = 3, + // The operand is conditionally read (may read) and conditionally written by the instruction (may write). + ZYDIS_OPERAND_ACTION_CONDREAD_CONDWRITE = 12, + // The operand is read (must read) and conditionally written by the instruction (may write). + ZYDIS_OPERAND_ACTION_READ_CONDWRITE = 9, + // The operand is written (must write) and conditionally read by the instruction (may read). + ZYDIS_OPERAND_ACTION_CONDREAD_WRITE = 6, + // Mask combining all reading access flags. + ZYDIS_OPERAND_ACTION_MASK_READ = 5, + // Mask combining all writing access flags. + ZYDIS_OPERAND_ACTION_MASK_WRITE = 10, + // The minimum number of bits required to represent all values of this bitset. + ZYDIS_OPERAND_ACTION_REQUIRED_BITS = 4 +); + +// Defines the `ZydisInstructionEncoding` enum. +TZydisInstructionEncoding = ( + // The instruction uses the legacy encoding. + ZYDIS_INSTRUCTION_ENCODING_LEGACY = 0, + // The instruction uses the AMD 3DNow-encoding. + ZYDIS_INSTRUCTION_ENCODING_3DNOW = 1, + // The instruction uses the AMD XOP-encoding. + ZYDIS_INSTRUCTION_ENCODING_XOP = 2, + // The instruction uses the VEX-encoding. + ZYDIS_INSTRUCTION_ENCODING_VEX = 3, + // The instruction uses the EVEX-encoding. + ZYDIS_INSTRUCTION_ENCODING_EVEX = 4, + // The instruction uses the MVEX-encoding. + ZYDIS_INSTRUCTION_ENCODING_MVEX = 5, + // Maximum value of this enum. + ZYDIS_INSTRUCTION_ENCODING_MAX_VALUE = 5, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_INSTRUCTION_ENCODING_REQUIRED_BITS = 3 +); + +// Defines the `ZydisOpcodeMap` enum. +TZydisOpcodeMap = ( + ZYDIS_OPCODE_MAP_DEFAULT = 0, + ZYDIS_OPCODE_MAP_0F = 1, + ZYDIS_OPCODE_MAP_0F38 = 2, + ZYDIS_OPCODE_MAP_0F3A = 3, + ZYDIS_OPCODE_MAP_MAP4 = 4, + ZYDIS_OPCODE_MAP_MAP5 = 5, + ZYDIS_OPCODE_MAP_MAP6 = 6, + ZYDIS_OPCODE_MAP_MAP7 = 7, + ZYDIS_OPCODE_MAP_0F0F = 8, + ZYDIS_OPCODE_MAP_XOP8 = 9, + ZYDIS_OPCODE_MAP_XOP9 = 10, + ZYDIS_OPCODE_MAP_XOPA = 11, + // Maximum value of this enum. + ZYDIS_OPCODE_MAP_MAX_VALUE = 11, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_OPCODE_MAP_REQUIRED_BITS = 4 +); + +// Defines the `ZydisRegister` enum. +TZydisRegister = ( + ZYDIS_REGISTER_NONE = 0, + ZYDIS_REGISTER_AL = 1, + ZYDIS_REGISTER_CL = 2, + ZYDIS_REGISTER_DL = 3, + ZYDIS_REGISTER_BL = 4, + ZYDIS_REGISTER_AH = 5, + ZYDIS_REGISTER_CH = 6, + ZYDIS_REGISTER_DH = 7, + ZYDIS_REGISTER_BH = 8, + ZYDIS_REGISTER_SPL = 9, + ZYDIS_REGISTER_BPL = 10, + ZYDIS_REGISTER_SIL = 11, + ZYDIS_REGISTER_DIL = 12, + ZYDIS_REGISTER_R8B = 13, + ZYDIS_REGISTER_R9B = 14, + ZYDIS_REGISTER_R10B = 15, + ZYDIS_REGISTER_R11B = 16, + ZYDIS_REGISTER_R12B = 17, + ZYDIS_REGISTER_R13B = 18, + ZYDIS_REGISTER_R14B = 19, + ZYDIS_REGISTER_R15B = 20, + ZYDIS_REGISTER_AX = 21, + ZYDIS_REGISTER_CX = 22, + ZYDIS_REGISTER_DX = 23, + ZYDIS_REGISTER_BX = 24, + ZYDIS_REGISTER_SP = 25, + ZYDIS_REGISTER_BP = 26, + ZYDIS_REGISTER_SI = 27, + ZYDIS_REGISTER_DI = 28, + ZYDIS_REGISTER_R8W = 29, + ZYDIS_REGISTER_R9W = 30, + ZYDIS_REGISTER_R10W = 31, + ZYDIS_REGISTER_R11W = 32, + ZYDIS_REGISTER_R12W = 33, + ZYDIS_REGISTER_R13W = 34, + ZYDIS_REGISTER_R14W = 35, + ZYDIS_REGISTER_R15W = 36, + ZYDIS_REGISTER_EAX = 37, + ZYDIS_REGISTER_ECX = 38, + ZYDIS_REGISTER_EDX = 39, + ZYDIS_REGISTER_EBX = 40, + ZYDIS_REGISTER_ESP = 41, + ZYDIS_REGISTER_EBP = 42, + ZYDIS_REGISTER_ESI = 43, + ZYDIS_REGISTER_EDI = 44, + ZYDIS_REGISTER_R8D = 45, + ZYDIS_REGISTER_R9D = 46, + ZYDIS_REGISTER_R10D = 47, + ZYDIS_REGISTER_R11D = 48, + ZYDIS_REGISTER_R12D = 49, + ZYDIS_REGISTER_R13D = 50, + ZYDIS_REGISTER_R14D = 51, + ZYDIS_REGISTER_R15D = 52, + ZYDIS_REGISTER_RAX = 53, + ZYDIS_REGISTER_RCX = 54, + ZYDIS_REGISTER_RDX = 55, + ZYDIS_REGISTER_RBX = 56, + ZYDIS_REGISTER_RSP = 57, + ZYDIS_REGISTER_RBP = 58, + ZYDIS_REGISTER_RSI = 59, + ZYDIS_REGISTER_RDI = 60, + ZYDIS_REGISTER_R8 = 61, + ZYDIS_REGISTER_R9 = 62, + ZYDIS_REGISTER_R10 = 63, + ZYDIS_REGISTER_R11 = 64, + ZYDIS_REGISTER_R12 = 65, + ZYDIS_REGISTER_R13 = 66, + ZYDIS_REGISTER_R14 = 67, + ZYDIS_REGISTER_R15 = 68, + ZYDIS_REGISTER_ST0 = 69, + ZYDIS_REGISTER_ST1 = 70, + ZYDIS_REGISTER_ST2 = 71, + ZYDIS_REGISTER_ST3 = 72, + ZYDIS_REGISTER_ST4 = 73, + ZYDIS_REGISTER_ST5 = 74, + ZYDIS_REGISTER_ST6 = 75, + ZYDIS_REGISTER_ST7 = 76, + ZYDIS_REGISTER_X87CONTROL = 77, + ZYDIS_REGISTER_X87STATUS = 78, + ZYDIS_REGISTER_X87TAG = 79, + ZYDIS_REGISTER_MM0 = 80, + ZYDIS_REGISTER_MM1 = 81, + ZYDIS_REGISTER_MM2 = 82, + ZYDIS_REGISTER_MM3 = 83, + ZYDIS_REGISTER_MM4 = 84, + ZYDIS_REGISTER_MM5 = 85, + ZYDIS_REGISTER_MM6 = 86, + ZYDIS_REGISTER_MM7 = 87, + ZYDIS_REGISTER_XMM0 = 88, + ZYDIS_REGISTER_XMM1 = 89, + ZYDIS_REGISTER_XMM2 = 90, + ZYDIS_REGISTER_XMM3 = 91, + ZYDIS_REGISTER_XMM4 = 92, + ZYDIS_REGISTER_XMM5 = 93, + ZYDIS_REGISTER_XMM6 = 94, + ZYDIS_REGISTER_XMM7 = 95, + ZYDIS_REGISTER_XMM8 = 96, + ZYDIS_REGISTER_XMM9 = 97, + ZYDIS_REGISTER_XMM10 = 98, + ZYDIS_REGISTER_XMM11 = 99, + ZYDIS_REGISTER_XMM12 = 100, + ZYDIS_REGISTER_XMM13 = 101, + ZYDIS_REGISTER_XMM14 = 102, + ZYDIS_REGISTER_XMM15 = 103, + ZYDIS_REGISTER_XMM16 = 104, + ZYDIS_REGISTER_XMM17 = 105, + ZYDIS_REGISTER_XMM18 = 106, + ZYDIS_REGISTER_XMM19 = 107, + ZYDIS_REGISTER_XMM20 = 108, + ZYDIS_REGISTER_XMM21 = 109, + ZYDIS_REGISTER_XMM22 = 110, + ZYDIS_REGISTER_XMM23 = 111, + ZYDIS_REGISTER_XMM24 = 112, + ZYDIS_REGISTER_XMM25 = 113, + ZYDIS_REGISTER_XMM26 = 114, + ZYDIS_REGISTER_XMM27 = 115, + ZYDIS_REGISTER_XMM28 = 116, + ZYDIS_REGISTER_XMM29 = 117, + ZYDIS_REGISTER_XMM30 = 118, + ZYDIS_REGISTER_XMM31 = 119, + ZYDIS_REGISTER_YMM0 = 120, + ZYDIS_REGISTER_YMM1 = 121, + ZYDIS_REGISTER_YMM2 = 122, + ZYDIS_REGISTER_YMM3 = 123, + ZYDIS_REGISTER_YMM4 = 124, + ZYDIS_REGISTER_YMM5 = 125, + ZYDIS_REGISTER_YMM6 = 126, + ZYDIS_REGISTER_YMM7 = 127, + ZYDIS_REGISTER_YMM8 = 128, + ZYDIS_REGISTER_YMM9 = 129, + ZYDIS_REGISTER_YMM10 = 130, + ZYDIS_REGISTER_YMM11 = 131, + ZYDIS_REGISTER_YMM12 = 132, + ZYDIS_REGISTER_YMM13 = 133, + ZYDIS_REGISTER_YMM14 = 134, + ZYDIS_REGISTER_YMM15 = 135, + ZYDIS_REGISTER_YMM16 = 136, + ZYDIS_REGISTER_YMM17 = 137, + ZYDIS_REGISTER_YMM18 = 138, + ZYDIS_REGISTER_YMM19 = 139, + ZYDIS_REGISTER_YMM20 = 140, + ZYDIS_REGISTER_YMM21 = 141, + ZYDIS_REGISTER_YMM22 = 142, + ZYDIS_REGISTER_YMM23 = 143, + ZYDIS_REGISTER_YMM24 = 144, + ZYDIS_REGISTER_YMM25 = 145, + ZYDIS_REGISTER_YMM26 = 146, + ZYDIS_REGISTER_YMM27 = 147, + ZYDIS_REGISTER_YMM28 = 148, + ZYDIS_REGISTER_YMM29 = 149, + ZYDIS_REGISTER_YMM30 = 150, + ZYDIS_REGISTER_YMM31 = 151, + ZYDIS_REGISTER_ZMM0 = 152, + ZYDIS_REGISTER_ZMM1 = 153, + ZYDIS_REGISTER_ZMM2 = 154, + ZYDIS_REGISTER_ZMM3 = 155, + ZYDIS_REGISTER_ZMM4 = 156, + ZYDIS_REGISTER_ZMM5 = 157, + ZYDIS_REGISTER_ZMM6 = 158, + ZYDIS_REGISTER_ZMM7 = 159, + ZYDIS_REGISTER_ZMM8 = 160, + ZYDIS_REGISTER_ZMM9 = 161, + ZYDIS_REGISTER_ZMM10 = 162, + ZYDIS_REGISTER_ZMM11 = 163, + ZYDIS_REGISTER_ZMM12 = 164, + ZYDIS_REGISTER_ZMM13 = 165, + ZYDIS_REGISTER_ZMM14 = 166, + ZYDIS_REGISTER_ZMM15 = 167, + ZYDIS_REGISTER_ZMM16 = 168, + ZYDIS_REGISTER_ZMM17 = 169, + ZYDIS_REGISTER_ZMM18 = 170, + ZYDIS_REGISTER_ZMM19 = 171, + ZYDIS_REGISTER_ZMM20 = 172, + ZYDIS_REGISTER_ZMM21 = 173, + ZYDIS_REGISTER_ZMM22 = 174, + ZYDIS_REGISTER_ZMM23 = 175, + ZYDIS_REGISTER_ZMM24 = 176, + ZYDIS_REGISTER_ZMM25 = 177, + ZYDIS_REGISTER_ZMM26 = 178, + ZYDIS_REGISTER_ZMM27 = 179, + ZYDIS_REGISTER_ZMM28 = 180, + ZYDIS_REGISTER_ZMM29 = 181, + ZYDIS_REGISTER_ZMM30 = 182, + ZYDIS_REGISTER_ZMM31 = 183, + ZYDIS_REGISTER_TMM0 = 184, + ZYDIS_REGISTER_TMM1 = 185, + ZYDIS_REGISTER_TMM2 = 186, + ZYDIS_REGISTER_TMM3 = 187, + ZYDIS_REGISTER_TMM4 = 188, + ZYDIS_REGISTER_TMM5 = 189, + ZYDIS_REGISTER_TMM6 = 190, + ZYDIS_REGISTER_TMM7 = 191, + ZYDIS_REGISTER_FLAGS = 192, + ZYDIS_REGISTER_EFLAGS = 193, + ZYDIS_REGISTER_RFLAGS = 194, + ZYDIS_REGISTER_IP = 195, + ZYDIS_REGISTER_EIP = 196, + ZYDIS_REGISTER_RIP = 197, + ZYDIS_REGISTER_ES = 198, + ZYDIS_REGISTER_CS = 199, + ZYDIS_REGISTER_SS = 200, + ZYDIS_REGISTER_DS = 201, + ZYDIS_REGISTER_FS = 202, + ZYDIS_REGISTER_GS = 203, + ZYDIS_REGISTER_GDTR = 204, + ZYDIS_REGISTER_LDTR = 205, + ZYDIS_REGISTER_IDTR = 206, + ZYDIS_REGISTER_TR = 207, + ZYDIS_REGISTER_TR0 = 208, + ZYDIS_REGISTER_TR1 = 209, + ZYDIS_REGISTER_TR2 = 210, + ZYDIS_REGISTER_TR3 = 211, + ZYDIS_REGISTER_TR4 = 212, + ZYDIS_REGISTER_TR5 = 213, + ZYDIS_REGISTER_TR6 = 214, + ZYDIS_REGISTER_TR7 = 215, + ZYDIS_REGISTER_CR0 = 216, + ZYDIS_REGISTER_CR1 = 217, + ZYDIS_REGISTER_CR2 = 218, + ZYDIS_REGISTER_CR3 = 219, + ZYDIS_REGISTER_CR4 = 220, + ZYDIS_REGISTER_CR5 = 221, + ZYDIS_REGISTER_CR6 = 222, + ZYDIS_REGISTER_CR7 = 223, + ZYDIS_REGISTER_CR8 = 224, + ZYDIS_REGISTER_CR9 = 225, + ZYDIS_REGISTER_CR10 = 226, + ZYDIS_REGISTER_CR11 = 227, + ZYDIS_REGISTER_CR12 = 228, + ZYDIS_REGISTER_CR13 = 229, + ZYDIS_REGISTER_CR14 = 230, + ZYDIS_REGISTER_CR15 = 231, + ZYDIS_REGISTER_DR0 = 232, + ZYDIS_REGISTER_DR1 = 233, + ZYDIS_REGISTER_DR2 = 234, + ZYDIS_REGISTER_DR3 = 235, + ZYDIS_REGISTER_DR4 = 236, + ZYDIS_REGISTER_DR5 = 237, + ZYDIS_REGISTER_DR6 = 238, + ZYDIS_REGISTER_DR7 = 239, + ZYDIS_REGISTER_DR8 = 240, + ZYDIS_REGISTER_DR9 = 241, + ZYDIS_REGISTER_DR10 = 242, + ZYDIS_REGISTER_DR11 = 243, + ZYDIS_REGISTER_DR12 = 244, + ZYDIS_REGISTER_DR13 = 245, + ZYDIS_REGISTER_DR14 = 246, + ZYDIS_REGISTER_DR15 = 247, + ZYDIS_REGISTER_K0 = 248, + ZYDIS_REGISTER_K1 = 249, + ZYDIS_REGISTER_K2 = 250, + ZYDIS_REGISTER_K3 = 251, + ZYDIS_REGISTER_K4 = 252, + ZYDIS_REGISTER_K5 = 253, + ZYDIS_REGISTER_K6 = 254, + ZYDIS_REGISTER_K7 = 255, + ZYDIS_REGISTER_BND0 = 256, + ZYDIS_REGISTER_BND1 = 257, + ZYDIS_REGISTER_BND2 = 258, + ZYDIS_REGISTER_BND3 = 259, + ZYDIS_REGISTER_BNDCFG = 260, + ZYDIS_REGISTER_BNDSTATUS = 261, + ZYDIS_REGISTER_MXCSR = 262, + ZYDIS_REGISTER_PKRU = 263, + ZYDIS_REGISTER_XCR0 = 264, + ZYDIS_REGISTER_UIF = 265, + // Maximum value of this enum. + ZYDIS_REGISTER_MAX_VALUE = 265, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_REGISTER_REQUIRED_BITS = 9 +); + +// Defines the `ZydisRegisterKind` enum. +TZydisRegisterKind = ( + ZYDIS_REGKIND_INVALID = 0, + ZYDIS_REGKIND_GPR = 1, + ZYDIS_REGKIND_X87 = 2, + ZYDIS_REGKIND_MMX = 3, + ZYDIS_REGKIND_VR = 4, + ZYDIS_REGKIND_TMM = 5, + ZYDIS_REGKIND_SEGMENT = 6, + ZYDIS_REGKIND_TEST = 7, + ZYDIS_REGKIND_CONTROL = 8, + ZYDIS_REGKIND_DEBUG = 9, + ZYDIS_REGKIND_MASK = 10, + ZYDIS_REGKIND_BOUND = 11, + // Maximum value of this enum. + ZYDIS_REGKIND_MAX_VALUE = 11, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_REGKIND_REQUIRED_BITS = 4 +); + +// Defines the `ZydisRegisterClass` enum. +TZydisRegisterClass = ( + ZYDIS_REGCLASS_INVALID = 0, + // 8-bit general-purpose registers. + ZYDIS_REGCLASS_GPR8 = 1, + // 16-bit general-purpose registers. + ZYDIS_REGCLASS_GPR16 = 2, + // 32-bit general-purpose registers. + ZYDIS_REGCLASS_GPR32 = 3, + // 64-bit general-purpose registers. + ZYDIS_REGCLASS_GPR64 = 4, + // Floating point legacy registers. + ZYDIS_REGCLASS_X87 = 5, + // Floating point multimedia registers. + ZYDIS_REGCLASS_MMX = 6, + // 128-bit vector registers. + ZYDIS_REGCLASS_XMM = 7, + // 256-bit vector registers. + ZYDIS_REGCLASS_YMM = 8, + // 512-bit vector registers. + ZYDIS_REGCLASS_ZMM = 9, + // Matrix registers. + ZYDIS_REGCLASS_TMM = 10, + // Matrix registers. + ZYDIS_REGCLASS_FLAGS = 11, + // Instruction-pointer registers. + ZYDIS_REGCLASS_IP = 12, + // Segment registers. + ZYDIS_REGCLASS_SEGMENT = 13, + // Table registers. + ZYDIS_REGCLASS_TABLE = 14, + // Test registers. + ZYDIS_REGCLASS_TEST = 15, + // Control registers. + ZYDIS_REGCLASS_CONTROL = 16, + // Debug registers. + ZYDIS_REGCLASS_DEBUG = 17, + // Mask registers. + ZYDIS_REGCLASS_MASK = 18, + // Bound registers. + ZYDIS_REGCLASS_BOUND = 19, + // Maximum value of this enum. + ZYDIS_REGCLASS_MAX_VALUE = 19, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_REGCLASS_REQUIRED_BITS = 5 +); + +// Defines the `ZydisMemoryOperandType` enum. +TZydisMemoryOperandType = ( + ZYDIS_MEMOP_TYPE_INVALID = 0, + // Normal memory operand. + ZYDIS_MEMOP_TYPE_MEM = 1, + // The memory operand is only used for address-generation. No real memory-access is caused. + ZYDIS_MEMOP_TYPE_AGEN = 2, + // A memory operand using `SIB` addressing form, where the index register is not used in address calculation and scale is ignored. No real memory-access is caused. + ZYDIS_MEMOP_TYPE_MIB = 3, + // A vector `SIB` memory addressing operand (`VSIB`). + ZYDIS_MEMOP_TYPE_VSIB = 4, + // Maximum value of this enum. + ZYDIS_MEMOP_TYPE_MAX_VALUE = 4, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_MEMOP_TYPE_REQUIRED_BITS = 3 +); + +// Defines the `ZydisBranchType` enum. +TZydisBranchType = ( + // The instruction is not a branch instruction. + ZYDIS_BRANCH_TYPE_NONE = 0, + // The instruction is a short (8-bit) branch instruction. + ZYDIS_BRANCH_TYPE_SHORT = 1, + // The instruction is a near (16-bit or 32-bit) branch instruction. + ZYDIS_BRANCH_TYPE_NEAR = 2, + // The instruction is a far (inter-segment) branch instruction. + ZYDIS_BRANCH_TYPE_FAR = 3, + // Maximum value of this enum. + ZYDIS_BRANCH_TYPE_MAX_VALUE = 3, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_BRANCH_TYPE_REQUIRED_BITS = 2 +); + +// Defines the `ZydisExceptionClass` enum. +TZydisExceptionClass = ( + ZYDIS_EXCEPTION_CLASS_NONE = 0, + ZYDIS_EXCEPTION_CLASS_SSE1 = 1, + ZYDIS_EXCEPTION_CLASS_SSE2 = 2, + ZYDIS_EXCEPTION_CLASS_SSE3 = 3, + ZYDIS_EXCEPTION_CLASS_SSE4 = 4, + ZYDIS_EXCEPTION_CLASS_SSE5 = 5, + ZYDIS_EXCEPTION_CLASS_SSE7 = 6, + ZYDIS_EXCEPTION_CLASS_AVX1 = 7, + ZYDIS_EXCEPTION_CLASS_AVX2 = 8, + ZYDIS_EXCEPTION_CLASS_AVX3 = 9, + ZYDIS_EXCEPTION_CLASS_AVX4 = 10, + ZYDIS_EXCEPTION_CLASS_AVX5 = 11, + ZYDIS_EXCEPTION_CLASS_AVX6 = 12, + ZYDIS_EXCEPTION_CLASS_AVX7 = 13, + ZYDIS_EXCEPTION_CLASS_AVX8 = 14, + ZYDIS_EXCEPTION_CLASS_AVX11 = 15, + ZYDIS_EXCEPTION_CLASS_AVX12 = 16, + ZYDIS_EXCEPTION_CLASS_E1 = 17, + ZYDIS_EXCEPTION_CLASS_E1NF = 18, + ZYDIS_EXCEPTION_CLASS_E2 = 19, + ZYDIS_EXCEPTION_CLASS_E2NF = 20, + ZYDIS_EXCEPTION_CLASS_E3 = 21, + ZYDIS_EXCEPTION_CLASS_E3NF = 22, + ZYDIS_EXCEPTION_CLASS_E4 = 23, + ZYDIS_EXCEPTION_CLASS_E4NF = 24, + ZYDIS_EXCEPTION_CLASS_E5 = 25, + ZYDIS_EXCEPTION_CLASS_E5NF = 26, + ZYDIS_EXCEPTION_CLASS_E6 = 27, + ZYDIS_EXCEPTION_CLASS_E6NF = 28, + ZYDIS_EXCEPTION_CLASS_E7NM = 29, + ZYDIS_EXCEPTION_CLASS_E7NM128 = 30, + ZYDIS_EXCEPTION_CLASS_E9NF = 31, + ZYDIS_EXCEPTION_CLASS_E10 = 32, + ZYDIS_EXCEPTION_CLASS_E10NF = 33, + ZYDIS_EXCEPTION_CLASS_E11 = 34, + ZYDIS_EXCEPTION_CLASS_E11NF = 35, + ZYDIS_EXCEPTION_CLASS_E12 = 36, + ZYDIS_EXCEPTION_CLASS_E12NP = 37, + ZYDIS_EXCEPTION_CLASS_K20 = 38, + ZYDIS_EXCEPTION_CLASS_K21 = 39, + ZYDIS_EXCEPTION_CLASS_AMXE1 = 40, + ZYDIS_EXCEPTION_CLASS_AMXE2 = 41, + ZYDIS_EXCEPTION_CLASS_AMXE3 = 42, + ZYDIS_EXCEPTION_CLASS_AMXE4 = 43, + ZYDIS_EXCEPTION_CLASS_AMXE5 = 44, + ZYDIS_EXCEPTION_CLASS_AMXE6 = 45, + // Maximum value of this enum. + ZYDIS_EXCEPTION_CLASS_MAX_VALUE = 45, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_EXCEPTION_CLASS_REQUIRED_BITS = 6 +); + +// Defines the `ZydisMaskMode` enum. +TZydisMaskMode = ( + ZYDIS_MASK_MODE_INVALID = 0, + // Masking is disabled for the current instruction (`K0` register is used). + ZYDIS_MASK_MODE_DISABLED = 1, + // The embedded mask register is used as a merge-mask. + ZYDIS_MASK_MODE_MERGING = 2, + // The embedded mask register is used as a zero-mask. + ZYDIS_MASK_MODE_ZEROING = 3, + // The embedded mask register is used as a control-mask (element selector). + ZYDIS_MASK_MODE_CONTROL = 4, + // The embedded mask register is used as a zeroing control-mask (element selector). + ZYDIS_MASK_MODE_CONTROL_ZEROING = 5, + // Maximum value of this enum. + ZYDIS_MASK_MODE_MAX_VALUE = 5, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_MASK_MODE_REQUIRED_BITS = 3 +); + +// Defines the `ZydisBroadcastMode` enum. +TZydisBroadcastMode = ( + ZYDIS_BROADCAST_MODE_INVALID = 0, + ZYDIS_BROADCAST_MODE_1_TO_2 = 1, + ZYDIS_BROADCAST_MODE_1_TO_4 = 2, + ZYDIS_BROADCAST_MODE_1_TO_8 = 3, + ZYDIS_BROADCAST_MODE_1_TO_16 = 4, + ZYDIS_BROADCAST_MODE_1_TO_32 = 5, + ZYDIS_BROADCAST_MODE_1_TO_64 = 6, + ZYDIS_BROADCAST_MODE_2_TO_4 = 7, + ZYDIS_BROADCAST_MODE_2_TO_8 = 8, + ZYDIS_BROADCAST_MODE_2_TO_16 = 9, + ZYDIS_BROADCAST_MODE_4_TO_8 = 10, + ZYDIS_BROADCAST_MODE_4_TO_16 = 11, + ZYDIS_BROADCAST_MODE_8_TO_16 = 12, + // Maximum value of this enum. + ZYDIS_BROADCAST_MODE_MAX_VALUE = 12, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_BROADCAST_MODE_REQUIRED_BITS = 4 +); + +// Defines the `ZydisRoundingMode` enum. +TZydisRoundingMode = ( + ZYDIS_ROUNDING_MODE_INVALID = 0, + // Round to nearest. + ZYDIS_ROUNDING_MODE_RN = 1, + // Round down. + ZYDIS_ROUNDING_MODE_RD = 2, + // Round up. + ZYDIS_ROUNDING_MODE_RU = 3, + // Round towards zero. + ZYDIS_ROUNDING_MODE_RZ = 4, + // Maximum value of this enum. + ZYDIS_ROUNDING_MODE_MAX_VALUE = 4, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_ROUNDING_MODE_REQUIRED_BITS = 3 +); + +// Defines the `ZydisSwizzleMode` enum. +TZydisSwizzleMode = ( + ZYDIS_SWIZZLE_MODE_INVALID = 0, + ZYDIS_SWIZZLE_MODE_DCBA = 1, + ZYDIS_SWIZZLE_MODE_CDAB = 2, + ZYDIS_SWIZZLE_MODE_BADC = 3, + ZYDIS_SWIZZLE_MODE_DACB = 4, + ZYDIS_SWIZZLE_MODE_AAAA = 5, + ZYDIS_SWIZZLE_MODE_BBBB = 6, + ZYDIS_SWIZZLE_MODE_CCCC = 7, + ZYDIS_SWIZZLE_MODE_DDDD = 8, + // Maximum value of this enum. + ZYDIS_SWIZZLE_MODE_MAX_VALUE = 8, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_SWIZZLE_MODE_REQUIRED_BITS = 4 +); + +// Defines the `ZydisConversionMode` enum. +TZydisConversionMode = ( + ZYDIS_CONVERSION_MODE_INVALID = 0, + ZYDIS_CONVERSION_MODE_FLOAT16 = 1, + ZYDIS_CONVERSION_MODE_SINT8 = 2, + ZYDIS_CONVERSION_MODE_UINT8 = 3, + ZYDIS_CONVERSION_MODE_SINT16 = 4, + ZYDIS_CONVERSION_MODE_UINT16 = 5, + // Maximum value of this enum. + ZYDIS_CONVERSION_MODE_MAX_VALUE = 5, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_CONVERSION_MODE_REQUIRED_BITS = 3 +); + +// Defines the `ZydisPrefixType` enum. +TZydisPrefixType = ( + // The prefix is ignored by the instruction. + ZYDIS_PREFIX_TYPE_IGNORED = 0, + // The prefix is effectively used by the instruction. + ZYDIS_PREFIX_TYPE_EFFECTIVE = 1, + // The prefix is used as a mandatory prefix. + ZYDIS_PREFIX_TYPE_MANDATORY = 2, + // Maximum value of this enum. + ZYDIS_PREFIX_TYPE_MAX_VALUE = 2, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_PREFIX_TYPE_REQUIRED_BITS = 2 +); + +// Defines the `ZydisDecoderMode` enum. +TZydisDecoderMode = ( + // Enables minimal instruction decoding without semantic analysis. + ZYDIS_DECODER_MODE_MINIMAL = 0, + // Enables the `AMD`-branch mode. + ZYDIS_DECODER_MODE_AMD_BRANCHES = 1, + // Enables `KNC` compatibility-mode. + ZYDIS_DECODER_MODE_KNC = 2, + // Enables the `MPX` mode. + ZYDIS_DECODER_MODE_MPX = 3, + // Enables the `CET` mode. + ZYDIS_DECODER_MODE_CET = 4, + // Enables the `LZCNT` mode. + ZYDIS_DECODER_MODE_LZCNT = 5, + // Enables the `TZCNT` mode. + ZYDIS_DECODER_MODE_TZCNT = 6, + // Enables the `WBNOINVD` mode. + ZYDIS_DECODER_MODE_WBNOINVD = 7, + // Enables the `CLDEMOTE` mode. + ZYDIS_DECODER_MODE_CLDEMOTE = 8, + // Enables the `IPREFETCH` mode. + ZYDIS_DECODER_MODE_IPREFETCH = 9, + // Maximum value of this enum. + ZYDIS_DECODER_MODE_MAX_VALUE = 9, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_DECODER_MODE_REQUIRED_BITS = 4 +); + +// Defines possible physical instruction encodings as bit flags, so multiple acceptable encodings can be specified simultaneously. +TZydisEncodableEncoding = ( + ZYDIS_ENCODABLE_ENCODING_DEFAULT = 0, + ZYDIS_ENCODABLE_ENCODING_LEGACY = 1, + ZYDIS_ENCODABLE_ENCODING_3DNOW = 2, + ZYDIS_ENCODABLE_ENCODING_XOP = 4, + ZYDIS_ENCODABLE_ENCODING_VEX = 8, + ZYDIS_ENCODABLE_ENCODING_EVEX = 16, + ZYDIS_ENCODABLE_ENCODING_MVEX = 32, + // Maximum value of this enum. + ZYDIS_ENCODABLE_ENCODING_MAX_VALUE = 63, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_ENCODABLE_ENCODING_REQUIRED_BITS = 6 +); + +// Defines encodable physical/effective sizes of relative immediate operands. See `ZydisEncoderRequest.branch_width` for more details. +TZydisBranchWidth = ( + ZYDIS_BRANCH_WIDTH_NONE = 0, + ZYDIS_BRANCH_WIDTH_8 = 1, + ZYDIS_BRANCH_WIDTH_16 = 2, + ZYDIS_BRANCH_WIDTH_32 = 3, + ZYDIS_BRANCH_WIDTH_64 = 4, + // Maximum value of this enum. + ZYDIS_BRANCH_WIDTH_MAX_VALUE = 4, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_BRANCH_WIDTH_REQUIRED_BITS = 3 +); + +// Defines possible values for address size hints. See `ZydisEncoderRequest` for more information about address size hints. +TZydisAddressSizeHint = ( + ZYDIS_ADDRESS_SIZE_HINT_NONE = 0, + ZYDIS_ADDRESS_SIZE_HINT_16 = 1, + ZYDIS_ADDRESS_SIZE_HINT_32 = 2, + ZYDIS_ADDRESS_SIZE_HINT_64 = 3, + // Maximum value of this enum. + ZYDIS_ADDRESS_SIZE_HINT_MAX_VALUE = 3, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_ADDRESS_SIZE_HINT_REQUIRED_BITS = 2 +); + +// Defines possible values for operand size hints. See `ZydisEncoderRequest` for more information about operand size hints. +TZydisOperandSizeHint = ( + ZYDIS_OPERAND_SIZE_HINT_NONE = 0, + ZYDIS_OPERAND_SIZE_HINT_8 = 1, + ZYDIS_OPERAND_SIZE_HINT_16 = 2, + ZYDIS_OPERAND_SIZE_HINT_32 = 3, + ZYDIS_OPERAND_SIZE_HINT_64 = 4, + // Maximum value of this enum. + ZYDIS_OPERAND_SIZE_HINT_MAX_VALUE = 4, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_OPERAND_SIZE_HINT_REQUIRED_BITS = 3 +); + +// Enum selecting the syntax to format the disassembly in. +TZydisFormatterStyle = ( + // Generates `AT&T`-style disassembly. + ZYDIS_FORMATTER_STYLE_ATT = 0, + // Generates `Intel`-style disassembly. + ZYDIS_FORMATTER_STYLE_INTEL = 1, + // Generates `MASM`-style disassembly that is directly accepted as input for the `MASM` assembler. + ZYDIS_FORMATTER_STYLE_INTEL_MASM = 2, + // Maximum value of this enum. + ZYDIS_FORMATTER_STYLE_MAX_VALUE = 2, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_FORMATTER_STYLE_REQUIRED_BITS = 2 +); + +// Enum selecting a property of the formatter. +TZydisFormatterProperty = ( + // Controls the printing of effective operand-size suffixes (`AT&T`) or operand-sizes of memory operands (`INTEL`). + ZYDIS_FORMATTER_PROP_FORCE_SIZE = 0, + // Controls the printing of segment prefixes. + ZYDIS_FORMATTER_PROP_FORCE_SEGMENT = 1, + // Controls the printing of the scale-factor component for memory operands. + ZYDIS_FORMATTER_PROP_FORCE_SCALE_ONE = 2, + // Controls the printing of branch addresses. + ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_BRANCHES = 3, + // Controls the printing of `EIP`/`RIP`-relative addresses. + ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_RIPREL = 4, + // Controls the printing of branch-instructions sizes. + ZYDIS_FORMATTER_PROP_PRINT_BRANCH_SIZE = 5, + // Controls the printing of instruction prefixes. + ZYDIS_FORMATTER_PROP_DETAILED_PREFIXES = 6, + // Controls the base of address values. + ZYDIS_FORMATTER_PROP_ADDR_BASE = 7, + // Controls the signedness of relative addresses. Absolute addresses are always unsigned. + ZYDIS_FORMATTER_PROP_ADDR_SIGNEDNESS = 8, + // Controls the padding of absolute address values. + ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE = 9, + // Controls the padding of relative address values. + ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE = 10, + // Controls the base of displacement values. + ZYDIS_FORMATTER_PROP_DISP_BASE = 11, + // Controls the signedness of displacement values. + ZYDIS_FORMATTER_PROP_DISP_SIGNEDNESS = 12, + // Controls the padding of displacement values. + ZYDIS_FORMATTER_PROP_DISP_PADDING = 13, + // Controls the base of immediate values. + ZYDIS_FORMATTER_PROP_IMM_BASE = 14, + // Controls the signedness of immediate values. + ZYDIS_FORMATTER_PROP_IMM_SIGNEDNESS = 15, + // Controls the padding of immediate values. + ZYDIS_FORMATTER_PROP_IMM_PADDING = 16, + // Controls the letter-case for prefixes. + ZYDIS_FORMATTER_PROP_UPPERCASE_PREFIXES = 17, + // Controls the letter-case for the mnemonic. + ZYDIS_FORMATTER_PROP_UPPERCASE_MNEMONIC = 18, + // Controls the letter-case for registers. + ZYDIS_FORMATTER_PROP_UPPERCASE_REGISTERS = 19, + // Controls the letter-case for typecasts. + ZYDIS_FORMATTER_PROP_UPPERCASE_TYPECASTS = 20, + // Controls the letter-case for decorators. + ZYDIS_FORMATTER_PROP_UPPERCASE_DECORATORS = 21, + // Controls the prefix for decimal values. + ZYDIS_FORMATTER_PROP_DEC_PREFIX = 22, + // Controls the suffix for decimal values. + ZYDIS_FORMATTER_PROP_DEC_SUFFIX = 23, + // Controls the letter-case of hexadecimal values. + ZYDIS_FORMATTER_PROP_HEX_UPPERCASE = 24, + // Controls whether to prepend hexadecimal values with a leading zero if the first character is non-numeric. + ZYDIS_FORMATTER_PROP_HEX_FORCE_LEADING_NUMBER = 25, + // Controls the prefix for hexadecimal values. + ZYDIS_FORMATTER_PROP_HEX_PREFIX = 26, + // Controls the suffix for hexadecimal values. + ZYDIS_FORMATTER_PROP_HEX_SUFFIX = 27, + // Maximum value of this enum. + ZYDIS_FORMATTER_PROP_MAX_VALUE = 27, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_FORMATTER_PROP_REQUIRED_BITS = 5 +); + +// Enum defining different mantissae to be used during formatting. +TZydisNumericBase = ( + // Decimal system. + ZYDIS_NUMERIC_BASE_DEC = 0, + // Hexadecimal system. + ZYDIS_NUMERIC_BASE_HEX = 1, + // Maximum value of this enum. + ZYDIS_NUMERIC_BASE_MAX_VALUE = 1, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_NUMERIC_BASE_REQUIRED_BITS = 1 +); + +// Enum defining the signeness of integers to be used during formatting. +TZydisSignedness = ( + // Automatically choose the most suitable mode based on the operands ZydisDecodedOperand.imm.is_signed` attribute. + ZYDIS_SIGNEDNESS_AUTO = 0, + // Force signed values. + ZYDIS_SIGNEDNESS_SIGNED = 1, + // Force unsigned values. + ZYDIS_SIGNEDNESS_UNSIGNED = 2, + // Maximum value of this enum. + ZYDIS_SIGNEDNESS_MAX_VALUE = 2, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_SIGNEDNESS_REQUIRED_BITS = 2 +); + +// Enum definining magic values that receive special treatment when used as padding properties of the formatter. +TZydisPadding = ( + // Disables padding. + ZYDIS_PADDING_DISABLED = 0, + // Padds the value to the current stack-width for addresses, or to the operand-width for immediate values (hexadecimal only). + ZYDIS_PADDING_AUTO = -1, + // Maximum value of this enum. + ZYDIS_PADDING_MAX_VALUE = -1, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_PADDING_REQUIRED_BITS = 32 +); + +// Enum selecting a formatter function to be replaced with hooks. +TZydisFormatterFunction = ( + // This function is invoked before the formatter formats an instruction. + ZYDIS_FORMATTER_FUNC_PRE_INSTRUCTION = 0, + // This function is invoked after the formatter formatted an instruction. + ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION = 1, + // This function refers to the main formatting function. + ZYDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION = 2, + // This function is invoked before the formatter formats an operand. + ZYDIS_FORMATTER_FUNC_PRE_OPERAND = 3, + // This function is invoked after the formatter formatted an operand. + ZYDIS_FORMATTER_FUNC_POST_OPERAND = 4, + // This function is invoked to format a register operand. + ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG = 5, + // This function is invoked to format a memory operand. + ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM = 6, + // This function is invoked to format a pointer operand. + ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR = 7, + // This function is invoked to format an immediate operand. + ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM = 8, + // This function is invoked to print the instruction mnemonic. + ZYDIS_FORMATTER_FUNC_PRINT_MNEMONIC = 9, + // This function is invoked to print a register. + ZYDIS_FORMATTER_FUNC_PRINT_REGISTER = 10, + // This function is invoked to print absolute addresses. + ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS = 11, + // This function is invoked to print relative addresses. + ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL = 12, + // This function is invoked to print a memory displacement value. + ZYDIS_FORMATTER_FUNC_PRINT_DISP = 13, + // This function is invoked to print an immediate value. + ZYDIS_FORMATTER_FUNC_PRINT_IMM = 14, + // This function is invoked to print the size of a memory operand (`INTEL` only). + ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST = 15, + // This function is invoked to print the segment-register of a memory operand. + ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT = 16, + // This function is invoked to print the instruction prefixes. + ZYDIS_FORMATTER_FUNC_PRINT_PREFIXES = 17, + // This function is invoked after formatting an operand to print a `EVEX`/`MVEX` decorator. + ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR = 18, + // Maximum value of this enum. + ZYDIS_FORMATTER_FUNC_MAX_VALUE = 18, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_FORMATTER_FUNC_REQUIRED_BITS = 5 +); + +// Enum of all decorator types. +TZydisDecorator = ( + ZYDIS_DECORATOR_INVALID = 0, + // The embedded-mask decorator. + ZYDIS_DECORATOR_MASK = 1, + // The broadcast decorator. + ZYDIS_DECORATOR_BC = 2, + // The rounding-control decorator. + ZYDIS_DECORATOR_RC = 3, + // The suppress-all-exceptions decorator. + ZYDIS_DECORATOR_SAE = 4, + // The register-swizzle decorator. + ZYDIS_DECORATOR_SWIZZLE = 5, + // The conversion decorator. + ZYDIS_DECORATOR_CONVERSION = 6, + // The eviction-hint decorator. + ZYDIS_DECORATOR_EH = 7, + // Maximum value of this enum. + ZYDIS_DECORATOR_MAX_VALUE = 7, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_DECORATOR_REQUIRED_BITS = 3 +); + +// Defines the `ZydisInstructionSegment` struct. +TZydisInstructionSegment = ( + ZYDIS_INSTR_SEGMENT_NONE = 0, + // The legacy prefixes (including ignored `REX` prefixes). + ZYDIS_INSTR_SEGMENT_PREFIXES = 1, + // The effective `REX` prefix byte. + ZYDIS_INSTR_SEGMENT_REX = 2, + // The `XOP` prefix bytes. + ZYDIS_INSTR_SEGMENT_XOP = 3, + // The `VEX` prefix bytes. + ZYDIS_INSTR_SEGMENT_VEX = 4, + // The `EVEX` prefix bytes. + ZYDIS_INSTR_SEGMENT_EVEX = 5, + // The `MVEX` prefix bytes. + ZYDIS_INSTR_SEGMENT_MVEX = 6, + // The opcode bytes. + ZYDIS_INSTR_SEGMENT_OPCODE = 7, + // The `ModRM` byte. + ZYDIS_INSTR_SEGMENT_MODRM = 8, + // The `SIB` byte. + ZYDIS_INSTR_SEGMENT_SIB = 9, + // The displacement bytes. + ZYDIS_INSTR_SEGMENT_DISPLACEMENT = 10, + // The immediate bytes. + ZYDIS_INSTR_SEGMENT_IMMEDIATE = 11, + // Maximum value of this enum. + ZYDIS_INSTR_SEGMENT_MAX_VALUE = 11, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_INSTR_SEGMENT_REQUIRED_BITS = 4 +); + +// Defines the `ZydisFeature` enum. +TZydisFeature = ( + ZYDIS_FEATURE_DECODER = 0, + ZYDIS_FEATURE_ENCODER = 1, + ZYDIS_FEATURE_FORMATTER = 2, + ZYDIS_FEATURE_AVX512 = 3, + ZYDIS_FEATURE_KNC = 4, + ZYDIS_FEATURE_SEGMENT = 5, + // Maximum value of this enum. + ZYDIS_FEATURE_MAX_VALUE = 5, + // The minimum number of bits required to represent all values of this enum. + ZYDIS_FEATURE_REQUIRED_BITS = 3 +); + diff --git a/Zydis/Zycore.Allocator.pas b/Zydis/Zycore.Allocator.pas new file mode 100644 index 0000000..fa18cb6 --- /dev/null +++ b/Zydis/Zycore.Allocator.pas @@ -0,0 +1,69 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} +unit Zycore.Allocator; + +{$IFDEF FPC} + {$mode Delphi}{$H+}{$J-} + {$PackRecords C} +{$ENDIF} + + +interface + +uses + Zydis.Enums, + Zydis.Types; + +type + // Pointer to TZyanAllocator + PZyanAllocator = ^TZyanAllocator; + + { Defines the ZyanAllocatorAllocate function prototype. } + ZyanAllocatorAllocate = function(allocator: PZyanAllocator; var p: Pointer; + element_size, n: ZyanUSize): ZyanStatus; cdecl; + + { Defines the ZyanAllocatorDeallocate function prototype. } + ZyanAllocatorDeallocate = function(allocator: PZyanAllocator; p: Pointer; + element_size, n: ZyanUSize): ZyanStatus; cdecl; + + + { Defines the ZyanAllocator struct. } + TZyanAllocator = record + { This is the base class for all custom allocator implementations. } + { All fields in this struct should be considered as "private". Any changes may lead to unexpected behavior. } + + { The allocate function. } + allocate: ZyanAllocatorAllocate; + { The reallocate function. } + reallocate: ZyanAllocatorAllocate; + { The deallocate function. } + deallocate: ZyanAllocatorDeallocate; + end; + + + +implementation + +end. + diff --git a/Zydis/Zycore.FormatterBuffer.pas b/Zydis/Zycore.FormatterBuffer.pas new file mode 100644 index 0000000..fffee83 --- /dev/null +++ b/Zydis/Zycore.FormatterBuffer.pas @@ -0,0 +1,54 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} +unit Zycore.FormatterBuffer; + +{$IFDEF FPC} + {$mode Delphi}{$H+}{$J-} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types, + Zycore.Strings; + + +Type + { Defines the ZydisFormatterBuffer struct. } + TZydisFormatterBuffer = record + { ZYAN_TRUE, if the buffer contains a token stream or ZYAN_FALSE, if it contains a simple string. } + is_token_list: ZyanBool; + { The remaining capacity of the buffer. } + capacity: ZyanUSize; + { The ZyanString instance that refers to the literal value of the most recently added token. } + string_: TZyanString; + end; + PZydisFormatterBuffer = ^TZydisFormatterBuffer; + +implementation + +end. + diff --git a/Zydis/Zydis.Exception.pas b/Zydis/Zycore.Strings.pas similarity index 64% rename from Zydis/Zydis.Exception.pas rename to Zydis/Zycore.Strings.pas index 2f8425d..21b64da 100644 --- a/Zydis/Zydis.Exception.pas +++ b/Zydis/Zycore.Strings.pas @@ -1,8 +1,6 @@ -{*************************************************************************************************** +{******************************************************************************* - Zydis Top Level API - - Original Author : Florian Bernd + Zydis Pascal API By Coldzer0 * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,40 +20,40 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. -***************************************************************************************************} - -unit Zydis.Exception; - -interface +*******************************************************************************} +unit Zycore.Strings; {$IFDEF FPC} - {$MODE DELPHI} + {$mode Delphi}{$H+}{$J-} + {$PackRecords C} {$ENDIF} +interface + uses - {$IFNDEF FPC}System.SysUtils{$ELSE}SysUtils{$ENDIF}, Zydis; + Zydis.Enums, + Zydis.Types, + Zycore.Vector; type - TZydisException = class(Exception) - strict private - FStatus: TZydisStatus; - public - class procedure RaiseException(Status: TZydisStatus); inline; - public - property Status: TZydisStatus read FStatus write FStatus; - end; -implementation + TZyanString = record + { String flags. } + flags: TZyanStringFlags; + { The vector that contains the actual string. } + vector: TZyanVector; + end; + PZyanString = ^TZyanString; -{ TZydisException } + TZyanStringView = record + // The string data. + // The view internally re-uses the normal string struct to allow casts without any runtime + // overhead. + string_ : TZyanString; + end; + PZyanStringView = ^TZyanStringView; -class procedure TZydisException.RaiseException(Status: TZydisStatus); -var - E: TZydisException; -begin - E := TZydisException.CreateFmt('Zydis exception. Status code: %2x', [Ord(Status)]); - E.Status := Status; - raise E; -end; +implementation end. + diff --git a/Zydis/Zycore.Vector.pas b/Zydis/Zycore.Vector.pas new file mode 100644 index 0000000..64806d0 --- /dev/null +++ b/Zydis/Zycore.Vector.pas @@ -0,0 +1,77 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} +unit Zycore.Vector; + +{$IFDEF FPC} + {$mode Delphi}{$H+}{$J-} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types, + Zycore.Allocator; + +type + { Defines the ZyanMemberProcedure function prototype. } + TZyanMemberProcedure = procedure(obj: Pointer); cdecl; + + { Defines the ZyanConstMemberProcedure function prototype. } + TZyanConstMemberProcedure = procedure(obj: Pointer); cdecl; + + { Defines the ZyanMemberFunction function prototype. } + TZyanMemberFunction = function(obj: Pointer): ZyanStatus; cdecl; + + { Defines the ZyanConstMemberFunction function prototype. } + TZyanConstMemberFunction = function(obj: Pointer): ZyanStatus; cdecl; + + +type + { ZyanVector_ } + TZyanVector = record + { The memory allocator. } + allocator: PZyanAllocator; + { The growth factor. } + growth_factor: ZyanU8; + { The shrink threshold. } + shrink_threshold: ZyanU8; + { The current number of elements in the vector. } + size: ZyanUSize; + { The maximum capacity (number of elements). } + capacity: ZyanUSize; + { The size of a single element in bytes. } + element_size: ZyanUSize; + { The element destructor callback. } + destructor_: TZyanMemberProcedure; + { The data pointer. } + data: Pointer; // You can specify a more specific data type if needed + end; + + +implementation + +end. + diff --git a/Zydis/Zydis.Apis.pas b/Zydis/Zydis.Apis.pas new file mode 100644 index 0000000..a5f2c84 --- /dev/null +++ b/Zydis/Zydis.Apis.pas @@ -0,0 +1,549 @@ +{****************************************************************************** + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} + +unit Zydis.Apis; + +{$IFDEF FPC} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types, + Zydis.Encoder.Types, + Zydis.Decoder.Types, + Zydis.Formatter.Types, + Zydis.Disassembler.Types; + + +{$IFNDEF FPC} + {.$DEFINE Z_DYN_LINK} +{$ENDIF} + +{$IFDEF Z_DYN_LINK} +const + {$IFDEF CPUX86} + Z_LIB_NAME = 'Zydis32.dll'; + {$ENDIF} + {$IFDEF CPUX64} + Z_LIB_NAME = 'Zydis64.dll'; + {$ENDIF} + _PREFIX = ''; +{$ELSE} + +const + {$ifdef MSWINDOWS} + {$ifdef CPUX64} + _PREFIX = ''; + {$else} + _PREFIX = '_'; + {$endif CPUX64} + {$else} + {$ifdef OSDARWIN} + _PREFIX = '_'; + {$else} + _PREFIX = ''; // other POSIX systems don't haveany trailing underscore + {$endif OSDARWIN} + {$endif MSWINDOWS} + {$IFDEF CPUX86} + {$L 'x32/Decoder.obj'} + {$L 'x32/Disassembler.obj'} + {$L 'x32/Encoder.obj'} + {$L 'x32/EncoderData.obj'} + {$L 'x32/DecoderData.obj'} + {$L 'x32/Formatter.obj'} + {$L 'x32/FormatterATT.obj'} + {$L 'x32/FormatterBase.obj'} + {$L 'x32/FormatterBuffer.obj'} + {$L 'x32/FormatterIntel.obj'} + {$L 'x32/MetaInfo.obj'} + {$L 'x32/Mnemonic.obj'} + {$L 'x32/Register.obj'} + {$L 'x32/Segment.obj'} + {$L 'x32/SharedData.obj'} + {$L 'x32/String.obj'} + {$L 'x32/Utils.obj'} + {$L 'x32/Zydis.obj'} + {$ENDIF} + {$IFDEF CPUX64} + {$IFDEF FPC} + {$LinkLib libZydis.a} + {$LinkLib libZycore.a} + {$ELSE} + {$L 'x64/Decoder.obj'} + {$L 'x64/Disassembler.obj'} + {$L 'x64/Encoder.obj'} + {$L 'x64/EncoderData.obj'} + {$L 'x64/DecoderData.obj'} + {$L 'x64/Formatter.obj'} + {$L 'x64/FormatterATT.obj'} + {$L 'x64/FormatterBase.obj'} + {$L 'x64/FormatterBuffer.obj'} + {$L 'x64/FormatterIntel.obj'} + {$L 'x64/MetaInfo.obj'} + {$L 'x64/Mnemonic.obj'} + {$L 'x64/Register.obj'} + {$L 'x64/Segment.obj'} + {$L 'x64/SharedData.obj'} + {$L 'x64/String.obj'} + {$L 'x64/Utils.obj'} + {$L 'x64/Zydis.obj'} + {$ENDIF} + {$ENDIF} +{$ENDIF} + + + +// ===========================================================================*} +// Constants +// ===========================================================================*} +const + ZYDIS_VERSION = $0004000000000000; + + + +// -------------------------------------------------------------------------- *} +// Zydis Version APIs +// -------------------------------------------------------------------------- *} +procedure ZydisDecoderInit(decoder: PZydisDecoder; machine_mode: TZydisMachineMode; + stack_width: TZydisStackWidth); cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisDecoderInit'; + +// -------------------------------------------------------------------------- *} +// Zydis Disassembler +// -------------------------------------------------------------------------- *} + +{ + Disassemble an instruction and format it to human-readable text in a single step (Intel syntax). + + @param machine_mode The machine mode to assume when disassembling. When in doubt, pass + ZYDIS_MACHINE_MODE_LONG_64 for what is typically referred to as + "64-bit mode" or ZYDIS_MACHINE_MODE_LEGACY_32 for "32-bit mode". + @param runtime_address The program counter (eip / rip) to assume when formatting the + instruction. Many instructions behave differently depending on the + address they are located at. + @param buffer A pointer to the raw instruction bytes that you wish to decode. + @param length The length of the input buffer. Note that this can be bigger than the + actual size of the instruction -- you don't have to know the size up + front. This length is merely used to prevent Zydis from doing + out-of-bounds reads on your buffer. + @param instruction A pointer to receive the decoded instruction information. Can be + uninitialized and reused on later calls. + + This is a convenience function intended as a quick path for getting started with using Zydis. + It internally calls a range of other more advanced functions to obtain all commonly needed + information about the instruction. It is likely that you won't need most of this information in + practice, so it is advisable to instead call these more advanced functions directly if you're + concerned about performance. + + This function essentially combines the following more advanced functions into a single call: + - ZydisDecoderInit + - ZydisDecoderDecodeInstruction + - ZydisDecoderDecodeOperands + - ZydisFormatterInit + - ZydisFormatterFormatInstruction + + @return A zyan status code. +} +function ZydisDisassembleIntel(machine_mode: TZydisMachineMode; + runtime_address: ZyanU64; buffer: Pointer; length: ZyanUSize; + var instruction: TZydisDisassembledInstruction): ZyanStatus; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisDisassembleIntel'; + + +// -------------------------------------------------------------------------- *} +// Zydis Decoder +// -------------------------------------------------------------------------- *} + + +{ + Decodes the instruction in the given input buffer and returns all details (e.g. operands). + + @param decoder A pointer to the ZydisDecoder instance. + @param buffer A pointer to the input buffer. + @param length The length of the input buffer. Note that this can be bigger than the + actual size of the instruction -- you don't have to know the size up + front. This length is merely used to prevent Zydis from doing + out-of-bounds reads on your buffer. + @param instruction A pointer to the ZydisDecodedInstruction struct receiving the details + about the decoded instruction. + @param operands A pointer to an array with ZYDIS_MAX_OPERAND_COUNT entries that + receives the decoded operands. The number of operands decoded is + determined by the instruction.operand_count field. Excess entries are + zeroed. + + This is a convenience function that combines the following functions into one call: + - ZydisDecoderDecodeInstruction + - ZydisDecoderDecodeOperands + + Please refer to ZydisDecoderDecodeInstruction if operand decoding is not required or should + be done separately (ZydisDecoderDecodeOperands). + + This function is not available in MINIMAL_MODE. + + @return A zyan status code. +} + +function ZydisDecoderDecodeFull(const decoder: PZydisDecoder; const buffer: Pointer; + length: ZyanUSize; var instruction: TZydisDecodedInstruction; + operands: array of TZydisDecodedOperand): ZyanStatus; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisDecoderDecodeFull'; + + +{** + * Decodes the instruction in the given input `buffer`. + * + * @param decoder A pointer to the `ZydisDecoder` instance. + * @param context A pointer to a decoder context struct which is required for further + * decoding (e.g. operand decoding using `ZydisDecoderDecodeOperands`) or + * `ZYAN_NULL` if not needed. + * @param buffer A pointer to the input buffer. + * @param length The length of the input buffer. Note that this can be bigger than the + * actual size of the instruction -- you don't have to know the size up + * front. This length is merely used to prevent Zydis from doing + * out-of-bounds reads on your buffer. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct, that receives the + * details about the decoded instruction. + * + * @return A zyan status code. + *} +function ZydisDecoderDecodeInstruction(const decoder: PZydisDecoder; + context: PZydisDecoderContext; const buffer: Pointer; length: ZyanUSize; + instruction: PZydisDecodedInstruction): ZyanStatus; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisDecoderDecodeInstruction'; + + +{** + * Decodes the instruction operands. + * + * @param decoder A pointer to the `ZydisDecoder` instance. + * @param context A pointer to the `ZydisDecoderContext` struct. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. + * @param operands The array that receives the decoded operands. + * Refer to `ZYDIS_MAX_OPERAND_COUNT` or `ZYDIS_MAX_OPERAND_COUNT_VISIBLE` + * when allocating space for the array to ensure that the buffer size is + * sufficient to always fit all instruction operands. + * Refer to `instruction.operand_count` or + * `instruction.operand_count_visible' when allocating space for the array + * to ensure that the buffer size is sufficient to fit all operands of + * the given instruction. + * @param operand_count The length of the `operands` array. + * This argument as well limits the maximum amount of operands to decode. + * If this value is `0`, no operands will be decoded and `ZYAN_NULL` will + * be accepted for the `operands` argument. + * + * This function fails, if `operand_count` is larger than the total number of operands for the + * given instruction (`instruction.operand_count`). + * + * This function is not available in MINIMAL_MODE. + * + * @return A `ZyanStatus` code. + *} +function ZydisDecoderDecodeOperands(const decoder: PZydisDecoder; + const context: PZydisDecoderContext; const instruction: PZydisDecodedInstruction; + operands: PZydisDecodedOperand; operand_count: ZyanU8): ZyanStatus; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisDecoderDecodeOperands'; + +// -------------------------------------------------------------------------- *} +// Zydis Formatter APIs +// -------------------------------------------------------------------------- *} + +{ + Initializes the given ZydisFormatter instance. + + @param formatter A pointer to the ZydisFormatter instance. + @param style The base formatter style (either AT&T or Intel style). + + @return A zyan status code. +} +function ZydisFormatterInit(formatter: PZydisFormatter; style: TZydisFormatterStyle): ZyanStatus; cdecl;external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisFormatterInit'; + + { + * Formats the given instruction and writes it into the output buffer. + * + * @param formatter A pointer to the `ZydisFormatter` instance. + * @param instruction A pointer to the `ZydisDecodedInstruction` struct. + * @param operands A pointer to the decoded operands array. + * @param operand_count The length of the `operands` array. Must be equal to or greater than + * the value of `instruction^.operand_count_visible`. + * @param buffer A pointer to the output buffer. + * @param length The length of the output buffer (in characters). + * @param runtime_address The runtime address of the instruction or `ZYDIS_RUNTIME_ADDRESS_NONE` + * to print relative addresses. + * @param user_data A pointer to user-defined data which can be used in custom formatter + * callbacks. Can be `ZYAN_NULL`. + * + * @return A zyan status code. + *} + function ZydisFormatterFormatInstruction(const formatter: PZydisFormatter; + const instruction: PZydisDecodedInstruction; const operands: PZydisDecodedOperand; + operand_count: ZyanU8; buffer: PAnsiChar; length: ZyanUSize; + runtime_address: ZyanU64; user_data: Pointer): ZyanStatus; cdecl;external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisFormatterFormatInstruction'; + + +// -------------------------------------------------------------------------- *} +// Zydis Encoder APIs +// -------------------------------------------------------------------------- *} + +{ + Encodes instruction with semantics specified in encoder request structure. + + @param request A pointer to the `TZydisEncoderRequest` record. + @param buffer A pointer to the output buffer receiving the encoded instruction. + @param length A pointer to the variable containing the length of the output buffer. + Upon successful return, this variable receives the length of the encoded instruction. + + @return A Zyan status code. +} +function ZydisEncoderEncodeInstruction(const request: PZydisEncoderRequest; + buffer: Pointer; length: PZyanUSize): ZyanStatus; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisEncoderEncodeInstruction'; + + + +{$IfDef ZYDIS_LIBC} + // Zydis Memory APIs +{ + Returns the system page size. + + @return The system page size. +} +function ZyanMemoryGetSystemPageSize: ZyanU32; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZyanMemoryGetSystemPageSize'; + +{ + Returns the system allocation granularity. + + The system allocation granularity specifies the minimum amount of bytes which can be allocated + at a specific address by a single call of `ZyanMemoryVirtualAlloc`. + + This value is typically 64KiB on Windows systems and equal to the page size on most POSIX + platforms. + + @return The system allocation granularity. +} +function ZyanMemoryGetSystemAllocationGranularity: ZyanU32; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZyanMemoryGetSystemAllocationGranularity'; + +{ + Changes the memory protection value of one or more pages. + + @param address The start address aligned to a page boundary. + @param size The size. + @param protection The new page protection value. + + @return A Zyan status code. +} +function ZyanMemoryVirtualProtect(address: Pointer; size: ZyanUSize; + protection: TZyanMemoryPageProtection): ZyanStatus; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZyanMemoryVirtualProtect'; + +{ + Releases one or more memory pages starting at the given address. + + @param address The start address aligned to a page boundary. + @param size The size. + + @return A Zyan status code. +} +function ZyanMemoryVirtualFree(address: Pointer; size: ZyanUSize): ZyanStatus; cdecl; external + {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZyanMemoryVirtualFree'; + +{$EndIf} + + + + +// -------------------------------------------------------------------------- *} +// Zydis Version APIs *} +// -------------------------------------------------------------------------- *} + +function ZydisGetVersion: ZyanU64; cdecl; external {$IFDEF Z_DYN_LINK}Z_LIB_NAME{$ENDIF} + Name _PREFIX + 'ZydisGetVersion'; + +function ZydisVersionMajor(Version: ZyanU64): ZyanU16; inline; +function ZydisVersionMinor(Version: ZyanU64): ZyanU16; inline; +function ZydisVersionPatch(Version: ZyanU64): ZyanU16; inline; +function ZydisVersionBuild(Version: ZyanU64): ZyanU16; inline; + + +implementation + +{$IFDEF CPUX86} +function _memset(dest: Pointer; val: integer; Count: IntPtr): Pointer; cdecl; + {$ifdef FPC}public name _PREFIX + 'memset';{$endif} +begin + FillChar(dest^, Count, val); + Result := dest; +end; + +procedure _memcpy(destination: Pointer; const source: Pointer; num: NativeUInt); cdecl; +begin + Move(source^, destination^, num); +end; +{$ELSE} +function memset(dest: Pointer; val: integer; Count: IntPtr): Pointer; cdecl; + {$ifdef FPC}public name _PREFIX + 'memset';{$endif} +begin + FillChar(dest^, Count, val); + Result := dest; +end; +{$IFNDEF FPC} +procedure memcpy(destination: Pointer; const source: Pointer; num: NativeUInt); cdecl; +begin + Move(source^, destination^, num); +end; +{$ENDIF} +{$ENDIF} + +{$IFDEF CPUX86} +{$IFNDEF FPC} +procedure __allmul(); assembler; +asm + push ebx + + mov eax, dword ptr [esp + 8 + 4] + mov ecx, dword ptr [esp + 16 + 0] + mul ecx //eax has AHI, ecx has BLO, so AHI * BLO + mov ebx,eax //save result + + mov eax, dword ptr [esp + 8 + 0] + mul dword ptr [esp + 16 + 4] //ALO * BHI + add ebx,eax //ebx = ((ALO * BHI) + (AHI * BLO)) + + mov eax,dword ptr [esp + 8 + 0] //ecx = BLO + mul ecx //so edx:eax = ALO*BLO + add edx,ebx //now edx has all the LO*HI stuff + + pop ebx + + ret 16 // callee restores the stack +end; + +procedure __allshr(); assembler; +asm +// Handle shifts of 64 bits or more (if shifting 64 bits or more, the result +// depends only on the high order bit of edx). + + cmp cl,64 + jae @RETSIGN + +// Handle shifts of between 0 and 31 bits + + cmp cl, 32 + jae @MORE32 + shrd eax,edx,cl + sar edx,cl + ret + +// Handle shifts of between 32 and 63 bits + +@MORE32: + mov eax,edx + sar edx,31 + and cl,31 + sar eax,cl + ret + +// Return double precision 0 or -1, depending on the sign of edx + +@RETSIGN: + sar edx,31 + mov eax,edx + ret + ret +end; + +procedure __aullshr(); assembler; +asm + cmp cl,64 + jae @RETZERO + +// Handle shifts of between 0 and 31 bits + cmp cl, 32 + jae @MORE32 + shrd eax,edx,cl + shr edx,cl + ret + +// Handle shifts of between 32 and 63 bits + +@MORE32: + mov eax,edx + xor edx,edx + and cl,31 + shr eax,cl + ret + +// return 0 in edx:eax + +@RETZERO: + xor eax,eax + xor edx,edx + ret +end; +{$ENDIF} +{$ENDIF} + +// -------------------------------------------------------------------------- *} +// Zydis Version Utils Functions +// -------------------------------------------------------------------------- *} + +function ZydisVersionMajor(Version: ZyanU64): ZyanU16; +begin + Result := (Version and $FFFF000000000000) shr 48; +end; + +function ZydisVersionMinor(Version: ZyanU64): ZyanU16; +begin + Result := (Version and $0000FFFF00000000) shr 32; +end; + +function ZydisVersionPatch(Version: ZyanU64): ZyanU16; +begin + Result := (Version and $00000000FFFF0000) shr 16; +end; + +function ZydisVersionBuild(Version: ZyanU64): ZyanU16; +begin + Result := (Version and $000000000000FFFF); +end; + +end. diff --git a/Zydis/Zydis.Decoder.Types.pas b/Zydis/Zydis.Decoder.Types.pas new file mode 100644 index 0000000..1ffd72a --- /dev/null +++ b/Zydis/Zydis.Decoder.Types.pas @@ -0,0 +1,471 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} + +unit Zydis.Decoder.Types; + +{$IFDEF FPC} + {$mode Delphi} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types; + +type + // Defines the `ZydisOperandAttributes` data-type. + TZydisOperandAttributes = ZyanU8; + // Defines the `ZydisAccessedFlagsMask` data-type. + TZydisAccessedFlagsMask = ZyanU32; + +const + { + The operand is a `MULTISOURCE4` register operand. + + This is a special register operand-type used by `4FMAPS` instructions where the given register + points to the first register of a register range (4 registers in total). + + Example: ZMM3 -> [ZMM3..ZMM6] + } + ZYDIS_OATTRIB_IS_MULTISOURCE4 = $01; + + +type + // Information about CPU/FPU flags accessed by the instruction. + TZydisAccessedFlags = record + // As mask containing the flags `TESTED` by the instruction. + tested: TZydisAccessedFlagsMask; + // As mask containing the flags `MODIFIED` by the instruction. + modified: TZydisAccessedFlagsMask; + // As mask containing the flags `SET_0` by the instruction. + set_0: TZydisAccessedFlagsMask; + // As mask containing the flags `SET_1` by the instruction. + set_1: TZydisAccessedFlagsMask; + // As mask containing the flags `UNDEFINED` by the instruction. + undefined: TZydisAccessedFlagsMask; + end; // TZydisAccessedFlags + PZydisAccessedFlags = ^TZydisAccessedFlags; + + // Extended info for `AVX` instructions. + TZydisDecodedInstructionAvx = record + // The `AVX` vector-length. + vector_length: ZyanU16; + // Info about the embedded writemask-register (`AVX-512` and `KNC` only). + mask: record + // The masking mode. + mode: TZydisMaskMode; + // The mask register. + reg: TZydisRegister; + end; + // Contains info about the `AVX` broadcast. + broadcast: record + // Signals, if the broadcast is a static broadcast. + // This is the case for instructions with inbuilt broadcast functionality, which is + // always active and not controlled by the `EVEX/MVEX.RC` bits. + is_static: ZyanBool; + // The `AVX` broadcast-mode. + mode: TZydisBroadcastMode; + end; + // Contains info about the `AVX` rounding. + rounding: record + // The `AVX` rounding-mode. + mode: TZydisRoundingMode; + end; + // Contains info about the `AVX` register-swizzle (`KNC` only). + swizzle: record + // The `AVX` register-swizzle mode. + mode: TZydisSwizzleMode; + end; + // Contains info about the `AVX` data-conversion (`KNC` only). + conversion: record + // The `AVX` data-conversion mode. + mode: TZydisConversionMode; + end; + // Signals, if the `SAE` (suppress-all-exceptions) functionality is enabled for the instruction. + has_sae: ZyanBool; + // Signals, if the instruction has a memory-eviction-hint (`KNC` only). + has_eviction_hint: ZyanBool; + end; // TZydisDecodedInstructionAvx + PZydisDecodedInstructionAvx = ^TZydisDecodedInstructionAvx; + + // Instruction meta info. + TZydisDecodedInstructionMeta = record + // The instruction category. + category: TZydisInstructionCategory; + // The ISA-set. + isa_set: TZydisISASet; + // The ISA-set extension. + isa_ext: TZydisISAExt; + // The branch type. + branch_type: TZydisBranchType; + // The exception class. + exception_class: TZydisExceptionClass; + end; // TZydisDecodedInstructionMeta + PZydisDecodedInstructionMeta = ^TZydisDecodedInstructionMeta; + + // Detailed info about the `REX` prefix. + TZydisDecodedInstructionRawRex = record + // 64-bit operand-size promotion. + W: ZyanU8; + // Extension of the `ModRM.reg` field. + R: ZyanU8; + // Extension of the `SIB.index` field. + X: ZyanU8; + // Extension of the `ModRM.rm`, `SIB.base`, or `opcode.reg` field. + B: ZyanU8; + // The offset of the effective `REX` byte, relative to the beginning of the instruction, in bytes. + offset: ZyanU8; + end; // TZydisDecodedInstructionRawRex + PZydisDecodedInstructionRawRex = ^TZydisDecodedInstructionRawRex; + + // Detailed info about the `XOP` prefix. + TZydisDecodedInstructionRawXop = record + // Extension of the `ModRM.reg` field (inverted). + R: ZyanU8; + // Extension of the `SIB.index` field (inverted). + X: ZyanU8; + // Extension of the `ModRM.rm`, `SIB.base`, or `opcode.reg` field (inverted). + B: ZyanU8; + // Opcode-map specifier. + m_mmmm: ZyanU8; + // 64-bit operand-size promotion or opcode-extension. + W: ZyanU8; + // `NDS`/`NDD` (non-destructive-source/destination) register specifier (inverted). + vvvv: ZyanU8; + // Vector-length specifier. + L: ZyanU8; + // Compressed legacy prefix. + pp: ZyanU8; + // The offset of the first xop byte, relative to the beginning of the instruction, in bytes. + offset: ZyanU8; + end; // TZydisDecodedInstructionRawXop + PZydisDecodedInstructionRawXop = ^TZydisDecodedInstructionRawXop; + + // Detailed info about the `VEX` prefix. + TZydisDecodedInstructionRawVex = record + R: ZyanU8; // Extension of the `ModRM.reg` field (inverted). + X: ZyanU8; // Extension of the `SIB.index` field (inverted). + B: ZyanU8; // Extension of the `ModRM.rm`, `SIB.base`, or `opcode.reg` field (inverted). + m_mmmm: ZyanU8; // Opcode-map specifier. + W: ZyanU8; // 64-bit operand-size promotion or opcode-extension. + vvvv: ZyanU8; + // `NDS`/`NDD` (non-destructive-source/destination) register specifier (inverted). + L: ZyanU8; // Vector-length specifier. + pp: ZyanU8; // Compressed legacy prefix. + offset: ZyanU8; + // The offset of the first `VEX` byte, relative to the beginning of the instruction, in bytes. + size: ZyanU8; // The size of the `VEX` prefix, in bytes. + end; // TZydisDecodedInstructionRawVex + PZydisDecodedInstructionRawVex = ^TZydisDecodedInstructionRawVex; + + // Detailed info about the `EVEX` prefix. + TZydisDecodedInstructionRawEvex = record + R: ZyanU8; // Extension of the `ModRM.reg` field (inverted). + X: ZyanU8; // Extension of the `SIB.index/vidx` field (inverted). + ExtB: ZyanU8; // Extension of the `ModRM.rm` or `SIB.base` field (inverted). + R2: ZyanU8; // High-16 register specifier modifier (inverted). + mmm: ZyanU8; // Opcode-map specifier. + W: ZyanU8; // 64-bit operand-size promotion or opcode-extension. + vvvv: ZyanU8; + // `NDS`/`NDD` (non-destructive-source/destination) register specifier (inverted). + pp: ZyanU8; // Compressed legacy prefix. + z: ZyanU8; // Zeroing/Merging. + L2: ZyanU8; // Vector-length specifier or rounding-control (most significant bit). + L: ZyanU8; // Vector-length specifier or rounding-control (least significant bit). + BroadcastContext: ZyanU8; // Broadcast/RC/SAE context. + V2: ZyanU8; // High-16 `NDS`/`VIDX` register specifier. + aaa: ZyanU8; // Embedded opmask register specifier. + offset: ZyanU8; + // The offset of the first evex byte, relative to the beginning of the instruction, in bytes. + end; + PZydisDecodedInstructionRawEvex = ^TZydisDecodedInstructionRawEvex; + + // Detailed info about the `MVEX` prefix. + TZydisDecodedInstructionRawMvex = record + // Extension of the `ModRM.reg` field (inverted). + R: ZyanU8; + // Extension of the `SIB.index/vidx` field (inverted). + X: ZyanU8; + // Extension of the `ModRM.rm` or `SIB.base` field (inverted). + B: ZyanU8; + // High-16 register specifier modifier (inverted). + R2: ZyanU8; + // Opcode-map specifier. + mmmm: ZyanU8; + // 64-bit operand-size promotion or opcode-extension. + W: ZyanU8; + // `NDS`/`NDD` (non-destructive-source/destination) register specifier (inverted). + vvvv: ZyanU8; + // Compressed legacy prefix. + pp: ZyanU8; + // Non-temporal/eviction hint. + E: ZyanU8; + // Swizzle/broadcast/up-convert/down-convert/static-rounding controls. + SSS: ZyanU8; + // High-16 `NDS`/`VIDX` register specifier. + V2: ZyanU8; + // Embedded opmask register specifier. + kkk: ZyanU8; + // The offset of the first mvex byte, relative to the beginning of the instruction, in bytes. + offset: ZyanU8; + end; // TZydisDecodedInstructionRawMvex + PZydisDecodedInstructionRawMvex = ^TZydisDecodedInstructionRawMvex; + + + // Detailed info about different instruction-parts like `ModRM`, `SIB`, or encoding-prefixes. + TZydisDecodedInstructionRaw = record + prefix_count: ZyanU8; // The number of legacy prefixes. + prefixes: array [0..ZYDIS_MAX_INSTRUCTION_LENGTH - 1] of record + type_: TZydisPrefixType; // The prefix type. + Value: ZyanU8; // The prefix byte. + end; + + encoding2: TZydisInstructionEncoding; // Copy of the `encoding` field. + + union : record + case integer of + 0: (rex: TZydisDecodedInstructionRawRex); + 1: (xop: TZydisDecodedInstructionRawXop); + 2: (vex: TZydisDecodedInstructionRawVex); + 3: (evex: TZydisDecodedInstructionRawEvex); + 4: (mvex: TZydisDecodedInstructionRawMvex); + end; + + // Detailed info about the `ModRM` byte. + modrm: record + mod_: ZyanU8; // The addressing mode. + reg: ZyanU8; // Register specifier or opcode-extension. + rm: ZyanU8; // Register specifier or opcode-extension. + offset: ZyanU8; // The offset of the `ModRM` byte, relative to the beginning of the instruction, in bytes. + end; + // Detailed info about the `SIB` byte. + sib: record + scale: ZyanU8; // The scale factor. + index: ZyanU8; // The index-register specifier. + base: ZyanU8; // The base-register specifier. + offset: ZyanU8; // The offset of the `SIB` byte, relative to the beginning of the instruction, in bytes. + end; + // Detailed info about displacement-bytes. + disp: record + Value: ZyanI64; // The displacement value + size: ZyanU8; // The physical displacement size, in bits. + offset: ZyanU8; // The offset of the displacement data, relative to the beginning of the instruction, in bytes. + end; + + imm: array [0..1] of record + is_signed: ZyanBool; // Signals if the immediate value is signed. + is_relative: ZyanBool; // Signals if the immediate value contains a relative offset. You can use + // `ZydisCalcAbsoluteAddress` to determine the absolute address value. + value: record + case Integer of + 0: (u: ZyanU64); + 1: (s: ZyanI64); + end; + size: ZyanU8; // The physical immediate size, in bits. + offset: ZyanU8; // The offset of the immediate data, relative to the beginning of the instruction, in bytes. + end; + // Detailed info about immediate-bytes. + end; + PZydisDecodedInstructionRaw = ^TZydisDecodedInstructionRaw; + + + //../zydis/include/Zydis/DecoderTypes.h + // Information about a decoded instruction. + TZydisDecodedInstruction = record + // The machine mode used to decode this instruction. + machine_mode: TZydisMachineMode; + // The instruction-mnemonic. + mnemonic: TZydisMnemonic; + // The length of the decoded instruction. + length: ZyanU8; + // The instruction-encoding (`LEGACY`, `3DNOW`, `VEX`, `EVEX`, `XOP`). + encoding: TZydisInstructionEncoding; + // The opcode-map. + opcode_map: TZydisOpcodeMap; + // The instruction-opcode. + opcode: ZyanU8; + // The stack width. + stack_width: ZyanU8; + // The effective operand width. + operand_width: ZyanU8; + // The effective address width. + address_width: ZyanU8; + // The number of instruction-operands. + operand_count: ZyanU8; + // The number of explicit (visible) instruction-operands. + operand_count_visible: ZyanU8; + // See instruction_attributes. + attributes: TZydisInstructionAttributes; + // Information about CPU flags accessed by the instruction. + cpu_flags: PZydisAccessedFlags; + // Information about FPU flags accessed by the instruction. + fpu_flags: PZydisAccessedFlags; + // Extended info for `AVX` instructions. + avx: TZydisDecodedInstructionAvx; + // Meta info. + meta: TZydisDecodedInstructionMeta; + // Detailed info about different instruction-parts like `ModRM`, `SIB` or encoding-prefixes. + raw: TZydisDecodedInstructionRaw; + end; // TZydisDecodedInstruction + PZydisDecodedInstruction = ^TZydisDecodedInstruction; + + // Extended info for register-operands. + TZydisDecodedOperandReg = record + value : TZydisRegister; // The register value. + end; // TZydisDecodedOperandReg + PZydisDecodedOperandReg = ^TZydisDecodedOperandReg; + + // Extended info for memory-operands. + TZydisDecodedOperandMem = record + type_ : TZydisMemoryOperandType; // The type of the memory operand. + segment : TZydisRegister; // The segment register. + base : TZydisRegister; // The base register. + index : TZydisRegister; // The index register. + scale : ZyanU8; // The scale factor. + // Extended info for memory-operands with displacement. + disp : record + has_displacement : ZyanBool; + value : ZyanI64; + end; + end; // TZydisDecodedOperandMem + PZydisDecodedOperandMem = ^TZydisDecodedOperandMem; + + // Extended info for pointer-operands. + TZydisDecodedOperandPtr = record + segment : ZyanU16; + offset : ZyanU32; + end; // TZydisDecodedOperandPtr + PZydisDecodedOperandPtr = ^TZydisDecodedOperandPtr; + + TZydisDecodedOperandImm = record + is_signed: ZyanBool; // Signals if the immediate value is signed. + is_relative: ZyanBool; // Signals if the immediate value contains a relative offset. You can use + // ZydisCalcAbsoluteAddress to determine the absolute address value. + value: record + case Integer of + 0: (u: ZyanU64); + 1: (s: ZyanI64); + end; + end; + PZydisDecodedOperandImm = ^TZydisDecodedOperandImm; + + // Defines the `ZydisDecodedOperand` struct. + TZydisDecodedOperand = record + id: ZyanU8; // The operand-id. + visibility: TZydisOperandVisibility; // The visibility of the operand. + actions: TZydisOperandActions; // The operand-actions. + encoding: TZydisOperandEncoding; // The operand-encoding. + size: ZyanU16; // The logical size of the operand (in bits). + element_type: TZydisElementType; // The element-type. + element_size: TZydisElementSize; // The size of a single element. + element_count: ZyanU16; // The number of elements. + attributes: TZydisOperandAttributes; // Additional operand attributes. + type_: TZydisOperandType; // The type of the operand. + + // These will correspond to the union members + union : record + case integer of + 0: (reg: TZydisDecodedOperandReg); + 1: (mem: TZydisDecodedOperandMem); + 2: (ptr: TZydisDecodedOperandPtr); + 3: (imm: TZydisDecodedOperandImm); + end; + end; + PZydisDecodedOperand = ^TZydisDecodedOperand; + + + // Defines the `ZydisDecoder` struct. + TZydisDecoder = record + machine_mode : TZydisMachineMode; // The machine mode. + stack_width : TZydisStackWidth; // The stack width. + decoder_mode : ZyanU32; // The decoder mode bitmap. + end; // TZydisDecoder + PZydisDecoder = ^TZydisDecoder; + + + TZydisDecoderContext = record + // A pointer to the internal instruction definition. + definition: Pointer; + // Contains the effective operand-size index. + // 0 = 16 bit, 1 = 32 bit, 2 = 64 bit + eosz_index: ZyanU8; + // Contains the effective address-size index. + // 0 = 16 bit, 1 = 32 bit, 2 = 64 bit + easz_index: ZyanU8; + // Contains some cached REX/XOP/VEX/EVEX/MVEX values to provide uniform access. + vector_unified: record + W: ZyanU8; + R: ZyanU8; + X: ZyanU8; + B: ZyanU8; + L: ZyanU8; + LL: ZyanU8; + R2: ZyanU8; + V2: ZyanU8; + vvvv: ZyanU8; + mask: ZyanU8; + end; + // Information about encoded operand registers. + reg_info: record + // Signals if the `modrm.mod == 3` or `reg` form is forced for the instruction. + is_mod_reg: ZyanBool; + // The final register id for the `reg` encoded register. + id_reg: ZyanU8; + // The final register id for the `rm` encoded register. + // This value is only set, if a register is encoded in `modrm.rm`. + id_rm: ZyanU8; + // The final register id for the `ndsndd` (`.vvvv`) encoded register. + id_ndsndd: ZyanU8; + // The final register id for the base register. + // This value is only set, if a memory operand is encoded in `modrm.rm`. + id_base: ZyanU8; + // The final register id for the index register. + // This value is only set, if a memory operand is encoded in `modrm.rm` and the `SIB` byte is present. + id_index: ZyanU8; + end; + // Internal EVEX-specific information. + evex: record + // The EVEX tuple-type. + tuple_type: ZyanU8; + // The EVEX element-size. + element_size: ZyanU8; + end; + // Internal MVEX-specific information. + mvex: record + // The MVEX functionality. + functionality: ZyanU8; + end; + // The scale factor for EVEX/MVEX compressed 8-bit displacement values. + cd8_scale: ZyanU8; // TODO: Could make sense to expose this in the ZydisDecodedInstruction + end; + PZydisDecoderContext = TZydisDecoderContext; + +implementation + +end. + + + diff --git a/Zydis/Zydis.Decoder.pas b/Zydis/Zydis.Decoder.pas index 6c801fe..f0bfb4c 100644 --- a/Zydis/Zydis.Decoder.pas +++ b/Zydis/Zydis.Decoder.pas @@ -1,8 +1,6 @@ -{*************************************************************************************************** +{******************************************************************************* - Zydis Top Level API - - Original Author : Florian Bernd + Zydis Pascal API By Coldzer0 * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,59 +20,24 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. -***************************************************************************************************} - +*******************************************************************************} +{ + This unit will contain the high-level implementation for Disassembler +} unit Zydis.Decoder; -interface - {$IFDEF FPC} - {$MODE DELPHI} + {$mode Delphi}{$H+} + {$PackRecords C} {$ENDIF} -uses - {$IFNDEF FPC}System.SysUtils{$ELSE}SysUtils{$ENDIF}, Zydis, Zydis.Exception; +interface -type - TZydisDecoder = class sealed(TObject) - strict private - FContext: Zydis.TZydisDecoder; - public - procedure EnableMode(Mode: TZydisDecoderMode; Enabled: Boolean); inline; - procedure DecodeBuffer(const Buffer: Pointer; Length: ZydisUSize; InstructionPointer: ZydisU64; - var Instruction: TZydisDecodedInstruction); inline; - public - constructor Create(MachineMode: TZydisMachineMode; AddressWidth: TZydisAddressWidth); - end; +uses + Zydis.Enums, + Zydis.Types; implementation -{ TZydisDecoder } - -constructor TZydisDecoder.Create(MachineMode: TZydisMachineMode; AddressWidth: TZydisAddressWidth); -var - Status: TZydisStatus; -begin - inherited Create; - Status := ZydisDecoderInit(FContext, MachineMode, AddressWidth); - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); -end; - -procedure TZydisDecoder.DecodeBuffer(const Buffer: Pointer; Length: ZydisUSize; - InstructionPointer: ZydisU64; var Instruction: TZydisDecodedInstruction); -var - Status: TZydisStatus; -begin - Status := ZydisDecoderDecodeBuffer(@FContext, Buffer, Length, InstructionPointer, Instruction); - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); -end; - -procedure TZydisDecoder.EnableMode(Mode: TZydisDecoderMode; Enabled: Boolean); -var - Status: TZydisStatus; -begin - Status := ZydisDecoderEnableMode(FContext, Mode, Enabled); - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); -end; - end. + diff --git a/Zydis/Zydis.Disassembler.Types.pas b/Zydis/Zydis.Disassembler.Types.pas new file mode 100644 index 0000000..5986097 --- /dev/null +++ b/Zydis/Zydis.Disassembler.Types.pas @@ -0,0 +1,54 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} +unit Zydis.Disassembler.Types; + +{$IFDEF FPC} + {$mode Delphi} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Types, + Zydis.Decoder.Types; + +type + { + All commonly used information about a decoded instruction that Zydis can provide. + This structure is filled in by calling `ZydisDisassembleIntel` or `ZydisDisassembleATT`. + } + TZydisDisassembledInstruction = record + // The runtime address that was passed when disassembling the instruction. + runtime_address : ZyanU64; + info : TZydisDecodedInstruction; + operands : Array [1..ZYDIS_MAX_OPERAND_COUNT] of TZydisDecodedOperand; + text : Array [1..96] of Byte; + end; + PZydisDisassembledInstruction = ^TZydisDisassembledInstruction; + +implementation + +end. + diff --git a/Zydis/Zydis.Encoder.Types.pas b/Zydis/Zydis.Encoder.Types.pas new file mode 100644 index 0000000..30d739b --- /dev/null +++ b/Zydis/Zydis.Encoder.Types.pas @@ -0,0 +1,138 @@ +unit Zydis.Encoder.Types; + +{$IFDEF FPC} + {$mode Delphi} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types, + Zydis.Status; + +const + // Maximum number of encodable (explicit and implicit) operands + ZYDIS_ENCODER_MAX_OPERANDS = 5; + + // Describes explicit or implicit instruction operand. +type + TZydisEncoderOperand = record + // The type of the operand. + type_: TZydisOperandType; + // Extended info for register-operands. + reg: record + // The register value. + Value: TZydisRegister; + // Is this the 4th operand (`VEX`/`XOP`). Despite its name, `is4` encoding can sometimes be + // applied to the 3rd operand instead of the 4th. This field is used to resolve such ambiguities. + // For all other operands, it should be set to `ZYAN_FALSE`. + is4: ZyanBool; + end; + // Extended info for memory-operands. + mem: record + // The base register. + base: TZydisRegister; + // The index register. + index: TZydisRegister; + // The scale factor. + scale: ZyanU8; + // The displacement value. + displacement: ZyanI64; + // Size of this operand in bytes. + size: ZyanU16; + end; + // Extended info for pointer-operands. + ptr: record + // The segment value. + segment: ZyanU16; + // The offset value. + offset: ZyanU32; + end; + // Extended info for immediate-operands. + imm: record + case Integer of + 0: (u: ZyanU64); + 1: (s: ZyanI64); + end; + end; + PZydisEncoderOperand = ^TZydisEncoderOperand; + + // Main structure consumed by the encoder. It represents full semantics of an instruction. +type + TZydisEncoderRequest = record + // The machine mode used to encode this instruction. + machine_mode: TZydisMachineMode; + // This optional field can be used to restrict allowed physical encodings for desired + // instruction. Some mnemonics can be supported by more than one encoding, so this field can + // resolve ambiguities, e.g., you can disable `AVX-512` extensions by prohibiting the usage of `EVEX` + // prefix and allow only `VEX` variants. + allowed_encodings: TZydisEncodableEncoding; + // The instruction-mnemonic. + mnemonic: TZydisMnemonic; + // A combination of requested encodable prefixes (`ZYDIS_ATTRIB_HAS_*` flags) for desired + // instruction. See `ZYDIS_ENCODABLE_PREFIXES` for a list of available prefixes. + prefixes: TZydisInstructionAttributes; + // Branch type (required for branching instructions only). Use `ZYDIS_BRANCH_TYPE_NONE` to let + // encoder pick size-optimal branch type automatically (`short` and `near` are prioritized over + // `far`). + branch_type: TZydisBranchType; + // Specifies physical size for relative immediate operands. Use `ZYDIS_BRANCH_WIDTH_NONE` to + // let encoder pick size-optimal branch width automatically. For segment:offset `far` branches, + // this field applies to the physical size of the offset part. For branching instructions without + // relative operands, this field affects the effective operand size attribute. + branch_width: TZydisBranchWidth; + // Optional address size hint used to resolve ambiguities for some instructions. Generally, + // encoder deduces the address size from `TZydisEncoderOperand` structures that represent + // explicit and implicit operands. This hint resolves conflicts when the instruction's hidden + // operands scale with the address size attribute. + address_size_hint: TZydisAddressSizeHint; + // Optional operand size hint used to resolve ambiguities for some instructions. Generally, + // encoder deduces operand size from `TZydisEncoderOperand` structures that represent + // explicit and implicit operands. This hint resolves conflicts when the instruction's hidden + // operands scale with operand size attribute. + operand_size_hint: TZydisOperandSizeHint; + // The number of visible (explicit) instruction operands. + + // The encoder does not care about hidden (implicit) operands. + operand_count: ZyanU8; + // Detailed info for all explicit and implicit instruction operands. + operands: array[0..ZYDIS_ENCODER_MAX_OPERANDS - 1] of TZydisEncoderOperand; + // Extended info for `EVEX` instructions. + evex: record + // The broadcast-mode. Specify `ZYDIS_BROADCAST_MODE_INVALID` for instructions with + // static broadcast functionality. + broadcast: TZydisBroadcastMode; + // The rounding-mode. + rounding: TZydisRoundingMode; + // Signals, if the `SAE` (suppress-all-exceptions) functionality should be enabled for + // the instruction. + sae: ZyanBool; + // Signals, if the zeroing-mask functionality should be enabled for the instruction. + // Specify `ZYAN_TRUE` for instructions with a forced zeroing mask. + zeroing_mask: ZyanBool; + end; + // Extended info for `MVEX` instructions. + mvex: record + // The broadcast-mode. + broadcast: TZydisBroadcastMode; + // The data-conversion mode. + conversion: TZydisConversionMode; + // The rounding-mode. + rounding: TZydisRoundingMode; + // The `AVX` register-swizzle mode. + swizzle: TZydisSwizzleMode; + // Signals, if the `SAE` (suppress-all-exceptions) functionality is enabled for + // the instruction. + sae: ZyanBool; + // Signals, if the instruction has a memory-eviction-hint (`KNC` only). + eviction_hint: ZyanBool; + end; + end; + PZydisEncoderRequest = ^TZydisEncoderRequest; + + +implementation + +end. diff --git a/Zydis/Zydis.Encoder.pas b/Zydis/Zydis.Encoder.pas new file mode 100644 index 0000000..e4a4272 --- /dev/null +++ b/Zydis/Zydis.Encoder.pas @@ -0,0 +1,44 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} +{ + This unit will contain the high-level implementation for Encoder +} +unit Zydis.Encoder; + +{$IFDEF FPC} + {$mode Delphi} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types, + Zydis.Encoder.Types; + +implementation + +end. + diff --git a/Zydis/Zydis.Enums.pas b/Zydis/Zydis.Enums.pas new file mode 100644 index 0000000..a825e6f --- /dev/null +++ b/Zydis/Zydis.Enums.pas @@ -0,0 +1,69 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} + +unit Zydis.Enums; + +{$IfDef FPC} + {$mode delphi} + {$PackRecords C} + {$PACKENUM 4} + {$WARN 3031 off : Values in enumeration types have to be ascending} +{$ELSE} + {$MinEnumSize 4} + {$Z4} +{$ENDIF} + +interface +uses + {$IfDef UNIX} + BaseUnix + {$Else} + Windows + {$EndIf}; + +{$I Generated/zydis_enums.inc} + +{ + Defines the `TZyanMemoryPageProtection` enum. +} +type + TZyanMemoryPageProtection = ( + {$IFDEF MSWINDOWS} + ZYAN_PAGE_READONLY = PAGE_READONLY, + ZYAN_PAGE_READWRITE = PAGE_READWRITE, + ZYAN_PAGE_EXECUTE = PAGE_EXECUTE, + ZYAN_PAGE_EXECUTE_READ = PAGE_EXECUTE_READ, + ZYAN_PAGE_EXECUTE_READWRITE = PAGE_EXECUTE_READWRITE + {$ENDIF} + {$IFDEF UNIX} + ZYAN_PAGE_READONLY = PROT_READ, + ZYAN_PAGE_READWRITE = PROT_READ or PROT_WRITE, + ZYAN_PAGE_EXECUTE = PROT_EXEC, + ZYAN_PAGE_EXECUTE_READ = PROT_EXEC or PROT_READ, + ZYAN_PAGE_EXECUTE_READWRITE = PROT_EXEC or PROT_READ or PROT_WRITE + {$ENDIF} + ); + +implementation +end. diff --git a/Zydis/Zydis.Formatter.Types.pas b/Zydis/Zydis.Formatter.Types.pas new file mode 100644 index 0000000..c234313 --- /dev/null +++ b/Zydis/Zydis.Formatter.Types.pas @@ -0,0 +1,243 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} +unit Zydis.Formatter.Types; + +{$IFDEF FPC} + {$MODE DELPHI} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.Enums, + Zydis.Types, + Zycore.Strings, + Zycore.FormatterBuffer, + Zydis.Decoder.Types; + +type + PZydisFormatter = ^TZydisFormatter; + + + { Defines the ZydisFormatterContext struct. } + TZydisFormatterContext = record + { A pointer to the ZydisDecodedInstruction struct. } + instruction: PZydisDecodedInstruction; + { A pointer to the first ZydisDecodedOperand struct of the instruction. } + operands: PZydisDecodedOperand; + { A pointer to the ZydisDecodedOperand struct. } + operand: PZydisDecodedOperand; + { The runtime address of the instruction. } + runtime_address: ZyanU64; + { A pointer to user-defined data. + + This is the value that was previously passed as the user_data argument to + ZydisFormatterFormatInstruction or ZydisFormatterTokenizeOperand. + } + user_data: Pointer; + end; + PZydisFormatterContext = ^TZydisFormatterContext; + + { Defines the ZydisFormatterFunc function prototype. + + @param formatter A pointer to the ZydisFormatter instance. + @param buffer A pointer to the ZydisFormatterBuffer struct. + @param context A pointer to the ZydisFormatterContext struct. + + @return A zyan status code. + + Returning a status code other than ZYAN_STATUS_SUCCESS will immediately cause the formatting + process to fail (see exceptions below). + + Returning ZYDIS_STATUS_SKIP_TOKEN is valid for functions of the following types and will + instruct the formatter to omit the whole operand: + - ZYDIS_FORMATTER_FUNC_PRE_OPERAND + - ZYDIS_FORMATTER_FUNC_POST_OPERAND + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM + + This function prototype is used by functions of the following types: + - ZYDIS_FORMATTER_FUNC_PRE_INSTRUCTION + - ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION + - ZYDIS_FORMATTER_FUNC_PRE_OPERAND + - ZYDIS_FORMATTER_FUNC_POST_OPERAND + - ZYDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION + - ZYDIS_FORMATTER_FUNC_PRINT_MNEMONIC + - ZYDIS_FORMATTER_FUNC_PRINT_PREFIXES + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR + - ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM + - ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS + - ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL + - ZYDIS_FORMATTER_FUNC_PRINT_DISP + - ZYDIS_FORMATTER_FUNC_PRINT_IMM + - ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST + - ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT + } + TZydisFormatterFunc = function(const formatter: PZydisFormatter; buffer: PZydisFormatterBuffer; + context: PZydisFormatterContext): ZyanStatus; cdecl; + + { Defines the ZydisFormatterRegisterFunc function prototype. + + @param formatter A pointer to the ZydisFormatter instance. + @param buffer A pointer to the ZydisFormatterBuffer struct. + @param context A pointer to the ZydisFormatterContext struct. + @param reg The register. + + @return Returning a status code other than ZYAN_STATUS_SUCCESS will immediately cause the + formatting process to fail. + } + TZydisFormatterRegisterFunc = function(const formatter: PZydisFormatter; buffer: PZydisFormatterBuffer; + context: PZydisFormatterContext; reg: TZydisRegister): ZyanStatus; cdecl; + + { Defines the ZydisFormatterDecoratorFunc function prototype. + + @param formatter A pointer to the ZydisFormatter instance. + @param buffer A pointer to the ZydisFormatterBuffer struct. + @param context A pointer to the ZydisFormatterContext struct. + @param decorator The decorator type. + + @return Returning a status code other than ZYAN_STATUS_SUCCESS will immediately cause the + formatting process to fail. + + This function type is used for: + - ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR + } + TZydisFormatterDecoratorFunc = function(const formatter: PZydisFormatter; buffer: PZydisFormatterBuffer; + context: PZydisFormatterContext; decorator: TZydisDecorator): ZyanStatus; cdecl; + + + { Context structure keeping track of internal state of the formatter. } + TZydisFormatter = record + { The formatter style. } + style: TZydisFormatterStyle; + { The ZYDIS_FORMATTER_PROP_FORCE_SIZE property. } + force_memory_size: ZyanBool; + { The ZYDIS_FORMATTER_PROP_FORCE_SEGMENT property. } + force_memory_segment: ZyanBool; + { The ZYDIS_FORMATTER_PROP_FORCE_SCALE_ONE property. } + force_memory_scale: ZyanBool; + { The ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_BRANCHES property. } + force_relative_branches: ZyanBool; + { The ZYDIS_FORMATTER_PROP_FORCE_RELATIVE_RIPREL property. } + force_relative_riprel: ZyanBool; + { The ZYDIS_FORMATTER_PROP_PRINT_BRANCH_SIZE property. } + print_branch_size: ZyanBool; + { The ZYDIS_FORMATTER_PROP_DETAILED_PREFIXES property. } + detailed_prefixes: ZyanBool; + { The ZYDIS_FORMATTER_PROP_ADDR_BASE property. } + addr_base: TZydisNumericBase; + { The ZYDIS_FORMATTER_PROP_ADDR_SIGNEDNESS property. } + addr_signedness: TZydisSignedness; + { The ZYDIS_FORMATTER_PROP_ADDR_PADDING_ABSOLUTE property. } + addr_padding_absolute: TZydisPadding; + { The ZYDIS_FORMATTER_PROP_ADDR_PADDING_RELATIVE property. } + addr_padding_relative: TZydisPadding; + { The ZYDIS_FORMATTER_PROP_DISP_BASE property. } + disp_base: TZydisNumericBase; + { The ZYDIS_FORMATTER_PROP_DISP_SIGNEDNESS property. } + disp_signedness: TZydisSignedness; + { The ZYDIS_FORMATTER_PROP_DISP_PADDING property. } + disp_padding: TZydisPadding; + { The ZYDIS_FORMATTER_PROP_IMM_BASE property. } + imm_base: TZydisNumericBase; + { The ZYDIS_FORMATTER_PROP_IMM_SIGNEDNESS property. } + imm_signedness: TZydisSignedness; + { The ZYDIS_FORMATTER_PROP_IMM_PADDING property. } + imm_padding: TZydisPadding; + { The ZYDIS_FORMATTER_PROP_UPPERCASE_PREFIXES property. } + case_prefixes: ZyanI32; + { The ZYDIS_FORMATTER_PROP_UPPERCASE_MNEMONIC property. } + case_mnemonic: ZyanI32; + { The ZYDIS_FORMATTER_PROP_UPPERCASE_REGISTERS property. } + case_registers: ZyanI32; + { The ZYDIS_FORMATTER_PROP_UPPERCASE_TYPECASTS property. } + case_typecasts: ZyanI32; + { The ZYDIS_FORMATTER_PROP_UPPERCASE_DECORATORS property. } + case_decorators: ZyanI32; + { The ZYDIS_FORMATTER_PROP_HEX_UPPERCASE property. } + hex_uppercase: ZyanBool; + { The ZYDIS_FORMATTER_PROP_HEX_FORCE_LEADING_NUMBER property. } + hex_force_leading_number: ZyanBool; + + { The number formats for all numeric bases. } + { Index 0 = prefix } + { Index 1 = suffix } + number_format: array[0..Ord(ZYDIS_NUMERIC_BASE_MAX_VALUE) + 1, 0..1] of record + { A pointer to the ZyanStringView to use as prefix/suffix. } + string_: PZyanStringView; + { The ZyanStringView to use as prefix/suffix. } + string_data: TZyanStringView; + { The actual string data. } + buffer: array[0..10] of Char; + end; + + { The ZYDIS_FORMATTER_FUNC_PRE_INSTRUCTION function. } + func_pre_instruction: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_POST_INSTRUCTION function. } + func_post_instruction: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_FORMAT_INSTRUCTION function. } + func_format_instruction: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRE_OPERAND function. } + func_pre_operand: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_POST_OPERAND function. } + func_post_operand: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_REG function. } + func_format_operand_reg: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_MEM function. } + func_format_operand_mem: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_PTR function. } + func_format_operand_ptr: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_FORMAT_OPERAND_IMM function. } + func_format_operand_imm: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_MNEMONIC function. } + func_print_mnemonic: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_REGISTER function. } + func_print_register: TZydisFormatterRegisterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_ABS function. } + func_print_address_abs: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_ADDRESS_REL function. } + func_print_address_rel: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_DISP function. } + func_print_disp: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_IMM function. } + func_print_imm: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_TYPECAST function. } + func_print_typecast: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_SEGMENT function. } + func_print_segment: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_PREFIXES function. } + func_print_prefixes: TZydisFormatterFunc; + { The ZYDIS_FORMATTER_FUNC_PRINT_DECORATOR function. } + func_print_decorator: TZydisFormatterDecoratorFunc; + end; + +implementation + +end. + diff --git a/Zydis/Zydis.Formatter.pas b/Zydis/Zydis.Formatter.pas index 2a21b10..2c4b409 100644 --- a/Zydis/Zydis.Formatter.pas +++ b/Zydis/Zydis.Formatter.pas @@ -1,8 +1,6 @@ -{*************************************************************************************************** +{******************************************************************************* - Zydis Top Level API - - Original Author : Florian Bernd + Zydis Pascal API By Coldzer0 * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -22,591 +20,27 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. -***************************************************************************************************} - +*******************************************************************************} +{ + This unit will contain the high-level implementation for Formatter +} unit Zydis.Formatter; -interface - {$IFDEF FPC} {$MODE DELPHI} + {$PackRecords C} {$ENDIF} -uses - {$IFNDEF FPC}System.SysUtils{$ELSE}SysUtils{$ENDIF}, Zydis, Zydis.Exception; +interface -type - TZydisFormatter = class(TObject) - strict private - class var Callbacks: array[TZydisFormatterHookType] of Pointer; - strict private - FContext: Zydis.TZydisFormatter; - FHexPrefix: AnsiString; - FHexSuffix: AnsiString; - strict private - procedure SetProperty(&Property: TZydisFormatterProperty; Value: ZydisUPointer); inline; - procedure SetUppercase(Value: ZydisBool); inline; - procedure SetForceMemorySegments(Value: ZydisBool); inline; - procedure SetForceMemorySize(Value: ZydisBool); inline; - procedure SetAddressFormat(Value: TZydisAddressFormat); inline; - procedure SetDisplacementFormat(Value: TZydisDisplacementFormat); inline; - procedure SetImmediateFormat(Value: TZydisImmediateFormat); inline; - procedure SetHexUppercase(Value: ZydisBool); inline; - procedure SetHexPrefix(const Value: AnsiString); inline; - procedure SetHexSuffix(const Value: AnsiString); inline; - procedure SetHexPaddingAddress(const Value: ZydisU8); inline; - procedure SetHexPaddingDisplacement(const Value: ZydisU8); inline; - procedure SetHexPaddingImmediate(const Value: ZydisU8); inline; - strict private - class function InternalPreInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPostInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPreOperand(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPostOperand(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalFormatInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalFormatOperandReg(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalFormatOperandMem(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalFormatOperandPtr(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalFormatOperandImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintMnemonic(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintRegister(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Reg: TZydisRegister; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintAddress(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Address: ZydisU64; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintDisp(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintMemSize(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintPrefixes(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - class function InternalPrintDecorator(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Decorator: TZydisDecoratorType; - UserData: TZydisFormatter): TZydisStatus; static; cdecl; - strict protected - function DoPreInstruction(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction): TZydisStatus; virtual; - function DoPostInstruction(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction): TZydisStatus; virtual; - function DoPreOperand(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoPostOperand(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoFormatInstruction(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction): TZydisStatus; virtual; - function DoFormatOperandReg(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoFormatOperandMem(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoFormatOperandPtr(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoFormatOperandImm(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoPrintMnemonic(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; virtual; - function DoPrintRegister(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Reg: TZydisRegister): TZydisStatus; virtual; - function DoPrintAddress(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Address: ZydisU64): TZydisStatus; virtual; - function DoPrintDisp(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoPrintImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoPrintMemSize(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; virtual; - function DoPrintPrefixes(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; virtual; - function DoPrintDecorator(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Decorator: TZydisDecoratorType): TZydisStatus; virtual; - public - function FormatInstruction(const Instruction: TZydisDecodedInstruction): String; - function FormatOperand(const Instruction: TZydisDecodedInstruction; Index: ZydisU8): String; - public - constructor Create(Style: TZydisFormatterStyle); - public - class constructor Create; - public - property Uppercase: ZydisBool write SetUppercase; - property ForceMemorySegments: ZydisBool write SetForceMemorySegments; - property ForceMemorySize: ZydisBool write SetForceMemorySize; - property AddressFormat: TZydisAddressFormat write SetAddressFormat; - property DisplacementFormat: TZydisDisplacementFormat write SetDisplacementFormat; - property ImmediateFormat: TZydisImmediateFormat write SetImmediateFormat; - property HexUppercase: ZydisBool write SetHexUppercase; - property HexPrefix: AnsiString write SetHexPrefix; - property HexSuffix: AnsiString write SetHexSuffix; - property HexPaddingAddress: ZydisU8 write SetHexPaddingAddress; - property HexPaddingDisplacement: ZydisU8 write SetHexPaddingDisplacement; - property HexPaddingImmediate: ZydisU8 write SetHexPaddingImmediate; - end; +uses + Zydis.Enums, + Zydis.Types, + Zycore.Strings, + Zycore.FormatterBuffer, + Zydis.Decoder.Types; implementation -{ TZydisFormatter } - -constructor TZydisFormatter.Create(Style: TZydisFormatterStyle); -var - Status: TZydisStatus; - HookType: TZydisFormatterHookType; -begin - inherited Create; - Status := ZydisFormatterInit(FContext, Style); - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); - for HookType := Low(TZydisFormatterHookType) to High(TZydisFormatterHookType) do - begin - Status := ZydisFormatterSetHook(FContext, HookType, Callbacks[HookType]); - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); - end; -end; - -class constructor TZydisFormatter.Create; -begin - Callbacks[ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION ] := @InternalPreInstruction; - Callbacks[ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION ] := @InternalPostInstruction; - Callbacks[ZYDIS_FORMATTER_HOOK_PRE_OPERAND ] := @InternalPreOperand; - Callbacks[ZYDIS_FORMATTER_HOOK_POST_OPERAND ] := @InternalPostOperand; - Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION] := @InternalFormatInstruction; - Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG] := @InternalFormatOperandReg; - Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM] := @InternalFormatOperandMem; - Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR] := @InternalFormatOperandPtr; - Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM] := @InternalFormatOperandImm; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC ] := @InternalPrintMnemonic; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_REGISTER ] := @InternalPrintRegister; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS ] := @InternalPrintAddress; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_DISP ] := @InternalPrintDisp; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_IMM ] := @InternalPrintImm; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE ] := @InternalPrintMemSize; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES ] := @InternalPrintPrefixes; - Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR ] := @InternalPrintDecorator; -end; - -function TZydisFormatter.DoFormatInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; -begin - Result := TZydisFormatterFunc(Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION])( - @Formatter, Str, Instruction, Self); -end; - -function TZydisFormatter.DoFormatOperandImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoFormatOperandMem(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoFormatOperandPtr(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoFormatOperandReg(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoPostInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; -begin - if (not Assigned(Callbacks[ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION])) then - begin - Exit(ZYDIS_STATUS_SUCCESS); - end; - Result := TZydisFormatterFunc(Callbacks[ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION])( - @Formatter, Str, Instruction, Self); -end; - -function TZydisFormatter.DoPostOperand(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - if (not Assigned(Callbacks[ZYDIS_FORMATTER_HOOK_POST_OPERAND])) then - begin - Exit(ZYDIS_STATUS_SUCCESS); - end; - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_POST_OPERAND])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoPreInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; -begin - if (not Assigned(Callbacks[ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION])) then - begin - Exit(ZYDIS_STATUS_SUCCESS); - end; - Result := TZydisFormatterFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION])( - @Formatter, Str, Instruction, Self); -end; - -function TZydisFormatter.DoPreOperand(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand): TZydisStatus; -begin - if (not Assigned(Callbacks[ZYDIS_FORMATTER_HOOK_PRE_OPERAND])) then - begin - Exit(ZYDIS_STATUS_SUCCESS); - end; - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRE_OPERAND])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoPrintAddress(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Address: ZydisU64): TZydisStatus; -begin - Result := TZydisFormatterAddressFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS])( - @Formatter, Str, Instruction, Operand, Address, Self); -end; - -function TZydisFormatter.DoPrintDecorator(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Decorator: TZydisDecoratorType): TZydisStatus; -begin - Result := TZydisFormatterDecoratorFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR])( - @Formatter, Str, Instruction, Operand, Decorator, Self); -end; - -function TZydisFormatter.DoPrintDisp(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_DISP])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoPrintImm(const Formatter: Zydis.TZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_IMM])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoPrintMemSize(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand): TZydisStatus; -begin - Result := TZydisFormatterOperandFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE])( - @Formatter, Str, Instruction, Operand, Self); -end; - -function TZydisFormatter.DoPrintMnemonic(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; -begin - Result := TZydisFormatterFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC])( - @Formatter, Str, Instruction, Self); -end; - -function TZydisFormatter.DoPrintPrefixes(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction): TZydisStatus; -begin - Result := TZydisFormatterFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES])( - @Formatter, Str, Instruction, Self); -end; - -function TZydisFormatter.DoPrintRegister(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Reg: TZydisRegister): TZydisStatus; -begin - Result := TZydisFormatterRegisterFunc(Callbacks[ZYDIS_FORMATTER_HOOK_PRINT_REGISTER])( - @Formatter, Str, Instruction, Operand, Reg, Self); -end; - -function TZydisFormatter.FormatInstruction(const Instruction: TZydisDecodedInstruction): String; -const - STACK_BUFFER_LEN = 256; -var - Status: TZydisStatus; - Buffer: array of AnsiChar; - BufferLen: ZydisUSize; - StackBuf: array[0..STACK_BUFFER_LEN - 1] of AnsiChar; - Data: Pointer; -begin - BufferLen := STACK_BUFFER_LEN; - Status := ZydisFormatterFormatInstructionEx(@FContext, @Instruction, @StackBuf[0], - STACK_BUFFER_LEN, Self); - Data := @StackBuf[0]; - while (Status = ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE) do - begin - BufferLen := BufferLen * 2; - SetLength(Buffer, BufferLen); - Status := ZydisFormatterFormatInstructionEx(@FContext, @Instruction, @Buffer[0], - BufferLen, Self); - Data := @Buffer[0]; - end; - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); - Result := String(PAnsiChar(Data)); -end; - -function TZydisFormatter.FormatOperand(const Instruction: TZydisDecodedInstruction; - Index: ZydisU8): String; -const - STACK_BUFFER_LEN = 64; -var - Status: TZydisStatus; - Buffer: array of AnsiChar; - BufferLen: ZydisUSize; - StackBuf: array[0..STACK_BUFFER_LEN - 1] of AnsiChar; - Data: Pointer; -begin - BufferLen := STACK_BUFFER_LEN; - Status := ZydisFormatterFormatOperandEx(@FContext, @Instruction, Index, @StackBuf[0], - STACK_BUFFER_LEN, Self); - Data := @StackBuf[0]; - while (Status = ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE) do - begin - BufferLen := BufferLen * 2; - SetLength(Buffer, BufferLen); - Status := ZydisFormatterFormatOperandEx(@FContext, @Instruction, Index, @Buffer[0], - BufferLen, Self); - Data := @Buffer[0]; - end; - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); - Result := String(PAnsiChar(Data)); -end; - -class function TZydisFormatter.InternalFormatInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoFormatInstruction(Formatter, Str, Instruction); -end; - -class function TZydisFormatter.InternalFormatOperandImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoFormatOperandImm(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalFormatOperandMem(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoFormatOperandMem(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalFormatOperandPtr(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoFormatOperandPtr(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalFormatOperandReg(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoFormatOperandReg(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalPostInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPostInstruction(Formatter, Str, Instruction); -end; - -class function TZydisFormatter.InternalPostOperand(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPostOperand(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalPreInstruction(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPreInstruction(Formatter, Str, Instruction); -end; - -class function TZydisFormatter.InternalPreOperand(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPreOperand(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalPrintAddress(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Address: ZydisU64; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintAddress(Formatter, Str, Instruction, Operand, Address); -end; - -class function TZydisFormatter.InternalPrintDecorator(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Decorator: TZydisDecoratorType; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintDecorator(Formatter, Str, Instruction, Operand, Decorator); -end; - -class function TZydisFormatter.InternalPrintDisp(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintDisp(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalPrintImm(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintImm(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalPrintMemSize(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintMemSize(Formatter, Str, Instruction, Operand); -end; - -class function TZydisFormatter.InternalPrintMnemonic(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintMnemonic(Formatter, Str, Instruction); -end; - -class function TZydisFormatter.InternalPrintPrefixes(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintPrefixes(Formatter, Str, Instruction); -end; - -class function TZydisFormatter.InternalPrintRegister(const Formatter: Zydis.TZydisFormatter; - var Str: TZydisString; const Instruction: TZydisDecodedInstruction; - const Operand: TZydisDecodedOperand; Reg: TZydisRegister; - UserData: TZydisFormatter): TZydisStatus; -begin - Result := UserData.DoPrintRegister(Formatter, Str, Instruction, Operand, Reg); -end; - -procedure TZydisFormatter.SetAddressFormat(Value: TZydisAddressFormat); -begin - SetProperty(ZYDIS_FORMATTER_PROP_ADDR_FORMAT, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetDisplacementFormat(Value: TZydisDisplacementFormat); -begin - SetProperty(ZYDIS_FORMATTER_PROP_DISP_FORMAT, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetForceMemorySegments(Value: ZydisBool); -begin - SetProperty(ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetForceMemorySize(Value: ZydisBool); -begin - SetProperty(ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetHexPaddingAddress(const Value: ZydisU8); -begin - SetProperty(ZYDIS_FORMATTER_PROP_HEX_PADDING_ADDR, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetHexPaddingDisplacement(const Value: ZydisU8); -begin - SetProperty(ZYDIS_FORMATTER_PROP_HEX_PADDING_DISP, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetHexPaddingImmediate(const Value: ZydisU8); -begin - SetProperty(ZYDIS_FORMATTER_PROP_HEX_PADDING_IMM, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetHexPrefix(const Value: AnsiString); -begin - FHexPrefix := Value; - SetProperty(ZYDIS_FORMATTER_PROP_HEX_PREFIX, ZydisUPointer(@FHexPrefix[1])); -end; - -procedure TZydisFormatter.SetHexSuffix(const Value: AnsiString); -begin - FHexSuffix := Value; - SetProperty(ZYDIS_FORMATTER_PROP_HEX_SUFFIX, ZydisUPointer(@FHexSuffix[1])); -end; - -procedure TZydisFormatter.SetHexUppercase(Value: ZydisBool); -begin - SetProperty(ZYDIS_FORMATTER_PROP_HEX_UPPERCASE, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetImmediateFormat(Value: TZydisImmediateFormat); -begin - SetProperty(ZYDIS_FORMATTER_PROP_IMM_FORMAT, ZydisUPointer(Value)); -end; - -procedure TZydisFormatter.SetProperty(&Property: TZydisFormatterProperty; Value: ZydisUPointer); -var - Status: TZydisStatus; -begin - Status := ZydisFormatterSetProperty(FContext, &Property, Value); - if (not ZydisSuccess(Status)) then TZydisException.RaiseException(Status); -end; - -procedure TZydisFormatter.SetUppercase(Value: ZydisBool); -begin - SetProperty(ZYDIS_FORMATTER_PROP_UPPERCASE, ZydisUPointer(Value)); -end; - end. + diff --git a/Zydis/Zydis.Status.pas b/Zydis/Zydis.Status.pas new file mode 100644 index 0000000..e01d252 --- /dev/null +++ b/Zydis/Zydis.Status.pas @@ -0,0 +1,121 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} + +unit Zydis.Status; + +{$IFDEF FPC} + {$mode Delphi} + {$PackRecords C} +{$ENDIF} + +interface + +uses + Zydis.types; + + +const { Module IDs } + // The zycore generic module id. + ZYAN_MODULE_ZYCORE = $001; + // The zycore arg-parse submodule id. + ZYAN_MODULE_ARGPARSE = $003; + // The base module id for user-defined status codes. + ZYAN_MODULE_USER = $3FF; + + + function ZYAN_MAKE_STATUS(error, module, code : ZyanU32): ZyanStatus; + function ZYAN_SUCCESS(status : ZyanStatus): Boolean; + function ZYAN_FAILED(status: ZyanStatus): Boolean; + function ZYAN_STATUS_MODULE(Status : ZyanStatus): ZyanStatus; + function ZYAN_STATUS_CODE(Status : ZyanStatus): ZyanStatus; + +implementation + +{ + * Defines a zyan status code. + * + * @param error `1`, if the status code signals an error or `0`, if not. + * @param module The module id. + * @param code The actual code. + * + * @return The zyan status code. +} +function ZYAN_MAKE_STATUS(error, module, code : ZyanU32): ZyanStatus; +begin + Result := ZyanStatus((((error) and 01) shl 31) or (((module) and $7FF) shl 20) or + ((code) and $FFFFF)); +end; + +{ + * Checks if a zyan operation was successful. + * + * @param status The zyan status-code to check. + * + * @return `ZYAN_TRUE`, if the operation succeeded or `ZYAN_FALSE`, if not. + * +} +function ZYAN_SUCCESS(status : ZyanStatus): Boolean; +begin + Result := (status and $80000000) = 0; +end; + +{ + Checks if a Zyan operation failed. + + @param status The Zyan status code to check. + + @return True if the operation failed, False if not. +} +function ZYAN_FAILED(status: ZyanStatus): Boolean; +begin + Result := (status and $80000000) <> 0; +end; + + +{ +* Returns the module id of a zyan status-code. +* +* @param status The zyan status-code. +* +* @return The module id of the zyan status-code. +} +function ZYAN_STATUS_MODULE(Status : ZyanStatus): ZyanStatus; +begin + Result := (status shr 20) and $7FF; +end; + +{ +* Returns the code of a zyan status-code. +* +* @param status The zyan status-code. +* +* @return The code of the zyan status-code. +} +function ZYAN_STATUS_CODE(Status : ZyanStatus): ZyanStatus; +begin + Result := status and $FFFFF; +end; + +end. + diff --git a/Zydis/Zydis.Types.pas b/Zydis/Zydis.Types.pas new file mode 100644 index 0000000..5f71aa6 --- /dev/null +++ b/Zydis/Zydis.Types.pas @@ -0,0 +1,272 @@ +{******************************************************************************* + + Zydis Pascal API By Coldzer0 + + * 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. + +*******************************************************************************} + +unit Zydis.Types; + +{$IfDef FPC} + {$mode delphi} + {$PackRecords C} +{$ENDIF} + +interface +{$IfNDef FPC} + uses + windows; +{$ENDIF} + +Type + ZyanU8 = UInt8; + ZyanU16 = UInt16; + ZyanU32 = UInt32; + ZyanU64 = UInt64; + ZyanI8 = Int8; + ZyanI16 = Int16; + ZyanI32 = Int32; + ZyanI64 = Int64; + ZyanUSize = UIntPtr; + ZyanISize = int64; + ZyanUPointer = UIntPtr; + ZyanIPointer = IntPtr; + ZyanBool = ZyanU8; + + PZyanU8 = ^ZyanU8; + PZyanU16 = ^ZyanU16; + PZyanU32 = ^ZyanU32; + PZyanU64 = ^ZyanU64; + PZyanI8 = ^ZyanI8; + PZyanI16 = ^ZyanI16; + PZyanI32 = ^ZyanI32; + PZyanI64 = ^ZyanI64; + PZyanUSize = ^ZyanUSize; + PZyanISize = ^ZyanISize; + PZyanUPointer = ^ZyanUPointer; + PZyanIPointer = ^ZyanIPointer; + PZyanBool = ^ZyanBool; + +{$I stdinth.inc} // Taken from fpcsrc\packages\libc\src\stdinth.inc + +const + ZYAN_INT8_MIN = INT8_MIN; + ZYAN_INT16_MIN = INT16_MIN; + ZYAN_INT32_MIN = INT32_MIN; + ZYAN_INT64_MIN = INT64_MIN; + ZYAN_INT8_MAX = INT8_MAX; + ZYAN_INT16_MAX = INT16_MAX; + ZYAN_INT32_MAX = INT32_MAX; + ZYAN_INT64_MAX = INT64_MAX; + ZYAN_UINT8_MAX = UINT8_MAX; + ZYAN_UINT16_MAX = UINT16_MAX; + ZYAN_UINT32_MAX = UINT32_MAX; + ZYAN_UINT64_MAX = UINT64_MAX; + + +// Defines decoder/encoder-shared macros and types. +const + ZYDIS_MAX_INSTRUCTION_LENGTH = 15; + ZYDIS_MAX_OPERAND_COUNT = 10; + ZYDIS_MAX_OPERAND_COUNT_VISIBLE = 5; + +// Instruction attributes +const + // The instruction has the `ModRM` byte. + ZYDIS_ATTRIB_HAS_MODRM = 1 shl 0; + + // The instruction has the `SIB` byte. + ZYDIS_ATTRIB_HAS_SIB = 1 shl 1; + + // The instruction has the `REX` prefix. + ZYDIS_ATTRIB_HAS_REX = 1 shl 2; + + // The instruction has the `XOP` prefix. + ZYDIS_ATTRIB_HAS_XOP = 1 shl 3; + + // The instruction has the `VEX` prefix. + ZYDIS_ATTRIB_HAS_VEX = 1 shl 4; + + // The instruction has the `EVEX` prefix. + ZYDIS_ATTRIB_HAS_EVEX = 1 shl 5; + + // The instruction has the `MVEX` prefix. + ZYDIS_ATTRIB_HAS_MVEX = 1 shl 6; + + // The instruction has one or more operands with position-relative offsets. + ZYDIS_ATTRIB_IS_RELATIVE = 1 shl 7; + + // The instruction is privileged. + // Privileged instructions are any instructions that require a current ring level below 3. + ZYDIS_ATTRIB_IS_PRIVILEGED = 1 shl 8; + + // The instruction accesses one or more CPU-flags. + ZYDIS_ATTRIB_CPUFLAG_ACCESS = 1 shl 9; + + // The instruction may conditionally read the general CPU state. + ZYDIS_ATTRIB_CPU_STATE_CR = 1 shl 10; + + // The instruction may conditionally write the general CPU state. + ZYDIS_ATTRIB_CPU_STATE_CW = 1 shl 11; + + // The instruction may conditionally read the FPU state (X87, MMX). + ZYDIS_ATTRIB_FPU_STATE_CR = 1 shl 12; + + // The instruction may conditionally write the FPU state (X87, MMX). + ZYDIS_ATTRIB_FPU_STATE_CW = 1 shl 13; + + // The instruction may conditionally read the XMM state (AVX, AVX2, AVX-512). + ZYDIS_ATTRIB_XMM_STATE_CR = 1 shl 14; + + // The instruction may conditionally write the XMM state (AVX, AVX2, AVX-512). + ZYDIS_ATTRIB_XMM_STATE_CW = 1 shl 15; + + // The instruction accepts the `LOCK` prefix (`0xF0`). + ZYDIS_ATTRIB_ACCEPTS_LOCK = 1 shl 16; + + // The instruction accepts the `REP` prefix (`0xF3`). + ZYDIS_ATTRIB_ACCEPTS_REP = 1 shl 17; + + // The instruction accepts the `REPE`/`REPZ` prefix (`0xF3`). + ZYDIS_ATTRIB_ACCEPTS_REPE = 1 shl 18; + + // The instruction accepts the `REPNE`/`REPNZ` prefix (`0xF2`). + ZYDIS_ATTRIB_ACCEPTS_REPNE = 1 shl 19; + + // The instruction accepts the `BND` prefix (`0xF2`). + ZYDIS_ATTRIB_ACCEPTS_BND = 1 shl 20; + + // The instruction accepts the `XACQUIRE` prefix (`0xF2`). + ZYDIS_ATTRIB_ACCEPTS_XACQUIRE = 1 shl 21; + + // The instruction accepts the `XRELEASE` prefix (`0xF3`). + ZYDIS_ATTRIB_ACCEPTS_XRELEASE = 1 shl 22; + + // The instruction accepts the `XACQUIRE`/`XRELEASE` prefixes (`0xF2`, `0xF3`) + // without the `LOCK` prefix (`0x0F`). + ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK = 1 shl 23; + + // The instruction accepts branch hints (0x2E, 0x3E). + ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS = 1 shl 24; + + // The instruction accepts the `CET` `no-track` prefix (`0x3E`). + ZYDIS_ATTRIB_ACCEPTS_NOTRACK = 1 shl 25; + + // The instruction accepts segment prefixes (`0x2E`, `0x36`, `0x3E`, `0x26`, + // `0x64`, `0x65`). + ZYDIS_ATTRIB_ACCEPTS_SEGMENT = 1 shl 26; + + // The instruction has the `LOCK` prefix (`0xF0`). + ZYDIS_ATTRIB_HAS_LOCK = 1 shl 27; + + // The instruction has the `REP` prefix (`0xF3`). + ZYDIS_ATTRIB_HAS_REP = 1 shl 28; + + // The instruction has the `REPE`/`REPZ` prefix (`0xF3`). + ZYDIS_ATTRIB_HAS_REPE = 1 shl 29; + + // The instruction has the `REPNE`/`REPNZ` prefix (`0xF2`). + ZYDIS_ATTRIB_HAS_REPNE = 1 shl 30; + + // The instruction has the `BND` prefix (`0xF2`). + ZYDIS_ATTRIB_HAS_BND = 1 shl 31; + + // The instruction has the `XACQUIRE` prefix (`0xF2`). + ZYDIS_ATTRIB_HAS_XACQUIRE = 1 shl 32; + + // The instruction has the `XRELEASE` prefix (`0xF3`). + ZYDIS_ATTRIB_HAS_XRELEASE = 1 shl 33; + + // The instruction has the branch-not-taken hint (`0x2E`). + ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN = 1 shl 34; + + // The instruction has the branch-taken hint (`0x3E`). + ZYDIS_ATTRIB_HAS_BRANCH_TAKEN = 1 shl 35; + + // The instruction has the `CET` `no-track` prefix (`0x3E`). + ZYDIS_ATTRIB_HAS_NOTRACK = 1 shl 36; + + // The instruction has the `CS` segment modifier (`0x2E`). + ZYDIS_ATTRIB_HAS_SEGMENT_CS = 1 shl 37; + + // The instruction has the `SS` segment modifier (`0x36`). + ZYDIS_ATTRIB_HAS_SEGMENT_SS = 1 shl 38; + + // The instruction has the `DS` segment modifier (`0x3E`). + ZYDIS_ATTRIB_HAS_SEGMENT_DS = 1 shl 39; + + // The instruction has the `ES` segment modifier (`0x26`). + ZYDIS_ATTRIB_HAS_SEGMENT_ES = 1 shl 40; + + // The instruction has the `FS` segment modifier (`0x64`). + ZYDIS_ATTRIB_HAS_SEGMENT_FS = 1 shl 41; + + // The instruction has the `GS` segment modifier (`0x65`). + ZYDIS_ATTRIB_HAS_SEGMENT_GS = 1 shl 42; + + // The instruction has a segment modifier. + ZYDIS_ATTRIB_HAS_SEGMENT = ZYDIS_ATTRIB_HAS_SEGMENT_CS or + ZYDIS_ATTRIB_HAS_SEGMENT_SS or + ZYDIS_ATTRIB_HAS_SEGMENT_DS or + ZYDIS_ATTRIB_HAS_SEGMENT_ES or + ZYDIS_ATTRIB_HAS_SEGMENT_FS or + ZYDIS_ATTRIB_HAS_SEGMENT_GS; + + // The instruction has the operand-size override prefix (`0x66`). + ZYDIS_ATTRIB_HAS_OPERANDSIZE = 1 shl 43; + + // The instruction has the address-size override prefix (`0x67`). + ZYDIS_ATTRIB_HAS_ADDRESSSIZE = 1 shl 44; + + // The instruction has the `EVEX.b` bit set. + // This attribute is mainly used by the encoder. + ZYDIS_ATTRIB_HAS_EVEX_B = 1 shl 45; + + +Type + // Defines the `ZydisInstructionAttributes` data-type. + TZydisInstructionAttributes = ZyanU64; + // Defines the `ZydisElementSize` datatype. + TZydisElementSize = ZyanU16; + // Defines the `ZydisOperandActions` data-type. + TZydisOperandActions = ZyanU8; + + +Type + // Defines the `ZyanVoidPointer` data-type. + TZyanVoidPointer = Pointer; + // Defines the `ZyanConstVoidPointer` data-type. + TZyanConstVoidPointer = Pointer; + +Type + TZyanStringFlags = ZyanU8; + +const + ZYAN_NULL = nil; + + +Type { Enums and types } + // Defines the `ZyanStatus` data type. + ZyanStatus = ZyanU32; + +implementation + + +end. diff --git a/Zydis/Zydis.pas b/Zydis/Zydis.pas deleted file mode 100644 index 2ce5e1c..0000000 --- a/Zydis/Zydis.pas +++ /dev/null @@ -1,1676 +0,0 @@ -{*************************************************************************************************** - - Zydis API - - 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. - -***************************************************************************************************} - -unit Zydis; - -interface - -{ $DEFINE ZYDIS_DYNAMIC_LINK} - -{$IFDEF FPC} - {$MODE DELPHI} -{$ENDIF} - -{* ============================================================================================== *} -{* Constants *} -{* ============================================================================================== *} -const - ZYDIS_VERSION = $0002000000000000; - - ZYDIS_MAX_INSTRUCTION_LENGTH = 15; - ZYDIS_MAX_OPERAND_COUNT = 10; - -{* ============================================================================================== *} -{* Enums and types *} -{* ============================================================================================== *} -type -{* ---------------------------------------------------------------------------------------------- *} -{* Common types *} -{* ---------------------------------------------------------------------------------------------- *} - - ZydisU8 = UInt8; - ZydisU16 = UInt16; - ZydisU32 = UInt32; - ZydisU64 = UInt64; - ZydisI8 = Int8; - ZydisI16 = Int16; - ZydisI32 = Int32; - ZydisI64 = Int64; - ZydisUSize = NativeUInt; - ZydisISize = NativeInt; - ZydisUPointer = UIntPtr; - ZydisIPointer = IntPtr; - ZydisBool = Boolean; - -{* ---------------------------------------------------------------------------------------------- *} -{* Generated enums *} -{* ---------------------------------------------------------------------------------------------- *} - - {$I 'Generated/Zydis.Enum.Register.inc'} - {$I 'Generated/Zydis.Enum.Mnemonic.inc'} - {$I 'Generated/Zydis.Enum.InstructionCategory.inc'} - {$I 'Generated/Zydis.Enum.ISASet.inc'} - {$I 'Generated/Zydis.Enum.ISAExt.inc'} - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisStatus *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z4} - TZydisStatus = ( - ZYDIS_STATUS_SUCCESS = $00000000, - ZYDIS_STATUS_INVALID_PARAMETER, - ZYDIS_STATUS_INVALID_OPERATION, - ZYDIS_STATUS_INSUFFICIENT_BUFFER_SIZE, - ZYDIS_STATUS_NO_MORE_DATA, - ZYDIS_STATUS_DECODING_ERROR, - ZYDIS_STATUS_INSTRUCTION_TOO_LONG, - ZYDIS_STATUS_BAD_REGISTER, - ZYDIS_STATUS_ILLEGAL_LOCK, - ZYDIS_STATUS_ILLEGAL_LEGACY_PREFIX, - ZYDIS_STATUS_ILLEGAL_REX, - ZYDIS_STATUS_INVALID_MAP, - ZYDIS_STATUS_MALFORMED_EVEX, - ZYDIS_STATUS_MALFORMED_MVEX, - ZYDIS_STATUS_INVALID_MASK, - ZYDIS_STATUS_SKIP_OPERAND, - ZYDIS_STATUS_IMPOSSIBLE_INSTRUCTION, - ZYDIS_STATUS_USER = $10000000 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisLetterCase *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisLetterCase = ( - ZYDIS_LETTER_CASE_DEFAULT, - ZYDIS_LETTER_CASE_LOWER, - ZYDIS_LETTER_CASE_UPPER, - - ZYDIS_LETTER_CASE_MAX_VALUE = ZYDIS_LETTER_CASE_UPPER - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisString *} -{* ---------------------------------------------------------------------------------------------- *} - - PZydisStaticString = ^TZydisStaticString; - TZydisStaticString = record - public - Buffer: PAnsiChar; - Length: ZydisU8; - end; - - PZydisString = ^TZydisString; - TZydisString = record - public - Buffer: PAnsiChar; - Length: ZydisUSize; - Capacity: ZydisUSize; - end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisRegisterClass *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisRegisterClass = ( - ZYDIS_REGCLASS_INVALID, - ZYDIS_REGCLASS_GPR8, - ZYDIS_REGCLASS_GPR16, - ZYDIS_REGCLASS_GPR32, - ZYDIS_REGCLASS_GPR64, - ZYDIS_REGCLASS_X87, - ZYDIS_REGCLASS_MMX, - ZYDIS_REGCLASS_XMM, - ZYDIS_REGCLASS_YMM, - ZYDIS_REGCLASS_ZMM, - ZYDIS_REGCLASS_FLAGS, - ZYDIS_REGCLASS_IP, - ZYDIS_REGCLASS_SEGMENT, - ZYDIS_REGCLASS_TEST, - ZYDIS_REGCLASS_CONTROL, - ZYDIS_REGCLASS_DEBUG, - ZYDIS_REGCLASS_MASK, - ZYDIS_REGCLASS_BOUND, - - ZYDIS_REGCLASS_MAX_VALUE = ZYDIS_REGCLASS_BOUND - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisRegisterWidth *} -{* ---------------------------------------------------------------------------------------------- *} - - TZydisRegisterWidth = ZydisU16; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisMachineMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisMachineMode = ( - ZYDIS_MACHINE_MODE_INVALID, - ZYDIS_MACHINE_MODE_LONG_64, - ZYDIS_MACHINE_MODE_LONG_COMPAT_32, - ZYDIS_MACHINE_MODE_LONG_COMPAT_16, - ZYDIS_MACHINE_MODE_LEGACY_32, - ZYDIS_MACHINE_MODE_LEGACY_16, - ZYDIS_MACHINE_MODE_REAL_16, - - ZYDIS_MACHINE_MODE_MAX_VALUE = ZYDIS_MACHINE_MODE_REAL_16 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisAddressWidth *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisAddressWidth = ( - ZYDIS_ADDRESS_WIDTH_INVALID = 0, - ZYDIS_ADDRESS_WIDTH_16 = 16, - ZYDIS_ADDRESS_WIDTH_32 = 32, - ZYDIS_ADDRESS_WIDTH_64 = 64, - - ZYDIS_ADDRESS_WIDTH_MAX_VALUE = ZYDIS_ADDRESS_WIDTH_64 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisElementType *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisElementType = ( - ZYDIS_ELEMENT_TYPE_INVALID, - ZYDIS_ELEMENT_TYPE_STRUCT, - ZYDIS_ELEMENT_TYPE_UINT, - ZYDIS_ELEMENT_TYPE_INT, - ZYDIS_ELEMENT_TYPE_FLOAT16, - ZYDIS_ELEMENT_TYPE_FLOAT32, - ZYDIS_ELEMENT_TYPE_FLOAT64, - ZYDIS_ELEMENT_TYPE_FLOAT80, - ZYDIS_ELEMENT_TYPE_LONGBCD, - - ZYDIS_ELEMENT_TYPE_MAX_VALUE = ZYDIS_ELEMENT_TYPE_LONGBCD - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisElementSize *} -{* ---------------------------------------------------------------------------------------------- *} - - TZydisElementSize = ZydisU16; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisOperandType *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisOperandType = ( - ZYDIS_OPERAND_TYPE_UNUSED, - ZYDIS_OPERAND_TYPE_REGISTER, - ZYDIS_OPERAND_TYPE_MEMORY, - ZYDIS_OPERAND_TYPE_POINTER, - ZYDIS_OPERAND_TYPE_IMMEDIATE, - - ZYDIS_OPERAND_TYPE_MAX_VALUE = ZYDIS_OPERAND_TYPE_IMMEDIATE - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisOperandEncoding *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisOperandEncoding = ( - ZYDIS_OPERAND_ENCODING_NONE, - ZYDIS_OPERAND_ENCODING_MODRM_REG, - ZYDIS_OPERAND_ENCODING_MODRM_RM, - ZYDIS_OPERAND_ENCODING_OPCODE, - ZYDIS_OPERAND_ENCODING_NDSNDD, - ZYDIS_OPERAND_ENCODING_IS4, - ZYDIS_OPERAND_ENCODING_MASK, - ZYDIS_OPERAND_ENCODING_DISP8, - ZYDIS_OPERAND_ENCODING_DISP16, - ZYDIS_OPERAND_ENCODING_DISP32, - ZYDIS_OPERAND_ENCODING_DISP64, - ZYDIS_OPERAND_ENCODING_DISP16_32_64, - ZYDIS_OPERAND_ENCODING_DISP32_32_64, - ZYDIS_OPERAND_ENCODING_DISP16_32_32, - ZYDIS_OPERAND_ENCODING_UIMM8, - ZYDIS_OPERAND_ENCODING_UIMM16, - ZYDIS_OPERAND_ENCODING_UIMM32, - ZYDIS_OPERAND_ENCODING_UIMM64, - ZYDIS_OPERAND_ENCODING_UIMM16_32_64, - ZYDIS_OPERAND_ENCODING_UIMM32_32_64, - ZYDIS_OPERAND_ENCODING_UIMM16_32_32, - ZYDIS_OPERAND_ENCODING_SIMM8, - ZYDIS_OPERAND_ENCODING_SIMM16, - ZYDIS_OPERAND_ENCODING_SIMM32, - ZYDIS_OPERAND_ENCODING_SIMM64, - ZYDIS_OPERAND_ENCODING_SIMM16_32_64, - ZYDIS_OPERAND_ENCODING_SIMM32_32_64, - ZYDIS_OPERAND_ENCODING_SIMM16_32_32, - ZYDIS_OPERAND_ENCODING_JIMM8, - ZYDIS_OPERAND_ENCODING_JIMM16, - ZYDIS_OPERAND_ENCODING_JIMM32, - ZYDIS_OPERAND_ENCODING_JIMM64, - ZYDIS_OPERAND_ENCODING_JIMM16_32_64, - ZYDIS_OPERAND_ENCODING_JIMM32_32_64, - ZYDIS_OPERAND_ENCODING_JIMM16_32_32, - - ZYDIS_OPERAND_ENCODING_MAX_VALUE = ZYDIS_OPERAND_ENCODING_JIMM16_32_32 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisOperandVisibility *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisOperandVisibility = ( - ZYDIS_OPERAND_VISIBILITY_INVALID, - ZYDIS_OPERAND_VISIBILITY_EXPLICIT, - ZYDIS_OPERAND_VISIBILITY_IMPLICIT, - ZYDIS_OPERAND_VISIBILITY_HIDDEN, - - ZYDIS_OPERAND_VISIBILITY_MAX_VALUE = ZYDIS_OPERAND_VISIBILITY_HIDDEN - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisOperandAction *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisOperandAction = ( - ZYDIS_OPERAND_ACTION_INVALID, - ZYDIS_OPERAND_ACTION_READ, - ZYDIS_OPERAND_ACTION_WRITE, - ZYDIS_OPERAND_ACTION_READWRITE, - ZYDIS_OPERAND_ACTION_CONDREAD, - ZYDIS_OPERAND_ACTION_CONDWRITE, - ZYDIS_OPERAND_ACTION_READ_CONDWRITE, - ZYDIS_OPERAND_ACTION_CONDREAD_WRITE, - - ZYDIS_OPERAND_ACTION_MAX_VALUE = ZYDIS_OPERAND_ACTION_CONDREAD_WRITE - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisInstructionEncoding *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisInstructionEncoding = ( - ZYDIS_INSTRUCTION_ENCODING_INVALID, - ZYDIS_INSTRUCTION_ENCODING_DEFAULT, - ZYDIS_INSTRUCTION_ENCODING_3DNOW, - ZYDIS_INSTRUCTION_ENCODING_XOP, - ZYDIS_INSTRUCTION_ENCODING_VEX, - ZYDIS_INSTRUCTION_ENCODING_EVEX, - ZYDIS_INSTRUCTION_ENCODING_MVEX, - - ZYDIS_INSTRUCTION_ENCODING_MAX_VALUE = ZYDIS_INSTRUCTION_ENCODING_MVEX - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisOpcodeMap *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisOpcodeMap = ( - ZYDIS_OPCODE_MAP_DEFAULT, - ZYDIS_OPCODE_MAP_0F, - ZYDIS_OPCODE_MAP_0F38, - ZYDIS_OPCODE_MAP_0F3A, - ZYDIS_OPCODE_MAP_0F0F, - ZYDIS_OPCODE_MAP_XOP8, - ZYDIS_OPCODE_MAP_XOP9, - ZYDIS_OPCODE_MAP_XOPA, - - ZYDIS_OPCODE_MAP_MAX_VALUE = ZYDIS_OPCODE_MAP_XOP9 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisMemoryOperandType *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisMemoryOperandType = ( - ZYDIS_MEMOP_TYPE_INVALID, - ZYDIS_MEMOP_TYPE_MEM, - ZYDIS_MEMOP_TYPE_AGEN, - ZYDIS_MEMOP_TYPE_MIB, - - ZYDIS_MEMOP_TYPE_MAX_VALUE = ZYDIS_MEMOP_TYPE_MIB - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisDecodedOperand *} -{* ---------------------------------------------------------------------------------------------- *} - - TZydisDecodedOperandReg = record - public - Value: TZydisRegister; - end; - - TZydisDecodedOperandMemDisp = record - public - HasDisplacement: ZydisBool; - Value: ZydisI64; - end; - - TZydisDecodedOperandMem = record - public - &Type: TZydisMemoryOperandType; - Segment: TZydisRegister; - Base: TZydisRegister; - Index: TZydisRegister; - Scale: ZydisU8; - Disp: TZydisDecodedOperandMemDisp; - end; - - TZydisDecodedOperandPtr = record - public - Segment: ZydisU16; - Offset: ZydisU32; - end; - - TZydisDecodedOperandImmValue = record - case Integer of - 0: ( U: ZydisU64 ); - 1: ( S: ZydisI64 ); - end; - - TZydisDecodedOperandImm = record - public - IsSigned: ZydisBool; - IsRelative: ZydisBool; - Value: TZydisDecodedOperandImmValue; - end; - - PZydisDecodedOperand = ^TZydisDecodedOperand; - TZydisDecodedOperand = record - public - Id: ZydisU8; - &Type: TZydisOperandType; - Visibility: TZydisOperandVisibility; - Action: TZydisOperandAction; - Encoding: TZydisOperandEncoding; - Size: ZydisU16; - ElementType: TZydisElementType; - ElementSize: TZydisElementSize; - ElementCount: ZydisU16; - Reg: TZydisDecodedOperandReg; - Mem: TZydisDecodedOperandMem; - Ptr: TZydisDecodedOperandPtr; - Imm: TZydisDecodedOperandImm; - end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisInstructionAttribute *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisInstructionAttribute = ( - ZYDIS_ATTRIB_HAS_MODRM = 0, - ZYDIS_ATTRIB_HAS_SIB = 1, - ZYDIS_ATTRIB_HAS_REX = 2, - ZYDIS_ATTRIB_HAS_XOP = 3, - ZYDIS_ATTRIB_HAS_VEX = 4, - ZYDIS_ATTRIB_HAS_EVEX = 5, - ZYDIS_ATTRIB_HAS_MVEX = 6, - ZYDIS_ATTRIB_IS_RELATIVE = 7, - ZYDIS_ATTRIB_IS_PRIVILEGED = 8, - ZYDIS_ATTRIB_ACCEPTS_LOCK = 9, - ZYDIS_ATTRIB_ACCEPTS_REP = 10, - ZYDIS_ATTRIB_ACCEPTS_REPE = 11, - ZYDIS_ATTRIB_ACCEPTS_REPZ = 11, - ZYDIS_ATTRIB_ACCEPTS_REPNE = 12, - ZYDIS_ATTRIB_ACCEPTS_REPNZ = 12, - ZYDIS_ATTRIB_ACCEPTS_BOUND = 13, - ZYDIS_ATTRIB_ACCEPTS_XACQUIRE = 14, - ZYDIS_ATTRIB_ACCEPTS_XRELEASE = 15, - ZYDIS_ATTRIB_ACCEPTS_HLE_WITHOUT_LOCK = 16, - ZYDIS_ATTRIB_ACCEPTS_BRANCH_HINTS = 17, - ZYDIS_ATTRIB_ACCEPTS_SEGMENT = 18, - ZYDIS_ATTRIB_HAS_LOCK = 19, - ZYDIS_ATTRIB_HAS_REP = 20, - ZYDIS_ATTRIB_HAS_REPE = 21, - ZYDIS_ATTRIB_HAS_REPZ = 21, - ZYDIS_ATTRIB_HAS_REPNE = 22, - ZYDIS_ATTRIB_HAS_REPNZ = 22, - ZYDIS_ATTRIB_HAS_BOUND = 23, - ZYDIS_ATTRIB_HAS_XACQUIRE = 24, - ZYDIS_ATTRIB_HAS_XRELEASE = 25, - ZYDIS_ATTRIB_HAS_BRANCH_NOT_TAKEN = 26, - ZYDIS_ATTRIB_HAS_BRANCH_TAKEN = 27, - ZYDIS_ATTRIB_HAS_SEGMENT_CS = 28, - ZYDIS_ATTRIB_HAS_SEGMENT_SS = 29, - ZYDIS_ATTRIB_HAS_SEGMENT_DS = 30, - ZYDIS_ATTRIB_HAS_SEGMENT_ES = 31, - ZYDIS_ATTRIB_HAS_SEGMENT_FS = 32, - ZYDIS_ATTRIB_HAS_SEGMENT_GS = 33, - ZYDIS_ATTRIB_HAS_OPERANDSIZE = 34, - ZYDIS_ATTRIB_HAS_ADDRESSSIZE = 35 - ); - TZydisInstructionAttributes = set of TZydisInstructionAttribute; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisCPUFlag *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisCPUFlag = ( - ZYDIS_CPUFLAG_CF, - ZYDIS_CPUFLAG_PF, - ZYDIS_CPUFLAG_AF, - ZYDIS_CPUFLAG_ZF, - ZYDIS_CPUFLAG_SF, - ZYDIS_CPUFLAG_TF, - ZYDIS_CPUFLAG_IF, - ZYDIS_CPUFLAG_DF, - ZYDIS_CPUFLAG_OF, - ZYDIS_CPUFLAG_IOPL, - ZYDIS_CPUFLAG_NT, - ZYDIS_CPUFLAG_RF, - ZYDIS_CPUFLAG_VM, - ZYDIS_CPUFLAG_AC, - ZYDIS_CPUFLAG_VIF, - ZYDIS_CPUFLAG_VIP, - ZYDIS_CPUFLAG_ID, - ZYDIS_CPUFLAG_C0, - ZYDIS_CPUFLAG_C1, - ZYDIS_CPUFLAG_C2, - ZYDIS_CPUFLAG_C3, - - ZYDIS_CPUFLAG_MAX_VALUE = ZYDIS_CPUFLAG_C3 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisCPUFlagMask *} -{* ---------------------------------------------------------------------------------------------- *} - - TZydisCPUFlagMask = set of TZydisCPUFlag; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisCPUFlagAction *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisCPUFlagAction = ( - ZYDIS_CPUFLAG_ACTION_NONE, - ZYDIS_CPUFLAG_ACTION_TESTED, - ZYDIS_CPUFLAG_ACTION_MODIFIED, - ZYDIS_CPUFLAG_ACTION_SET_0, - ZYDIS_CPUFLAG_ACTION_SET_1, - ZYDIS_CPUFLAG_ACTION_UNDEFINED, - - ZYDIS_CPUFLAG_ACTION_MAX_VALUE = ZYDIS_CPUFLAG_ACTION_UNDEFINED - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisExceptionClass *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisExceptionClass = ( - ZYDIS_EXCEPTION_CLASS_NONE, - ZYDIS_EXCEPTION_CLASS_SSE1, - ZYDIS_EXCEPTION_CLASS_SSE2, - ZYDIS_EXCEPTION_CLASS_SSE3, - ZYDIS_EXCEPTION_CLASS_SSE4, - ZYDIS_EXCEPTION_CLASS_SSE5, - ZYDIS_EXCEPTION_CLASS_SSE7, - ZYDIS_EXCEPTION_CLASS_AVX1, - ZYDIS_EXCEPTION_CLASS_AVX2, - ZYDIS_EXCEPTION_CLASS_AVX3, - ZYDIS_EXCEPTION_CLASS_AVX4, - ZYDIS_EXCEPTION_CLASS_AVX5, - ZYDIS_EXCEPTION_CLASS_AVX6, - ZYDIS_EXCEPTION_CLASS_AVX7, - ZYDIS_EXCEPTION_CLASS_AVX8, - ZYDIS_EXCEPTION_CLASS_AVX11, - ZYDIS_EXCEPTION_CLASS_AVX12, - ZYDIS_EXCEPTION_CLASS_E1, - ZYDIS_EXCEPTION_CLASS_E1NF, - ZYDIS_EXCEPTION_CLASS_E2, - ZYDIS_EXCEPTION_CLASS_E2NF, - ZYDIS_EXCEPTION_CLASS_E3, - ZYDIS_EXCEPTION_CLASS_E3NF, - ZYDIS_EXCEPTION_CLASS_E4, - ZYDIS_EXCEPTION_CLASS_E4NF, - ZYDIS_EXCEPTION_CLASS_E5, - ZYDIS_EXCEPTION_CLASS_E5NF, - ZYDIS_EXCEPTION_CLASS_E6, - ZYDIS_EXCEPTION_CLASS_E6NF, - ZYDIS_EXCEPTION_CLASS_E7NM, - ZYDIS_EXCEPTION_CLASS_E7NM128, - ZYDIS_EXCEPTION_CLASS_E9NF, - ZYDIS_EXCEPTION_CLASS_E10, - ZYDIS_EXCEPTION_CLASS_E10NF, - ZYDIS_EXCEPTION_CLASS_E11, - ZYDIS_EXCEPTION_CLASS_E11NF, - ZYDIS_EXCEPTION_CLASS_E12, - ZYDIS_EXCEPTION_CLASS_E12NP, - ZYDIS_EXCEPTION_CLASS_K20, - ZYDIS_EXCEPTION_CLASS_K21, - - ZYDIS_EXCEPTION_CLASS_MAX_VALUE = ZYDIS_EXCEPTION_CLASS_K21 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisVectorLength *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z2} - TZydisVectorLength = ( - ZYDIS_VECTOR_LENGTH_INVALID = 0, - ZYDIS_VECTOR_LENGTH_128 = 128, - ZYDIS_VECTOR_LENGTH_256 = 256, - ZYDIS_VECTOR_LENGTH_512 = 512, - - ZYDIS_VECTOR_LENGTH_MAX_VALUE = ZYDIS_VECTOR_LENGTH_512 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisMaskMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisMaskMode = ( - ZYDIS_MASK_MODE_INVALID, - ZYDIS_MASK_MODE_MERGE, - ZYDIS_MASK_MODE_ZERO, - - ZYDIS_MASK_MODE_MAX_VALUE = ZYDIS_MASK_MODE_ZERO - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisBroadcastMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisBroadcastMode = ( - ZYDIS_BROADCAST_MODE_INVALID, - ZYDIS_BROADCAST_MODE_1_TO_2, - ZYDIS_BROADCAST_MODE_1_TO_4, - ZYDIS_BROADCAST_MODE_1_TO_8, - ZYDIS_BROADCAST_MODE_1_TO_16, - ZYDIS_BROADCAST_MODE_1_TO_32, - ZYDIS_BROADCAST_MODE_1_TO_64, - ZYDIS_BROADCAST_MODE_2_TO_4, - ZYDIS_BROADCAST_MODE_2_TO_8, - ZYDIS_BROADCAST_MODE_2_TO_16, - ZYDIS_BROADCAST_MODE_4_TO_8, - ZYDIS_BROADCAST_MODE_4_TO_16, - ZYDIS_BROADCAST_MODE_8_TO_16, - - ZYDIS_BROADCAST_MODE_MAX_VALUE = ZYDIS_BROADCAST_MODE_8_TO_16 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisRoundingMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisRoundingMode = ( - ZYDIS_ROUNDING_MODE_INVALID, - ZYDIS_ROUNDING_MODE_RN, - ZYDIS_ROUNDING_MODE_RD, - ZYDIS_ROUNDING_MODE_RU, - ZYDIS_ROUNDING_MODE_RZ, - - ZYDIS_ROUNDING_MODE_MAX_VALUE = ZYDIS_ROUNDING_MODE_RZ - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisSwizzleMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisSwizzleMode = ( - ZYDIS_SWIZZLE_MODE_INVALID, - ZYDIS_SWIZZLE_MODE_DCBA, - ZYDIS_SWIZZLE_MODE_CDAB, - ZYDIS_SWIZZLE_MODE_BADC, - ZYDIS_SWIZZLE_MODE_DACB, - ZYDIS_SWIZZLE_MODE_AAAA, - ZYDIS_SWIZZLE_MODE_BBBB, - ZYDIS_SWIZZLE_MODE_CCCC, - ZYDIS_SWIZZLE_MODE_DDDD, - - ZYDIS_SWIZZLE_MODE_MAX_VALUE = ZYDIS_SWIZZLE_MODE_DDDD - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisConversionMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisConversionMode = ( - ZYDIS_CONVERSION_MODE_INVALID, - ZYDIS_CONVERSION_MODE_FLOAT16, - ZYDIS_CONVERSION_MODE_SINT8, - ZYDIS_CONVERSION_MODE_UINT8, - ZYDIS_CONVERSION_MODE_SINT16, - ZYDIS_CONVERSION_MODE_UINT16, - - ZYDIS_CONVERSION_MODE_MAX_VALUE = ZYDIS_CONVERSION_MODE_UINT16 - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisDecodedInstruction *} -{* ---------------------------------------------------------------------------------------------- *} - - TZydisDecodedInstructionAccessedFlags = record - public - Action: TZydisCPUFlagAction; - end; - - TZydisDecodedInstructionAVXMask = record - public - Mode: TZydisMaskMode; - Reg: TZydisRegister; - IsControlMask: ZydisBool; - end; - - TZydisDecodedInstructionAVXBroadcast = record - public - IsStatic: Boolean; - Mode: TZydisBroadcastMode; - end; - - TZydisDecodedInstructionAVXRounding = record - public - Mode: TZydisRoundingMode; - end; - - TZydisDecodedInstructionAVXSwizzle = record - public - Mode: TZydisSwizzleMode; - end; - - TZydisDecodedInstructionAVXConversion = record - public - Mode: TZydisConversionMode; - end; - - TZydisDecodedInstructionAVX = record - public - VectorLength: TZydisVectorLength; - Mask: TZydisDecodedInstructionAVXMask; - Broadcast: TZydisDecodedInstructionAVXBroadcast; - Rounding: TZydisDecodedInstructionAVXRounding; - Swizzle: TZydisDecodedInstructionAVXSwizzle; - Conversion: TZydisDecodedInstructionAVXConversion; - HasSAE: ZydisBool; - HasEvictionHint: ZydisBool; - end; - - TZydisDecodedInstructionMeta = record - public - Category: TZydisInstructionCategory; - ISASet: TZydisISASet; - ISAExt: TZydisISAExt; - ExceptionClass: TZydisExceptionClass; - end; - - TZydisDecodedInstructionRawPrefixes = record - public - Data: array[0..ZYDIS_MAX_INSTRUCTION_LENGTH - 2] of ZydisU8; - Count: ZydisU8; - HasF0: ZydisU8; - HasF3: ZydisU8; - HasF2: ZydisU8; - Has2E: ZydisU8; - Has36: ZydisU8; - Has3E: ZydisU8; - Has26: ZydisU8; - Has64: ZydisU8; - Has65: ZydisU8; - Has66: ZydisU8; - Has67: ZydisU8; - end; - - TZydisDecodedInstructionRawREX = record - public - IsDecoded: ZydisBool; - Data: array[0..0] of ZydisU8; - W: ZydisU8; - R: ZydisU8; - X: ZydisU8; - B: ZydisU8; - end; - - TZydisDecodedInstructionRawXOP = record - public - IsDecoded: ZydisBool; - Data: array[0..2] of ZydisU8; - R: ZydisU8; - X: ZydisU8; - B: ZydisU8; - m_mmmm: ZydisU8; - W: ZydisU8; - vvvv: ZydisU8; - L: ZydisU8; - pp: ZydisU8; - end; - - TZydisDecodedInstructionRawVEX = record - public - IsDecoded: ZydisBool; - Data: array[0..2] of ZydisU8; - R: ZydisU8; - X: ZydisU8; - B: ZydisU8; - m_mmmm: ZydisU8; - W: ZydisU8; - vvvv: ZydisU8; - L: ZydisU8; - pp: ZydisU8; - end; - - TZydisDecodedInstructionRawEVEX = record - public - IsDecoded: ZydisBool; - Data: array[0..3] of ZydisU8; - R: ZydisU8; - X: ZydisU8; - B: ZydisU8; - R2: ZydisU8; - mm: ZydisU8; - W: ZydisU8; - vvvv: ZydisU8; - pp: ZydisU8; - z: ZydisU8; - L2: ZydisU8; - L: ZydisU8; - b_: ZydisU8; - V2: ZydisU8; - aaa: ZydisU8; - end; - - TZydisDecodedInstructionRawMVEX = record - public - IsDecoded: ZydisBool; - Data: array[0..3] of ZydisU8; - R: ZydisU8; - X: ZydisU8; - B: ZydisU8; - R2: ZydisU8; - mmmm: ZydisU8; - W: ZydisU8; - vvvv: ZydisU8; - pp: ZydisU8; - E: ZydisU8; - SSS: ZydisU8; - V2: ZydisU8; - kkk: ZydisU8; - end; - - TZydisDecodedInstructionRawModRM = record - public - IsDecoded: ZydisBool; - Data: array[0..0] of ZydisU8; - &Mod: ZydisU8; - Reg: ZydisU8; - Rm: ZydisU8; - end; - - TZydisDecodedInstructionRawSIB = record - public - IsDecoded: ZydisBool; - Data: array[0..0] of ZydisU8; - Scale: ZydisU8; - Index: ZydisU8; - Base: ZydisU8; - end; - - TZydisDecodedInstructionRawDisp = record - public - Value: ZydisU64; - Size: ZydisU8; - Offset: ZydisU8; - end; - - TZydisDecodedInstructionRawImmValue = record - case Integer of - 0: ( U: ZydisU64 ); - 1: ( S: ZydisI64 ); - end; - - TZydisDecodedInstructionRawImm = record - public - IsSigned: ZydisBool; - IsRelative: ZydisBool; - Value: TZydisDecodedInstructionRawImmValue; - Size: ZydisU8; - Offset: ZydisU8; - end; - - TZydisDecodedInstructionRaw = record - public - Prefixes: TZydisDecodedInstructionRawPrefixes; - REX: TZydisDecodedInstructionRawREX; - XOP: TZydisDecodedInstructionRawXOP; - VEX: TZydisDecodedInstructionRawVEX; - EVEX: TZydisDecodedInstructionRawEVEX; - MVEX: TZydisDecodedInstructionRawMVEX; - ModRM: TZydisDecodedInstructionRawModRM; - SIB: TZydisDecodedInstructionRawSIB; - Disp: TZydisDecodedInstructionRawDisp; - Imm: array[0..1] of TZydisDecodedInstructionRawImm; - end; - - PZydisDecodedInstruction = ^TZydisDecodedInstruction; - TZydisDecodedInstruction = record - public - MachineMode: TZydisMachineMode; - Mnemonic: TZydisMnemonic; - Length: ZydisU8; - Data: array[0..ZYDIS_MAX_INSTRUCTION_LENGTH - 1] of ZydisU8; - Encoding: TZydisInstructionEncoding; - OpcodeMap: TZydisOpcodeMap; - Opcode: ZydisU8; - OperandSize: ZydisU8; - StackWidth: ZydisU8; - AddressWidth: ZydisU8; - OperandCount: ZydisU8; - Operands: array[0..ZYDIS_MAX_OPERAND_COUNT - 1] of TZydisDecodedOperand; - Attributes: TZydisInstructionAttributes; - InstructionAddress: ZydisU64; - AccessedFlags: array[TZydisCPUFlag] of TZydisCPUFlagAction; - AVX: TZydisDecodedInstructionAVX; - Meta: TZydisDecodedInstructionMeta; - Raw: TZydisDecodedInstructionRaw; - end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisDecoderMode *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisDecoderMode = ( - ZYDIS_DECODER_MODE_MINIMAL, - ZYDIS_DECODER_MODE_AMD_BRANCHES, - ZYDIS_DECODER_MODE_KNC, - ZYDIS_DECODER_MODE_MPX, - ZYDIS_DECODER_MODE_CET, - ZYDIS_DECODER_MODE_LZCNT, - ZYDIS_DECODER_MODE_TZCNT, - ZYDIS_DECODER_MODE_WBNOINVD, - - ZYDIS_DECODER_MODE_MAX_VALUE = ZYDIS_DECODER_MODE_WBNOINVD - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisDecoder *} -{* ---------------------------------------------------------------------------------------------- *} - - PZydisDecoder = ^TZydisDecoder; - TZydisDecoder = record - public - MachineMode: TZydisMachineMode; - AddressWidth: TZydisAddressWidth; - DecoderMode: array[TZydisDecoderMode] of ZydisBool; - end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisFormatterStyle *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisFormatterStyle = ( - ZYDIS_FORMATTER_STYLE_INTEL - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisFormatterProperty *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisFormatterProperty = ( - ZYDIS_FORMATTER_PROP_UPPERCASE, - ZYDIS_FORMATTER_PROP_FORCE_MEMSEG, - ZYDIS_FORMATTER_PROP_FORCE_MEMSIZE, - ZYDIS_FORMATTER_PROP_ADDR_FORMAT, - ZYDIS_FORMATTER_PROP_DISP_FORMAT, - ZYDIS_FORMATTER_PROP_IMM_FORMAT, - ZYDIS_FORMATTER_PROP_HEX_UPPERCASE, - ZYDIS_FORMATTER_PROP_HEX_PREFIX, - ZYDIS_FORMATTER_PROP_HEX_SUFFIX, - ZYDIS_FORMATTER_PROP_HEX_PADDING_ADDR, - ZYDIS_FORMATTER_PROP_HEX_PADDING_DISP, - ZYDIS_FORMATTER_PROP_HEX_PADDING_IMM, - - ZYDIS_FORMATTER_PROP_MAX_VALUE = ZYDIS_FORMATTER_PROP_HEX_PADDING_IMM - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisAddressFormat *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisAddressFormat = ( - ZYDIS_ADDR_FORMAT_ABSOLUTE, - ZYDIS_ADDR_FORMAT_RELATIVE_SIGNED, - ZYDIS_ADDR_FORMAT_RELATIVE_UNSIGNED, - - ZYDIS_ADDR_FORMAT_MAX_VALUE = ZYDIS_ADDR_FORMAT_RELATIVE_UNSIGNED - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisDisplacementFormat *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisDisplacementFormat = ( - ZYDIS_DISP_FORMAT_AUTO, - ZYDIS_DISP_FORMAT_HEX_SIGNED, - ZYDIS_DISP_FORMAT_HEX_UNSIGNED, - - ZYDIS_DISP_FORMAT_MAX_VALUE = ZYDIS_DISP_FORMAT_HEX_UNSIGNED - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisImmediateFormat *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisImmediateFormat = ( - ZYDIS_IMM_FORMAT_AUTO, - ZYDIS_IMM_FORMAT_HEX_SIGNED, - ZYDIS_IMM_FORMAT_HEX_UNSIGNED, - - ZYDIS_IMM_FORMAT_MAX_VALUE = ZYDIS_IMM_FORMAT_HEX_UNSIGNED - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisFormatterHookType *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisFormatterHookType = ( - ZYDIS_FORMATTER_HOOK_PRE_INSTRUCTION, - ZYDIS_FORMATTER_HOOK_POST_INSTRUCTION, - ZYDIS_FORMATTER_HOOK_PRE_OPERAND, - ZYDIS_FORMATTER_HOOK_POST_OPERAND, - ZYDIS_FORMATTER_HOOK_FORMAT_INSTRUCTION, - ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_REG, - ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_MEM, - ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_PTR, - ZYDIS_FORMATTER_HOOK_FORMAT_OPERAND_IMM, - ZYDIS_FORMATTER_HOOK_PRINT_MNEMONIC, - ZYDIS_FORMATTER_HOOK_PRINT_REGISTER, - ZYDIS_FORMATTER_HOOK_PRINT_ADDRESS, - ZYDIS_FORMATTER_HOOK_PRINT_DISP, - ZYDIS_FORMATTER_HOOK_PRINT_IMM, - ZYDIS_FORMATTER_HOOK_PRINT_MEMSIZE, - ZYDIS_FORMATTER_HOOK_PRINT_PREFIXES, - ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR, - - ZYDIS_FORMATTER_HOOK_MAX_VALUE = ZYDIS_FORMATTER_HOOK_PRINT_DECORATOR - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisDecoratorType *} -{* ---------------------------------------------------------------------------------------------- *} - - {$Z1} - TZydisDecoratorType = ( - ZYDIS_DECORATOR_TYPE_INVALID, - ZYDIS_DECORATOR_TYPE_MASK, - ZYDIS_DECORATOR_TYPE_BC, - ZYDIS_DECORATOR_TYPE_RC, - ZYDIS_DECORATOR_TYPE_SAE, - ZYDIS_DECORATOR_TYPE_SWIZZLE, - ZYDIS_DECORATOR_TYPE_CONVERSION, - ZYDIS_DECORATOR_TYPE_EH, - - ZYDIS_DECORATOR_TYPE_MAX_VALUE = ZYDIS_DECORATOR_TYPE_EH - ); - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisFormatter *} -{* ---------------------------------------------------------------------------------------------- *} - - PZydisFormatter = ^TZydisFormatter; - - TZydisFormatterFunc = - function(const Formatter: PZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; UserData: Pointer): TZydisStatus; cdecl; - - TZydisFormatterOperandFunc = - function(const Formatter: PZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand; - UserData: Pointer): TZydisStatus; cdecl; - - TZydisFormatterRegisterFunc = - function(const Formatter: PZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand; - Reg: TZydisRegister; UserData: Pointer): TZydisStatus; cdecl; - - TZydisFormatterAddressFunc = - function(const Formatter: PZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand; - Address: ZydisU64; UserData: Pointer): TZydisStatus; cdecl; - - TZydisFormatterDecoratorFunc = - function(const Formatter: PZydisFormatter; var Str: TZydisString; - const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand; - Decorator: TZydisDecoratorType; UserData: Pointer): TZydisStatus; cdecl; - - TZydisFormatter = record - public - LetterCase: TZydisLetterCase; - ForceMemorySegment: ZydisBool; - ForceMemorySize: ZydisBool; - FormatAddress: TZydisAddressFormat; - FormatDisp: TZydisDisplacementFormat; - FormatImm: TZydisImmediateFormat; - HexUppercase: ZydisBool; - HexPrefix: PZydisString; - HexPrefixData: TZydisString; - HexSuffix: PZydisString; - HexSuffixData: TZydisString; - HexPaddingAddress: ZydisU8; - HexPaddingDisp: ZydisU8; - HexPaddingImm: ZydisU8; - FuncPreInstruction: TZydisFormatterFunc; - FuncPostInstruction: TZydisFormatterFunc; - FuncPreOperand: TZydisFormatterOperandFunc; - FuncPostOperand: TZydisFormatterOperandFunc; - FuncFormatInstruction: TZydisFormatterFunc; - FuncPostOperandReg: TZydisFormatterOperandFunc; - FuncPostOperandMem: TZydisFormatterOperandFunc; - FuncPostOperandPtr: TZydisFormatterOperandFunc; - FuncPostOperandImm: TZydisFormatterOperandFunc; - FuncPrintMnemonic: TZydisFormatterFunc; - FuncPrintRegister: TZydisFormatterRegisterFunc; - FuncPrintAddress: TZydisFormatterAddressFunc; - FuncPrintDisp: TZydisFormatterOperandFunc; - FuncPrintImm: TZydisFormatterOperandFunc; - FuncPrintMemSize: TZydisFormatterOperandFunc; - FuncPrintPrefixes: TZydisFormatterFunc; - FuncPrintDecorator: TZydisFormatterDecoratorFunc; - end; - -{* ---------------------------------------------------------------------------------------------- *} - -{* ============================================================================================== *} -{* Imports *} -{* ============================================================================================== *} - -{$IFDEF ZYDIS_DYNAMIC_LINK} -const - {$IFDEF CPUX86} - ZYDIS_LIBRARY_NAME = 'Zydis32.dll'; - {$ENDIF} - {$IFDEF CPUX64} - ZYDIS_LIBRARY_NAME = 'Zydis64.dll'; - {$ENDIF} - ZYDIS_SYMBOL_PREFIX = ''; -{$ELSE} - {$IFDEF CPUX86} -const - ZYDIS_SYMBOL_PREFIX = '_'; - {$L '../Bin32/Decoder.obj'} - {$L '../Bin32/DecoderData.obj'} - {$L '../Bin32/Formatter.obj'} - {$L '../Bin32/MetaInfo.obj'} - {$L '../Bin32/Mnemonic.obj'} - {$L '../Bin32/Register.obj'} - {$L '../Bin32/SharedData.obj'} - {$L '../Bin32/String.obj'} - {$L '../Bin32/Utils.obj'} - {$L '../Bin32/Zydis.obj'} - {$ENDIF} - {$IFDEF CPUX64} -const - ZYDIS_SYMBOL_PREFIX = ''; - {$L '../Bin64/Decoder.obj'} - {$L '../Bin64/DecoderData.obj'} - {$L '../Bin64/Formatter.obj'} - {$L '../Bin64/MetaInfo.obj'} - {$L '../Bin64/Mnemonic.obj'} - {$L '../Bin64/Register.obj'} - {$L '../Bin64/SharedData.obj'} - {$L '../Bin64/String.obj'} - {$L '../Bin64/Utils.obj'} - {$L '../Bin64/Zydis.obj'} - {$ENDIF} -{$ENDIF} - -{* ---------------------------------------------------------------------------------------------- *} -{* Zydis *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisGetVersion: ZydisU64; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetVersion'; - -{* ---------------------------------------------------------------------------------------------- *} -{* String *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisStringInit(var Str: TZydisString; const Value: PAnsiChar): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringInit'; - -function ZydisStringFinalize(var Str: TZydisString): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringFinalize'; - -function ZydisStringAppend(var Str: TZydisString; const Text: PZydisString): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppend'; - -function ZydisStringAppendEx(var Str: TZydisString; const Text: PZydisString; - LetterCase: TZydisLetterCase): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendEx'; - -function ZydisStringAppendC(var Str: TZydisString; const Text: PAnsiChar): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendC'; - -function ZydisStringAppendExC(var Str: TZydisString; const Text: PAnsiChar; - LetterCase: TZydisLetterCase): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendExC'; - -function ZydisStringAppendDecU(var Str: TZydisString; Value: ZydisU64; - PaddingLength: ZydisU8): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendDecU'; - -function ZydisStringAppendDecS(var Str: TZydisString; Value: ZydisI64; - PaddingLength: ZydisU8): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendDecS'; - -function ZydisStringAppendHexU(var Str: TZydisString; Value: ZydisU64; PaddingLength: ZydisU8; - UpperCase: ZydisBool; const Prefix, Suffix: PZydisString): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendHexU'; - -function ZydisStringAppendHexS(var Str: TZydisString; Value: ZydisI64; PaddingLength: ZydisU8; - UpperCase: ZydisBool; const Prefix, Suffix: PZydisString): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisStringAppendHexS'; - -{* ---------------------------------------------------------------------------------------------- *} -{* Register *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisRegisterEncode(RegisterClass: TZydisRegisterClass; - Id: ZydisU8): TZydisRegister; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterEncode'; - -function ZydisRegisterGetId(Reg: TZydisRegister): ZydisI16; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterGetId'; - -function ZydisRegisterGetClass(Reg: TZydisRegister): TZydisRegisterClass; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterGetClass'; - -function ZydisRegisterGetWidth(Reg: TZydisRegister): TZydisRegisterWidth; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterGetWidth'; - -function ZydisRegisterGetWidth64(Reg: TZydisRegister): TZydisRegisterWidth; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterGetWidth64'; - -function ZydisRegisterGetString(Reg: TZydisRegister): PAnsiChar; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterGetString'; - -function ZydisRegisterGetStaticString(Reg: TZydisRegister): PZydisStaticString; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisRegisterGetStaticString'; - -{* ---------------------------------------------------------------------------------------------- *} -{* Mnemonic *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisMnemonicGetString(Mnemonic: TZydisMnemonic): PAnsiChar; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisMnemonicGetString'; - -function ZydisMnemonicGetStaticString(Mnemonic: TZydisMnemonic): PZydisStaticString; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisMnemonicGetStaticString'; - -{* ---------------------------------------------------------------------------------------------- *} -{* MetaInfo *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisCategoryGetString(Category: TZydisInstructionCategory): PAnsiChar; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisCategoryGetString'; - -function ZydisISASetGetString(ISASet: TZydisISASet): PAnsiChar; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisISASetGetString'; - -function ZydisISAExtGetString(ISAExt: TZydisISAExt): PAnsiChar; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisISAExtGetString'; - -{* ---------------------------------------------------------------------------------------------- *} -{* Decoder *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisDecoderInit(var Decoder: TZydisDecoder; MachineMode: TZydisMachineMode; - AddressWidth: TZydisAddressWidth): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisDecoderInit'; - -function ZydisDecoderEnableMode(var Decoder: TZydisDecoder; DecoderMode: TZydisDecoderMode; - Enabled: ZydisBool): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisDecoderEnableMode'; - -function ZydisDecoderDecodeBuffer(const Decoder: PZydisDecoder; Buffer: Pointer; - BufferLen: ZydisUSize; InstructionPointer: ZydisU64; - var Instruction: TZydisDecodedInstruction): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisDecoderDecodeBuffer'; - -{* ---------------------------------------------------------------------------------------------- *} -{* Formatter *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisFormatterInit(var Formatter: TZydisFormatter; - Style: TZydisFormatterStyle): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterInit'; - -function ZydisFormatterSetProperty(var Formatter: TZydisFormatter; - &Property: TZydisFormatterProperty; Value: ZydisUPointer): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterSetProperty'; - -function ZydisFormatterSetHook(var Formatter: TZydisFormatter; - Hook: TZydisFormatterHookType; var Callback: Pointer): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterSetHook'; - -function ZydisFormatterFormatInstruction(const Formatter: PZydisFormatter; - const Instruction: PZydisDecodedInstruction; Buffer: Pointer; - BufferLen: ZydisUSize): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterFormatInstruction'; - -function ZydisFormatterFormatInstructionEx(const Formatter: PZydisFormatter; - const Instruction: PZydisDecodedInstruction; Buffer: Pointer; - BufferLen: ZydisUSize; UserData: Pointer): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterFormatInstructionEx'; - -function ZydisFormatterFormatOperand(const Formatter: PZydisFormatter; - const Instruction: PZydisDecodedInstruction; Index: ZydisU8; Buffer: Pointer; - BufferLen: ZydisUSize): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterFormatOperand'; - -function ZydisFormatterFormatOperandEx(const Formatter: PZydisFormatter; - const Instruction: PZydisDecodedInstruction; Index: ZydisU8; Buffer: Pointer; - BufferLen: ZydisUSize; UserData: Pointer): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisFormatterFormatOperandEx'; - -{* ---------------------------------------------------------------------------------------------- *} -{* Utils *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisCalcAbsoluteAddress(const Instruction: PZydisDecodedInstruction; - const Operand: PZydisDecodedOperand; var Address: ZydisU64): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisCalcAbsoluteAddress'; - -function ZydisGetAccessedFlagsByAction(const Instruction: PZydisDecodedInstruction; - Action: TZydisCPUFlagAction; var Flags: TZydisCPUFlagMask): TZydisStatus; cdecl; - external {$IFDEF ZYDIS_DYNAMIC_LINK}ZYDIS_LIBRARY_NAME{$ENDIF} - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetAccessedFlagsByAction'; - -{* ---------------------------------------------------------------------------------------------- *} - -{* ============================================================================================== *} -{* Macros *} -{* ============================================================================================== *} - -{* ---------------------------------------------------------------------------------------------- *} -{* Zydis *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisVersionMajor(Version: ZydisU64): ZydisU16; inline; -function ZydisVersionMinor(Version: ZydisU64): ZydisU16; inline; -function ZydisVersionPatch(Version: ZydisU64): ZydisU16; inline; -function ZydisVersionBuild(Version: ZydisU64): ZydisU16; inline; - -{* ---------------------------------------------------------------------------------------------- *} -{* Status *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisSuccess(Status: TZydisStatus): Boolean; inline; - -{* ---------------------------------------------------------------------------------------------- *} - -{* ============================================================================================== *} -{* Helper *} -{* ============================================================================================== *} - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisString *} -{* ---------------------------------------------------------------------------------------------- *} - -type - TZydisStringHelper = record helper for TZydisString - public - function Init(Buffer: PAnsiChar; Capacity: ZydisUSize): TZydisStatus; overload; inline; - function Init(const Text: PAnsiChar): TZydisStatus; overload; inline; - function Append(const Value: TZydisString): TZydisStatus; overload; inline; - function Append(const Value: PAnsiChar): TZydisStatus; overload; inline; - end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisMnemonic *} -{* ---------------------------------------------------------------------------------------------- *} - -type - TZydisMnemonicHelper = record helper for TZydisMnemonic - public - function ToString: String; inline; - end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisRegister *} -{* ---------------------------------------------------------------------------------------------- *} - -type - TZydisRegisterHelper = record helper for TZydisRegister - public - function ToString: String; inline; - end; - -{* ---------------------------------------------------------------------------------------------- *} - -{* ============================================================================================== *} - -implementation - -{* ============================================================================================== *} -{* Internal symbols *} -{* ============================================================================================== *} - -{$IFNDEF ZYDIS_DYNAMIC_LINK} -procedure ZydisDecoderTreeGetRootNode; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisDecoderTreeGetRootNode'; -procedure ZydisDecoderTreeGetChildNode; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisDecoderTreeGetChildNode'; -procedure ZydisGetInstructionEncodingInfo; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetInstructionEncodingInfo'; -procedure ZydisGetInstructionDefinition; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetInstructionDefinition'; -procedure ZydisGetOperandDefinitions; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetOperandDefinitions'; -procedure ZydisGetElementInfo; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetElementInfo'; -procedure ZydisGetAccessedFlags; external - name ZYDIS_SYMBOL_PREFIX + 'ZydisGetAccessedFlags'; - -{$IFDEF CPUX86} -procedure __allmul; assembler; -asm - mov eax, dword ptr[esp+8] - mov ecx, dword ptr[esp+10h] - or ecx, eax - mov ecx, dword ptr[esp+0Ch] - jne @@hard - mov eax, dword ptr[esp+4] - mul ecx - ret 10h -@@hard: - push ebx - mul ecx - mov ebx, eax - mov eax, dword ptr[esp+8] - mul dword ptr[esp+14h] - add ebx, eax - mov eax, dword ptr[esp+8] - mul ecx - add edx, ebx - pop ebx - ret 10h -end; - -procedure __aulldiv; assembler; -asm - push ebx - push esi - mov eax,dword ptr [esp+18h] - or eax,eax - jne @@L1 - mov ecx,dword ptr [esp+14h] - mov eax,dword ptr [esp+10h] - xor edx,edx - div ecx - mov ebx,eax - mov eax,dword ptr [esp+0Ch] - div ecx - mov edx,ebx - jmp @@L2 -@@L1: - mov ecx,eax - mov ebx,dword ptr [esp+14h] - mov edx,dword ptr [esp+10h] - mov eax,dword ptr [esp+0Ch] -@@L3: - shr ecx,1 - rcr ebx,1 - shr edx,1 - rcr eax,1 - or ecx,ecx - jne @@L3 - div ebx - mov esi,eax - mul dword ptr [esp+18h] - mov ecx,eax - mov eax,dword ptr [esp+14h] - mul esi - add edx,ecx - jb @@L4 - cmp edx,dword ptr [esp+10h] - ja @@L4 - jb @@L5 - cmp eax,dword ptr [esp+0Ch] - jbe @@L5 -@@L4: - dec esi -@@L5: - xor edx,edx - mov eax,esi -@@L2: - pop esi - pop ebx - ret 10h -end; - -procedure __aullshr; assembler; -asm - cmp cl,40h - jae @@RETZERO - cmp cl,20h - jae @@MORE32 - shrd eax,edx,cl - shr edx,cl - ret -@@MORE32: - mov eax,edx - xor edx,edx - and cl,1Fh - shr eax,cl - ret -@@RETZERO: - xor eax,eax - xor edx,edx - ret -end; -{$ENDIF} - -{$IFDEF CPUX86} -procedure _memcpy(destination: Pointer; const source: Pointer; num: NativeUInt); cdecl; -{$ENDIF} -{$IFDEF CPUX64} -procedure memcpy(destination: Pointer; const source: Pointer; num: NativeUInt); cdecl; -{$ENDIF} -begin - Move(source^, destination^, num); -end; - -{$IFDEF CPUX86} -procedure _memset(ptr: Pointer; value: Integer; num: NativeUInt); cdecl; -{$ENDIF} -{$IFDEF CPUX64} -procedure memset(ptr: Pointer; value: Integer; num: NativeUInt); cdecl; -{$ENDIF} -begin - FillChar(ptr^, num, value); -end; -{$ENDIF} - -{* ============================================================================================== *} -{* Macros *} -{* ============================================================================================== *} - -{* ---------------------------------------------------------------------------------------------- *} -{* Zydis *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisVersionMajor(Version: ZydisU64): ZydisU16; -begin - Result := (Version and $FFFF000000000000) shr 48; -end; - -function ZydisVersionMinor(Version: ZydisU64): ZydisU16; -begin - Result := (Version and $0000FFFF00000000) shr 32; -end; - -function ZydisVersionPatch(Version: ZydisU64): ZydisU16; -begin - Result := (Version and $00000000FFFF0000) shr 16; -end; - -function ZydisVersionBuild(Version: ZydisU64): ZydisU16; -begin - Result := (Version and $000000000000FFFF); -end; - -{* ---------------------------------------------------------------------------------------------- *} -{* Status *} -{* ---------------------------------------------------------------------------------------------- *} - -function ZydisSuccess(Status: TZydisStatus): Boolean; -begin - Result := (Status = ZYDIS_STATUS_SUCCESS); -end; - -{* ---------------------------------------------------------------------------------------------- *} - -{* ============================================================================================== *} -{* Helper *} -{* ============================================================================================== *} - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisString *} -{* ---------------------------------------------------------------------------------------------- *} - -function TZydisStringHelper.Append(const Value: TZydisString): TZydisStatus; -begin - Result := ZydisStringAppend(Self, @Value); -end; - -function TZydisStringHelper.Append(const Value: PAnsiChar): TZydisStatus; -begin - Result := ZydisStringAppendC(Self, Value); -end; - -function TZydisStringHelper.Init(Buffer: PAnsiChar; Capacity: ZydisUSize): TZydisStatus; -begin - if (not Assigned(Buffer)) or (Capacity = 0) then - begin - Exit(ZYDIS_STATUS_INVALID_PARAMETER); - end; - Self.Buffer := Buffer; - Self.Length := 0; - Self.Capacity := Capacity; - Result := ZYDIS_STATUS_SUCCESS; -end; - -function TZydisStringHelper.Init(const Text: PAnsiChar): TZydisStatus; -begin - Result := ZydisStringInit(Self, Text); -end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisRegister *} -{* ---------------------------------------------------------------------------------------------- *} - -function TZydisRegisterHelper.ToString: String; -var - S: PAnsiChar; -begin - Result := ''; - S := ZydisRegisterGetString(Self); - if Assigned(S) then - begin - Result := String(AnsiString(S)); - end; -end; - -{* ---------------------------------------------------------------------------------------------- *} -{* ZydisMnemonic *} -{* ---------------------------------------------------------------------------------------------- *} - -function TZydisMnemonicHelper.ToString: String; -var - S: PAnsiChar; -begin - Result := ''; - S := ZydisMnemonicGetString(Self); - if Assigned(S) then - begin - Result := String(AnsiString(S)); - end; -end; - -{* ---------------------------------------------------------------------------------------------- *} - -{* ============================================================================================== *} - -end. diff --git a/Zydis/stdinth.inc b/Zydis/stdinth.inc new file mode 100644 index 0000000..8098df2 --- /dev/null +++ b/Zydis/stdinth.inc @@ -0,0 +1,97 @@ + +type + int64_t = Int64; + uint8_t = byte; + + uint16_t = word; + uint32_t = dword; + uint64_t = UInt64; + int_least8_t = AnsiChar; + int_least16_t = smallint; + int_least32_t = longint; + int_least64_t = int64; + uint_least8_t = byte; + uint_least16_t = word; + uint_least32_t = dword; + uint_least64_t = UInt64; + + int_fast8_t = shortint; + int_fast16_t = longint; + int_fast32_t = longint; + int_fast64_t = int64; + uint_fast8_t = byte; + + uint_fast16_t = dword; + uint_fast32_t = dword; + uint_fast64_t = UInt64; + + intptr_t = longint; + uintptr_t = dword; + intmax_t = Int64; + uintmax_t = UInt64; + +const + INT8_MIN = -(128); + INT16_MIN = (-(32767)) - 1; + INT32_MIN = (-(2147483647)) - 1; + INT64_MIN = int64_t(-int64_t(9223372036854775807)-1); + + INT8_MAX = 127; + INT16_MAX = 32767; + INT32_MAX = 2147483647; + INT64_MAX = int64_t(9223372036854775807); + + UINT8_MAX = 255; + UINT16_MAX = 65535; + UINT32_MAX = 4294967295; + UINT64_MAX = uint64_t(-1); + + INT_LEAST8_MIN = -(128); + INT_LEAST16_MIN = (-(32767)) - 1; + INT_LEAST32_MIN = (-(2147483647)) - 1; + INT_LEAST64_MIN = int_least64_t(-int64_t(9223372036854775807)-1); + + INT_LEAST8_MAX = 127; + INT_LEAST16_MAX = 32767; + INT_LEAST32_MAX = 2147483647; + INT_LEAST64_MAX = int_least64_t(9223372036854775807); + + UINT_LEAST8_MAX = 255; + UINT_LEAST16_MAX = 65535; + UINT_LEAST32_MAX = 4294967295; + UINT_LEAST64_MAX = uint_least64_t(-1); + + INT_FAST8_MIN = -(128); + INT_FAST16_MIN = (-(2147483647)) - 1; + INT_FAST32_MIN = (-(2147483647)) - 1; + INT_FAST64_MIN = int_fast64_t(-Int64(9223372036854775807)-1); + + INT_FAST8_MAX = 127; + INT_FAST16_MAX = 2147483647; + INT_FAST32_MAX = 2147483647; + INT_FAST64_MAX = int_fast64_t(9223372036854775807); + + UINT_FAST8_MAX = 255; + UINT_FAST16_MAX = 4294967295; + UINT_FAST32_MAX = 4294967295; + UINT_FAST64_MAX = uint_fast64_t(-1); + + INTPTR_MIN = (-(2147483647)) - 1; + INTPTR_MAX = 2147483647; + UINTPTR_MAX = 4294967295; + + INTMAX_MIN = Int64(-Int64(9223372036854775807)-1); + INTMAX_MAX = Int64(9223372036854775807); + UINTMAX_MAX = UInt64(-1); + + PTRDIFF_MIN = (-(2147483647)) - 1; + PTRDIFF_MAX = 2147483647; + + SIG_ATOMIC_MIN = (-(2147483647)) - 1; + SIG_ATOMIC_MAX = 2147483647; + + SIZE_MAX = 4294967295; + + WINT_MIN = 0; + WINT_MAX = 4294967295; + diff --git a/libs/Delphi/x32/Decoder.obj b/libs/Delphi/x32/Decoder.obj new file mode 100644 index 0000000..81b83a2 Binary files /dev/null and b/libs/Delphi/x32/Decoder.obj differ diff --git a/libs/Delphi/x32/DecoderData.obj b/libs/Delphi/x32/DecoderData.obj new file mode 100644 index 0000000..14f4968 Binary files /dev/null and b/libs/Delphi/x32/DecoderData.obj differ diff --git a/libs/Delphi/x32/Disassembler.obj b/libs/Delphi/x32/Disassembler.obj new file mode 100644 index 0000000..b50a2f1 Binary files /dev/null and b/libs/Delphi/x32/Disassembler.obj differ diff --git a/libs/Delphi/x32/Encoder.obj b/libs/Delphi/x32/Encoder.obj new file mode 100644 index 0000000..8d008fe Binary files /dev/null and b/libs/Delphi/x32/Encoder.obj differ diff --git a/libs/Delphi/x32/EncoderData.obj b/libs/Delphi/x32/EncoderData.obj new file mode 100644 index 0000000..241561e Binary files /dev/null and b/libs/Delphi/x32/EncoderData.obj differ diff --git a/libs/Delphi/x32/Formatter.obj b/libs/Delphi/x32/Formatter.obj new file mode 100644 index 0000000..cbff60a Binary files /dev/null and b/libs/Delphi/x32/Formatter.obj differ diff --git a/libs/Delphi/x32/FormatterATT.obj b/libs/Delphi/x32/FormatterATT.obj new file mode 100644 index 0000000..7351774 Binary files /dev/null and b/libs/Delphi/x32/FormatterATT.obj differ diff --git a/libs/Delphi/x32/FormatterBase.obj b/libs/Delphi/x32/FormatterBase.obj new file mode 100644 index 0000000..23d6b41 Binary files /dev/null and b/libs/Delphi/x32/FormatterBase.obj differ diff --git a/libs/Delphi/x32/FormatterBuffer.obj b/libs/Delphi/x32/FormatterBuffer.obj new file mode 100644 index 0000000..44283f9 Binary files /dev/null and b/libs/Delphi/x32/FormatterBuffer.obj differ diff --git a/libs/Delphi/x32/FormatterIntel.obj b/libs/Delphi/x32/FormatterIntel.obj new file mode 100644 index 0000000..7c590c4 Binary files /dev/null and b/libs/Delphi/x32/FormatterIntel.obj differ diff --git a/libs/Delphi/x32/MetaInfo.obj b/libs/Delphi/x32/MetaInfo.obj new file mode 100644 index 0000000..dce82ee Binary files /dev/null and b/libs/Delphi/x32/MetaInfo.obj differ diff --git a/libs/Delphi/x32/Mnemonic.obj b/libs/Delphi/x32/Mnemonic.obj new file mode 100644 index 0000000..885b167 Binary files /dev/null and b/libs/Delphi/x32/Mnemonic.obj differ diff --git a/libs/Delphi/x32/Register.obj b/libs/Delphi/x32/Register.obj new file mode 100644 index 0000000..d985aa0 Binary files /dev/null and b/libs/Delphi/x32/Register.obj differ diff --git a/libs/Delphi/x32/Segment.obj b/libs/Delphi/x32/Segment.obj new file mode 100644 index 0000000..219aca3 Binary files /dev/null and b/libs/Delphi/x32/Segment.obj differ diff --git a/libs/Delphi/x32/SharedData.obj b/libs/Delphi/x32/SharedData.obj new file mode 100644 index 0000000..a8dc80b Binary files /dev/null and b/libs/Delphi/x32/SharedData.obj differ diff --git a/libs/Delphi/x32/String.obj b/libs/Delphi/x32/String.obj new file mode 100644 index 0000000..8a95d1e Binary files /dev/null and b/libs/Delphi/x32/String.obj differ diff --git a/libs/Delphi/x32/Utils.obj b/libs/Delphi/x32/Utils.obj new file mode 100644 index 0000000..0e4e783 Binary files /dev/null and b/libs/Delphi/x32/Utils.obj differ diff --git a/libs/Delphi/x32/Zydis.obj b/libs/Delphi/x32/Zydis.obj new file mode 100644 index 0000000..1114d4d Binary files /dev/null and b/libs/Delphi/x32/Zydis.obj differ diff --git a/libs/Delphi/x64/Decoder.obj b/libs/Delphi/x64/Decoder.obj new file mode 100644 index 0000000..45cb32d Binary files /dev/null and b/libs/Delphi/x64/Decoder.obj differ diff --git a/libs/Delphi/x64/DecoderData.obj b/libs/Delphi/x64/DecoderData.obj new file mode 100644 index 0000000..3f2ee15 Binary files /dev/null and b/libs/Delphi/x64/DecoderData.obj differ diff --git a/libs/Delphi/x64/Disassembler.obj b/libs/Delphi/x64/Disassembler.obj new file mode 100644 index 0000000..539ca1c Binary files /dev/null and b/libs/Delphi/x64/Disassembler.obj differ diff --git a/libs/Delphi/x64/Encoder.obj b/libs/Delphi/x64/Encoder.obj new file mode 100644 index 0000000..ca815b6 Binary files /dev/null and b/libs/Delphi/x64/Encoder.obj differ diff --git a/libs/Delphi/x64/EncoderData.obj b/libs/Delphi/x64/EncoderData.obj new file mode 100644 index 0000000..c5c0f9b Binary files /dev/null and b/libs/Delphi/x64/EncoderData.obj differ diff --git a/libs/Delphi/x64/Formatter.obj b/libs/Delphi/x64/Formatter.obj new file mode 100644 index 0000000..3129cc1 Binary files /dev/null and b/libs/Delphi/x64/Formatter.obj differ diff --git a/libs/Delphi/x64/FormatterATT.obj b/libs/Delphi/x64/FormatterATT.obj new file mode 100644 index 0000000..8d48d8d Binary files /dev/null and b/libs/Delphi/x64/FormatterATT.obj differ diff --git a/libs/Delphi/x64/FormatterBase.obj b/libs/Delphi/x64/FormatterBase.obj new file mode 100644 index 0000000..a3d8785 Binary files /dev/null and b/libs/Delphi/x64/FormatterBase.obj differ diff --git a/libs/Delphi/x64/FormatterBuffer.obj b/libs/Delphi/x64/FormatterBuffer.obj new file mode 100644 index 0000000..aa62c6f Binary files /dev/null and b/libs/Delphi/x64/FormatterBuffer.obj differ diff --git a/libs/Delphi/x64/FormatterIntel.obj b/libs/Delphi/x64/FormatterIntel.obj new file mode 100644 index 0000000..c2f9842 Binary files /dev/null and b/libs/Delphi/x64/FormatterIntel.obj differ diff --git a/libs/Delphi/x64/MetaInfo.obj b/libs/Delphi/x64/MetaInfo.obj new file mode 100644 index 0000000..f7daa54 Binary files /dev/null and b/libs/Delphi/x64/MetaInfo.obj differ diff --git a/libs/Delphi/x64/Mnemonic.obj b/libs/Delphi/x64/Mnemonic.obj new file mode 100644 index 0000000..7f7860b Binary files /dev/null and b/libs/Delphi/x64/Mnemonic.obj differ diff --git a/libs/Delphi/x64/Register.obj b/libs/Delphi/x64/Register.obj new file mode 100644 index 0000000..71e48eb Binary files /dev/null and b/libs/Delphi/x64/Register.obj differ diff --git a/libs/Delphi/x64/Segment.obj b/libs/Delphi/x64/Segment.obj new file mode 100644 index 0000000..cb9b39e Binary files /dev/null and b/libs/Delphi/x64/Segment.obj differ diff --git a/libs/Delphi/x64/SharedData.obj b/libs/Delphi/x64/SharedData.obj new file mode 100644 index 0000000..7ec2b30 Binary files /dev/null and b/libs/Delphi/x64/SharedData.obj differ diff --git a/libs/Delphi/x64/String.obj b/libs/Delphi/x64/String.obj new file mode 100644 index 0000000..4a10751 Binary files /dev/null and b/libs/Delphi/x64/String.obj differ diff --git a/libs/Delphi/x64/Utils.obj b/libs/Delphi/x64/Utils.obj new file mode 100644 index 0000000..d9b59af Binary files /dev/null and b/libs/Delphi/x64/Utils.obj differ diff --git a/libs/Delphi/x64/Zydis.obj b/libs/Delphi/x64/Zydis.obj new file mode 100644 index 0000000..0a04743 Binary files /dev/null and b/libs/Delphi/x64/Zydis.obj differ diff --git a/libs/FPC/linux/x64/libZycore.a b/libs/FPC/linux/x64/libZycore.a new file mode 100644 index 0000000..b9523d3 Binary files /dev/null and b/libs/FPC/linux/x64/libZycore.a differ diff --git a/libs/FPC/linux/x64/libZydis.a b/libs/FPC/linux/x64/libZydis.a new file mode 100644 index 0000000..9fdd96e Binary files /dev/null and b/libs/FPC/linux/x64/libZydis.a differ diff --git a/libs/FPC/windows/x64/libZycore.a b/libs/FPC/windows/x64/libZycore.a new file mode 100644 index 0000000..2bb21e8 Binary files /dev/null and b/libs/FPC/windows/x64/libZycore.a differ diff --git a/libs/FPC/windows/x64/libZydis.a b/libs/FPC/windows/x64/libZydis.a new file mode 100644 index 0000000..75f94b8 Binary files /dev/null and b/libs/FPC/windows/x64/libZydis.a differ diff --git a/libs/Zydis32.dll b/libs/Zydis32.dll new file mode 100644 index 0000000..c9e3887 Binary files /dev/null and b/libs/Zydis32.dll differ diff --git a/libs/Zydis64.dll b/libs/Zydis64.dll new file mode 100644 index 0000000..d25f6ef Binary files /dev/null and b/libs/Zydis64.dll differ