From 78df3b3a064598746d1fb6d167bbdcb289f0ece0 Mon Sep 17 00:00:00 2001 From: flobernd Date: Wed, 28 Feb 2018 23:28:08 +0100 Subject: [PATCH] Reorganized examples --- .../{CustomFormatter => }/CustomFormatter.dpr | 8 +- Examples/CustomFormatter.dproj | 124 ++++++++++++++++++ .../{CustomFormatter => }/CustomFormatter.res | Bin Examples/Examples.groupproj | 41 ++++++ Examples/{SimpleDemo => }/SimpleDemo.dpr | 8 +- Examples/SimpleDemo.dproj | 124 ++++++++++++++++++ Examples/{SimpleDemo => }/SimpleDemo.res | Bin Zydis/Zydis.Decoder.pas | 2 +- Zydis/Zydis.Formatter.pas | 5 +- 9 files changed, 300 insertions(+), 12 deletions(-) rename Examples/{CustomFormatter => }/CustomFormatter.dpr (97%) create mode 100644 Examples/CustomFormatter.dproj rename Examples/{CustomFormatter => }/CustomFormatter.res (100%) create mode 100644 Examples/Examples.groupproj rename Examples/{SimpleDemo => }/SimpleDemo.dpr (94%) create mode 100644 Examples/SimpleDemo.dproj rename Examples/{SimpleDemo => }/SimpleDemo.res (100%) diff --git a/Examples/CustomFormatter/CustomFormatter.dpr b/Examples/CustomFormatter.dpr similarity index 97% rename from Examples/CustomFormatter/CustomFormatter.dpr rename to Examples/CustomFormatter.dpr index ca235e5..61b7324 100644 --- a/Examples/CustomFormatter/CustomFormatter.dpr +++ b/Examples/CustomFormatter.dpr @@ -32,10 +32,10 @@ program CustomFormatter; uses System.SysUtils, - 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'; + 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'; {* ============================================================================================== *} {* Formatter *} diff --git a/Examples/CustomFormatter.dproj b/Examples/CustomFormatter.dproj new file mode 100644 index 0000000..718c6e4 --- /dev/null +++ b/Examples/CustomFormatter.dproj @@ -0,0 +1,124 @@ + + + {2F0CE0AE-FA5B-40AF-A42A-F03C996A119D} + 18.3 + None + CustomFormatter.dpr + True + Debug + Win64 + 3 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + CustomFormatter + + + 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) + + + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + 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) + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + 1033 + (Ohne) + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + 1033 + (Ohne) + + + + MainSource + + + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + + + diff --git a/Examples/CustomFormatter/CustomFormatter.res b/Examples/CustomFormatter.res similarity index 100% rename from Examples/CustomFormatter/CustomFormatter.res rename to Examples/CustomFormatter.res diff --git a/Examples/Examples.groupproj b/Examples/Examples.groupproj new file mode 100644 index 0000000..77c942a --- /dev/null +++ b/Examples/Examples.groupproj @@ -0,0 +1,41 @@ + + + {D2FEAC7B-BA6A-4F35-B075-A47A8CB9AE80} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/SimpleDemo/SimpleDemo.dpr b/Examples/SimpleDemo.dpr similarity index 94% rename from Examples/SimpleDemo/SimpleDemo.dpr rename to Examples/SimpleDemo.dpr index ae60ed0..c2b81fe 100644 --- a/Examples/SimpleDemo/SimpleDemo.dpr +++ b/Examples/SimpleDemo.dpr @@ -32,10 +32,10 @@ program SimpleDemo; uses System.SysUtils, - 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'; + 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'; {* ============================================================================================== *} {* Entry point *} diff --git a/Examples/SimpleDemo.dproj b/Examples/SimpleDemo.dproj new file mode 100644 index 0000000..c946cd6 --- /dev/null +++ b/Examples/SimpleDemo.dproj @@ -0,0 +1,124 @@ + + + {B67489E9-839F-402C-93DB-B014EBB1B4B4} + 18.3 + None + SimpleDemo.dpr + True + Debug + Win64 + 3 + Console + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + .\$(Platform)\$(Config) + .\$(Platform)\$(Config) + false + false + false + false + false + SimpleDemo + + + 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) + + + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + 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 + (Ohne) + Zydis.ico + + + DEBUG;$(DCC_Define) + true + false + true + true + true + + + false + 1033 + (Ohne) + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + 1033 + (Ohne) + + + + MainSource + + + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + + + diff --git a/Examples/SimpleDemo/SimpleDemo.res b/Examples/SimpleDemo.res similarity index 100% rename from Examples/SimpleDemo/SimpleDemo.res rename to Examples/SimpleDemo.res diff --git a/Zydis/Zydis.Decoder.pas b/Zydis/Zydis.Decoder.pas index 0d77757..1ec0d80 100644 --- a/Zydis/Zydis.Decoder.pas +++ b/Zydis/Zydis.Decoder.pas @@ -32,7 +32,7 @@ interface System.SysUtils, Zydis, Zydis.Exception; type - TZydisDecoder = class(TObject) + TZydisDecoder = class sealed(TObject) strict private FContext: Zydis.TZydisDecoder; public diff --git a/Zydis/Zydis.Formatter.pas b/Zydis/Zydis.Formatter.pas index d48791b..1922910 100644 --- a/Zydis/Zydis.Formatter.pas +++ b/Zydis/Zydis.Formatter.pas @@ -156,9 +156,8 @@ TZydisFormatter = class(TObject) var Str: TZydisString; const Instruction: TZydisDecodedInstruction; const Operand: TZydisDecodedOperand; Decorator: TZydisDecoratorType): TZydisStatus; virtual; public - function FormatInstruction(const Instruction: TZydisDecodedInstruction): String; inline; - function FormatOperand(const Instruction: TZydisDecodedInstruction; - Index: ZydisU8): String; inline; + function FormatInstruction(const Instruction: TZydisDecodedInstruction): String; + function FormatOperand(const Instruction: TZydisDecodedInstruction; Index: ZydisU8): String; public constructor Create(Style: TZydisFormatterStyle); public