Commited internally used InstructionEditor

This commit is contained in:
flobernd 2016-08-23 16:11:42 +02:00
parent 54f2bc43ac
commit 0cfed163a0
28 changed files with 15900 additions and 0 deletions

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

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

View File

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

View File

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

View File

@ -0,0 +1,199 @@
object frmEditorInstructionOperands: TfrmEditorInstructionOperands
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'frmEditorInstructionOperands'
ClientHeight = 462
ClientWidth = 640
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
OnDestroy = FormDestroy
PixelsPerInch = 96
TextHeight = 13
object GroupBox: TGroupBox
AlignWithMargins = True
Left = 3
Top = 420
Width = 634
Height = 39
Margins.Top = 0
Align = alBottom
TabOrder = 0
DesignSize = (
634
39)
object btnCancel: TButton
Left = 514
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Cancel'
ImageIndex = 1
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 1
OnClick = btnCancelClick
end
object btnApply: TButton
Left = 396
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Apply'
ImageIndex = 0
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 0
OnClick = btnApplyClick
end
end
object PageControl1: TPageControl
AlignWithMargins = True
Left = 3
Top = 3
Width = 634
Height = 414
ActivePage = TabSheet1
Align = alClient
TabOrder = 1
object TabSheet1: TTabSheet
Caption = 'Instruction Operands'
object GroupBox1: TGroupBox
AlignWithMargins = True
Left = 3
Top = 3
Width = 238
Height = 380
Align = alLeft
TabOrder = 0
end
end
end
object imgIcons16: TcxImageList
FormatVersion = 1
DesignInfo = 1049152
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
20000000000000040000000000000000000000000000000000000000001B0000
0033000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000001B00000000004B29A00089
49FF008747FF008747FF008747FF008747FF008747FF008747FF008747FF0087
47FF008747FF008747FF008747FF008949FF004B29A000000000008949FF07E4
A4FF07E5A5FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4
A4FF07E4A4FF07E4A4FF07E5A5FF07E4A4FF008949FF00000000008747FF13E7
AAFF00DB9BFF00DA9AFF00DA99FF00DA99FF00DA99FF00DA99FF00DA9AFF00DA
9AFF00DA9AFF00DA9AFF00DB9BFF13E7AAFF008747FF00000000008746FF1EE7
AEFF00D699FF00D698FF00D495FF00D391FF00D391FF00D495FF00D698FF00D6
99FF00D699FF00D699FF00D699FF1EE7AEFF008746FF00000000008746FF2AE9
B3FF00D299FF00D095FF00CC8DFFFFFFFFFFFFFFFFFF00CC8DFF00D096FF00D2
99FF00D29AFF00D29AFF00D29AFF2AE9B3FF008746FF00000000008746FF35EA
B7FF00CD96FF00C98DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C98DFF00CD
96FF00CF99FF00CF9AFF00CF9AFF36EAB8FF008746FF00000000008745FF3EEB
BBFF00C692FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C4
8DFF00C995FF00CA99FF00CA99FF41ECBDFF008745FF00000000008745FF4BED
BFFF00C393FFFFFFFFFFFFFFFFFF00C08BFF00BF8BFFFFFFFFFFFFFFFFFFFFFF
FFFF00C18EFF00C596FF00C699FF4DEDC0FF008745FF00000000008744FF58EF
C5FF00C197FF00BF93FF00C093FF00C196FF00C196FF00BC8EFFFFFFFFFFFFFF
FFFFFFFFFFFF00BC8EFF00C096FF58EFC5FF008744FF00000000008744FF64F1
CAFF00BE99FF00C099FF00C09AFF00C19BFF00C19AFF00BE97FF00B98EFFFFFF
FFFFFFFFFFFFFFFFFFFF00BA92FF62F0C9FF008744FF00000000008744FF71F2
CFFF00BB99FF00BD9AFF00BE9BFF00BE9BFF00BE9BFF00BE9AFF00BB96FF00B6
8EFFFFFFFFFFFFFFFFFF00B792FF6EF2CDFF008744FF00000000008744FF7BF4
D3FF00B699FF00B89AFF00B99BFF00B99BFF00B99BFF00B99BFF00B89AFF00B7
98FF00B494FF00B493FF00B496FF7AF3D3FF008744FF00000000008744FF86F5
D8FF00B198FF00B299FF00B399FF00B399FF00B399FF00B399FF00B399FF00B2
99FF00B298FF00B297FF00B197FF86F5D8FF008744FF00000000008946FF8AF2
D9FF92F6DEFF93F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6
DDFF94F6DDFF93F6DDFF92F6DEFF8AF2D9FF008946FF00000000004B29880089
46FF008743FF008643FF008643FF008643FF008643FF008643FF008643FF0086
43FF008643FF008643FF008743FF008946FF004B298800000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0013000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000003300000013000000001117
487E2D3CC0FF2B3BBEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3A
BEFF2A3ABEFF2A3ABEFF2A3ABEFF2B3BBEFF2D3CC0FF1117487E000000002D3D
C0FF6172FAFF6A7DFFFF697CFFFF6D80FFFF7485FFFF7788FFFF7788FFFF7788
FFFF7485FFFF6D7FFFFF697CFFFF6A7DFFFF6172FAFF2D3DC0FF000000002B3B
BEFF6578FFFF5F73FEFF6F80FFFF7989FFFF5868E6FF3E4ED0FF3F4FD1FF3E4E
D0FF5767E5FF7887FEFF6E7FFFFF5F73FEFF6578FFFF2B3BBEFF000000002B3B
BEFF5D72FFFF697BFEFF7785F8FF3949CAFF1E2A89B70B0F303F07091D26070A
1F552636B9FF5A6FFDFF576CFAFF687AFCFF5D71FFFF2B3BBEFF000000002C3B
BFFF586EFEFF8593FFFF3B4BCAFF0E143F530000000000000000000000332B3A
BDFF5970FEFF546AFBFF7F8FFFFF8290FDFF586EFEFF2C3BBFFF000000002C3C
BFFF536BFCFF707CE7FF1E2A89BB0000000000000000000000332C3BBEFF546B
FBFF5067F8FF8796FFFF3B4BCDFF6D79E5FF536AFCFF2C3CBFFF000000002D3D
BFFF4F68FBFF4E5BD1FF0B0F304500000000000000332C3BBEFF4E66F9FF4A63
F6FF8C99FFFF2737BCFF07091F314D5AD0FF4F68FBFF2D3DBFFF000000002E3D
C0FF4A64F9FF3446CDFF07091D2D000000332D3CBEFF4862F7FF445DF4FF8E9C
FFFF2838BDFF0000000007091D313446CDFF4A64F9FF2E3DC0FF000000002E3D
C0FF4660F7FF3445CCFF080A20552D3CBEFF445DF4FF3F59F1FF929FFFFF2838
BDFF00000000000000000C0F305B3445CDFF4660F7FF2E3DC0FF000000002E3E
C0FF405BF3FF384DDBFF2E3CBCFF3E59F2FF3954EFFF95A2FFFF2838BDFF0000
00000000000000000011222D8AC5384EDCFF405BF3FF2E3EC0FF000000002F3E
C0FF3955F0FF3951EAFF3954EEFF3651EDFF9AA5FFFF2838BDFF000000080000
000D0000002510153F753041C8FF3A53EBFF3A55F0FF2F3EC0FF000000002E3D
BFFF3A54EFFF324DE9FF334DE9FF324DEBFF2A39BCFF070A1F5507091D510B0F
3065212D8AC52F41C8FF314CE4FF324DEBFF3A54EFFF2E3DBFFF000000002B3B
BFFF6A7DFDFF334EE8FF2643E4FF2642E3FF253CD4FF2739C7FF273AC8FF273A
C8FF263DD5FF2743E5FF2643E6FF334EE9FF6A7DFDFF2B3BBFFF000000002B3B
C0FF929DFCFFAAB3FFFFAAB3FFFFAAB3FFFFAAB4FFFFAAB4FFFFAAB4FFFFAAB4
FFFFAAB4FFFFAAB3FFFFAAB3FFFFAAB3FFFF929DFCFF2B3BC0FF000000001117
485E2A3AC0FF2838BFFF2737BEFF2737BEFF2737BEFF2737BFFF2737BFFF2737
BFFF2737BEFF2737BEFF2737BEFF2838BFFF2A3AC0FF1117485E}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000300000
0033000000330000003300000033000000330000003300000033000000330000
00330000002F0000000000000000000000000000000000000000A36B31F2AB6E
31FFAA6B2DFFAA6C2FFFAA6D31FFAA6D31FFAA6D31FFAA6C2FFFAA6B2DFFAB6E
31FFA26A31F10000000000000000000000000000000000000000AB6E31FFEEAF
60FFFFF7DEFFE9A95BFFEAAB5EFFEAAB5FFFEAAB5EFFE9A95AFFFFF7DEFFEEAF
60FFAB6E30FF0000003300000033000000330000003300000023AA6B2DFFFFF6
DDFFFCEDD2FFFCEFD5FFFDF1D9FFFDF0D7FFFCEED4FFFCEDD2FFFCEDD1FFFFF6
DDFFA8692BFFAB6E31FFAA6C2FFFAA6B2DFFAB6E2FFF784F24C0AA6C2EFFE8B0
68FFFDEED4FFDD9C4FFFDEA054FFDD9E52FFFDEFD6FFDA9747FFFCEDD1FFE7AE
67FFA56628FFEEAF62FFEAA95BFFFFF6DCFFF4C180FFAB6D2FFFAA6C2FFFE7B4
72FFFEF1D8FFD99C52FFDBA159FFDBA058FFD99C51FFFDEFD5FFFCEDD2FFE6B2
6FFFA36324FFFFF5DCFFFCEDD2FFFCECCFFFFFF5DAFFA96B2CFFAA6C2FFFE8B7
78FFFEF1D8FFD59A53FFD89F5AFFD89F5BFFD69C56FFDDAD70FFFEEFD5FFE7B5
76FFA46324FFFFF4DBFFE2AC68FFFBEBCEFFF2CC98FFAA6B2CFFAA6C2FFFE7B9
7FFFFFF1D7FFD0954FFFD39B57FFD39B58FFD29A55FFD0954EFFFFF3DAFFE6B9
7FFFA56627FFDDA054FFFDF0D6FFFCECD1FFEEC189FFAA6B2DFFAA6C2EFFE7BB
84FFFEF0D5FFCA8F4AFFCD9552FFD7A668FFE8BF8BFFE8BE89FFE6BC86FFE9BF
8AFFA6672AFFDAA05AFFD4974EFFFDEFD4FFEEC590FFAA6B2DFFAA6C2EFFE5BD
8AFFFDEED2FFFFF1D6FFC58D48FFE6C08EFFBF894FFFA66728FFA56426FFE9C5
94FFA6672AFFD59D58FFD1964FFFFFF2D9FFEECA96FFAA6C2EFFAA6B2CFFE5C0
8EFFFDECD0FFBB813AFFFFF0D5FFECCDA3FFA56526FFDBA25AFFE8C89CFFCFA2
6EFFBF894DFFE9C18DFFE8BF8AFFE6BC86FFE9C08AFFAB6D2FFFAA6B2BFFFFF5
DAFFFDECCEFFFDECCFFFFEEED2FFEBCEA6FFA56322FFE8CAA0FFCEA16EFFB173
31FFE8C390FFC08950FFA66728FFA56426FFEBC695FFAC6E30FFAB6D2EFFE6CB
A3FFFFF5D9FFE2C59AFFE3C69DFFE5C9A1FFE7CCA4FFCDA371FFAE6E2AFFFFF4
DAFFE6C392FFA66627FFDCA35AFFE9CA9EFFD3A773FF754C22AC784E24B0AB6D
2EFFAA6B2BFFAA6B2BFFAA6B2CFFAA6A2AFFA76524FFC79865FFFFF3D7FFFFF0
D4FFE4C396FFA56323FFE9CCA2FFD2A775FF70481FA700000000000000000000
0000000000000000000000000000AD6F31FFE9D0A9FFFFF9DFFFE3C69CFFE3C7
9EFFE6CAA2FFE8CFA7FFD1AA7AFF70471FA70000000000000000000000000000
0000000000000000000000000000774E24AFAB6C2EFFC18E58FFA9692AFFAA6B
2CFFAB6C2EFFAC6D2FFF754B21AC000000000000000000000000}
end>
end
end

View File

@ -0,0 +1,80 @@
unit formEditorInstructionOperands;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, System.ImageList, Vcl.ImgList, cxGraphics,
Vcl.StdCtrls, untInstructionEditor;
type
TfrmEditorInstructionOperands = class(TForm)
GroupBox: TGroupBox;
btnCancel: TButton;
btnApply: TButton;
imgIcons16: TcxImageList;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
GroupBox1: TGroupBox;
procedure FormCreate(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure btnApplyClick(Sender: TObject);
strict private
FApplyChanges: Boolean;
FEditor: TInstructionEditor;
FDefinition: TInstructionDefinition;
strict private
function GetOperands: TInstructionOperands; inline;
procedure SetOperands(const Value: TInstructionOperands); inline;
public
property ApplyChanges: Boolean read FApplyChanges;
property Operands: TInstructionOperands read GetOperands write SetOperands;
end;
var
frmEditorInstructionOperands: TfrmEditorInstructionOperands;
implementation
{$R *.dfm}
{ TfrmEditorInstructionOperands }
procedure TfrmEditorInstructionOperands.btnApplyClick(Sender: TObject);
begin
FApplyChanges := true;
Close;
end;
procedure TfrmEditorInstructionOperands.btnCancelClick(Sender: TObject);
begin
Close;
end;
procedure TfrmEditorInstructionOperands.FormCreate(Sender: TObject);
begin
FEditor := TInstructionEditor.Create;
FEditor.Reset;
FDefinition := FEditor.CreateDefinition('dummy');
end;
procedure TfrmEditorInstructionOperands.FormDestroy(Sender: TObject);
begin
if (Assigned(FEditor)) then
begin
FEditor.Free;
end;
end;
function TfrmEditorInstructionOperands.GetOperands: TInstructionOperands;
begin
Result := FDefinition.Operands;
end;
procedure TfrmEditorInstructionOperands.SetOperands(const Value: TInstructionOperands);
begin
FDefinition.Operands.Assign(Value);
end;
end.

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,329 @@
object frmGenerator: TfrmGenerator
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = 'Generator'
ClientHeight = 371
ClientWidth = 544
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object GroupBox: TGroupBox
AlignWithMargins = True
Left = 3
Top = 329
Width = 538
Height = 39
Margins.Top = 0
Align = alBottom
TabOrder = 0
DesignSize = (
538
39)
object btnClose: TButton
Left = 418
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Close'
ImageIndex = 1
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 1
OnClick = btnCloseClick
end
object btnGenerate: TButton
Left = 300
Top = 7
Width = 112
Height = 25
Anchors = [akTop, akRight]
Caption = 'Generate'
ImageIndex = 0
ImageMargins.Left = 2
ImageMargins.Top = 2
Images = imgIcons16
TabOrder = 0
OnClick = btnGenerateClick
end
end
object TreeView: TVirtualStringTree
AlignWithMargins = True
Left = 3
Top = 3
Width = 538
Height = 323
Align = alClient
Header.AutoSizeIndex = 0
Header.Font.Charset = DEFAULT_CHARSET
Header.Font.Color = clWindowText
Header.Font.Height = -11
Header.Font.Name = 'Tahoma'
Header.Font.Style = []
Header.Options = [hoAutoResize, hoVisible]
Images = imgTreeView
TabOrder = 1
TreeOptions.MiscOptions = [toFullRepaintOnResize, toInitOnSave, toToggleOnDblClick, toWheelPanning, toEditOnClick]
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toShowHorzGridLines, toShowTreeLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines, toAlwaysHideSelection, toUseBlendedSelection]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnBeforeCellPaint = TreeViewBeforeCellPaint
OnCollapsing = TreeViewCollapsing
OnFreeNode = TreeViewFreeNode
OnGetText = TreeViewGetText
OnGetImageIndex = TreeViewGetImageIndex
Columns = <
item
Position = 0
Width = 384
WideText = 'Name'
end
item
Alignment = taRightJustify
Position = 1
Width = 150
WideText = 'Value'
end>
end
object imgIcons16: TcxImageList
FormatVersion = 1
DesignInfo = 2097208
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
20000000000000040000000000000000000000000000000000000000001B0000
0033000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000001B00000000004B29A00089
49FF008747FF008747FF008747FF008747FF008747FF008747FF008747FF0087
47FF008747FF008747FF008747FF008949FF004B29A000000000008949FF07E4
A4FF07E5A5FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4A4FF07E4
A4FF07E4A4FF07E4A4FF07E5A5FF07E4A4FF008949FF00000000008747FF13E7
AAFF00DB9BFF00DA9AFF00DA99FF00DA99FF00DA99FF00DA99FF00DA9AFF00DA
9AFF00DA9AFF00DA9AFF00DB9BFF13E7AAFF008747FF00000000008746FF1EE7
AEFF00D699FF00D698FF00D495FF00D391FF00D391FF00D495FF00D698FF00D6
99FF00D699FF00D699FF00D699FF1EE7AEFF008746FF00000000008746FF2AE9
B3FF00D299FF00D095FF00CC8DFFFFFFFFFFFFFFFFFF00CC8DFF00D096FF00D2
99FF00D29AFF00D29AFF00D29AFF2AE9B3FF008746FF00000000008746FF35EA
B7FF00CD96FF00C98DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C98DFF00CD
96FF00CF99FF00CF9AFF00CF9AFF36EAB8FF008746FF00000000008745FF3EEB
BBFF00C692FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00C4
8DFF00C995FF00CA99FF00CA99FF41ECBDFF008745FF00000000008745FF4BED
BFFF00C393FFFFFFFFFFFFFFFFFF00C08BFF00BF8BFFFFFFFFFFFFFFFFFFFFFF
FFFF00C18EFF00C596FF00C699FF4DEDC0FF008745FF00000000008744FF58EF
C5FF00C197FF00BF93FF00C093FF00C196FF00C196FF00BC8EFFFFFFFFFFFFFF
FFFFFFFFFFFF00BC8EFF00C096FF58EFC5FF008744FF00000000008744FF64F1
CAFF00BE99FF00C099FF00C09AFF00C19BFF00C19AFF00BE97FF00B98EFFFFFF
FFFFFFFFFFFFFFFFFFFF00BA92FF62F0C9FF008744FF00000000008744FF71F2
CFFF00BB99FF00BD9AFF00BE9BFF00BE9BFF00BE9BFF00BE9AFF00BB96FF00B6
8EFFFFFFFFFFFFFFFFFF00B792FF6EF2CDFF008744FF00000000008744FF7BF4
D3FF00B699FF00B89AFF00B99BFF00B99BFF00B99BFF00B99BFF00B89AFF00B7
98FF00B494FF00B493FF00B496FF7AF3D3FF008744FF00000000008744FF86F5
D8FF00B198FF00B299FF00B399FF00B399FF00B399FF00B399FF00B399FF00B2
99FF00B298FF00B297FF00B197FF86F5D8FF008744FF00000000008946FF8AF2
D9FF92F6DEFF93F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6DDFF94F6
DDFF94F6DDFF93F6DDFF92F6DEFF8AF2D9FF008946FF00000000004B29880089
46FF008743FF008643FF008643FF008643FF008643FF008643FF008643FF0086
43FF008643FF008643FF008743FF008946FF004B298800000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0013000000330000003300000033000000330000003300000033000000330000
0033000000330000003300000033000000330000003300000013000000001117
487E2D3CC0FF2B3BBEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3ABEFF2A3A
BEFF2A3ABEFF2A3ABEFF2A3ABEFF2B3BBEFF2D3CC0FF1117487E000000002D3D
C0FF6172FAFF6A7DFFFF697CFFFF6D80FFFF7485FFFF7788FFFF7788FFFF7788
FFFF7485FFFF6D7FFFFF697CFFFF6A7DFFFF6172FAFF2D3DC0FF000000002B3B
BEFF6578FFFF5F73FEFF6F80FFFF7989FFFF5868E6FF3E4ED0FF3F4FD1FF3E4E
D0FF5767E5FF7887FEFF6E7FFFFF5F73FEFF6578FFFF2B3BBEFF000000002B3B
BEFF5D72FFFF697BFEFF7785F8FF3949CAFF1E2A89B70B0F303F07091D26070A
1F552636B9FF5A6FFDFF576CFAFF687AFCFF5D71FFFF2B3BBEFF000000002C3B
BFFF586EFEFF8593FFFF3B4BCAFF0E143F530000000000000000000000332B3A
BDFF5970FEFF546AFBFF7F8FFFFF8290FDFF586EFEFF2C3BBFFF000000002C3C
BFFF536BFCFF707CE7FF1E2A89BB0000000000000000000000332C3BBEFF546B
FBFF5067F8FF8796FFFF3B4BCDFF6D79E5FF536AFCFF2C3CBFFF000000002D3D
BFFF4F68FBFF4E5BD1FF0B0F304500000000000000332C3BBEFF4E66F9FF4A63
F6FF8C99FFFF2737BCFF07091F314D5AD0FF4F68FBFF2D3DBFFF000000002E3D
C0FF4A64F9FF3446CDFF07091D2D000000332D3CBEFF4862F7FF445DF4FF8E9C
FFFF2838BDFF0000000007091D313446CDFF4A64F9FF2E3DC0FF000000002E3D
C0FF4660F7FF3445CCFF080A20552D3CBEFF445DF4FF3F59F1FF929FFFFF2838
BDFF00000000000000000C0F305B3445CDFF4660F7FF2E3DC0FF000000002E3E
C0FF405BF3FF384DDBFF2E3CBCFF3E59F2FF3954EFFF95A2FFFF2838BDFF0000
00000000000000000011222D8AC5384EDCFF405BF3FF2E3EC0FF000000002F3E
C0FF3955F0FF3951EAFF3954EEFF3651EDFF9AA5FFFF2838BDFF000000080000
000D0000002510153F753041C8FF3A53EBFF3A55F0FF2F3EC0FF000000002E3D
BFFF3A54EFFF324DE9FF334DE9FF324DEBFF2A39BCFF070A1F5507091D510B0F
3065212D8AC52F41C8FF314CE4FF324DEBFF3A54EFFF2E3DBFFF000000002B3B
BFFF6A7DFDFF334EE8FF2643E4FF2642E3FF253CD4FF2739C7FF273AC8FF273A
C8FF263DD5FF2743E5FF2643E6FF334EE9FF6A7DFDFF2B3BBFFF000000002B3B
C0FF929DFCFFAAB3FFFFAAB3FFFFAAB3FFFFAAB4FFFFAAB4FFFFAAB4FFFFAAB4
FFFFAAB4FFFFAAB3FFFFAAB3FFFFAAB3FFFF929DFCFF2B3BC0FF000000001117
485E2A3AC0FF2838BFFF2737BEFF2737BEFF2737BEFF2737BFFF2737BFFF2737
BFFF2737BEFF2737BEFF2737BEFF2838BFFF2A3AC0FF1117485E}
end>
end
object imgTreeView: TcxImageList
FormatVersion = 1
DesignInfo = 2097288
ImageInfo = <
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000300000
0033000000330000003300000033000000330000003300000033000000330000
00330000003300000033000000330000002F00000000000000004190C6F24398
D2FF4094D0FF3E92CFFF3E92CEFF3F92CEFF3F92CEFF3F92CEFF3F92CEFF3F92
CEFF3F92CEFF3F92CEFF3F93CFFF3D8BC2F00000000E000000004499D2FF3F94
D0FFABFBFFFF9BF3FFFF92F1FFFF93F1FFFF93F1FFFF93F1FFFF93F1FFFF93F1
FFFF93F1FFFF93F1FFFFA6F8FFFF65B8E3FF122A3A5F000000004398D2FF4FA6
D9FF8EDAF5FFA2EEFFFF82E5FEFF84E5FEFF84E5FEFF85E6FEFF85E6FEFF85E6
FEFF85E6FEFF84E6FEFF96EBFFFF8CD8F5FF296088B8000000004296D1FF6BBE
E8FF6DBDE6FFBBF2FFFF75DEFDFF77DEFCFF78DEFCFF7BDFFCFF7DDFFCFF7DDF
FCFF7DDFFCFF7CDFFCFF80E0FDFFADF0FFFF4D9DD3FF0000000E4095D0FF8AD7
F5FF44A1D8FFDDFDFFFFDAFAFFFFDBFAFFFFDEFAFFFF74DCFCFF76DBFAFF75DA
FAFF74DAFAFF74DAFAFF72D9FAFFA1E8FFFF7CBFE6FF12293A5E3E94D0FFABF0
FFFF449DD6FF368CCBFF368CCBFF368CCBFF378BCBFF5CBEEAFF6FD9FBFF6AD6
FAFF68D5F9FF67D4F9FF66D4F9FF82DEFCFFAAE0F6FF296088B93D92CFFFB9F4
FFFF73DBFBFF6BCCF2FF6CCDF3FF6CCEF3FF6DCEF3FF479CD4FF56BAE9FFDAF8
FFFFD7F6FFFFD6F6FFFFD5F6FFFFD5F7FFFFDBFCFFFF3E94D0FF3C92CFFFC0F3
FFFF71DAFBFF74DBFBFF75DBFCFF75DBFCFF76DCFCFF73DAFAFF449CD4FF378C
CBFF368CCBFF358CCCFF348DCCFF3890CEFF3D94D0FF3E8CC2EB3B92CFFFCAF6
FFFF69D5F9FF6CD5F9FF6BD5F9FF69D5F9FF69D5FAFF6AD7FBFF68D4FAFF5EC7
F1FF5EC7F2FF5DC8F2FFB4E3F8FF3D94D0FF1A3B5269000000003B92CFFFD5F7
FFFF60D1F9FF61D0F8FFB4EBFDFFD9F6FFFFDAF8FFFFDAF8FFFFDBF9FFFFDCFA
FFFFDCFAFFFFDCFBFFFFE0FFFFFF3E95D0FF0E1F2A33000000003D94D0FFDCFC
FFFFD8F7FFFFD8F7FFFFDBFAFFFF358ECDFF3991CEFF3A92CFFF3A92CFFF3A92
CFFF3A92CFFF3B92CFFF3D94D0FF3880B1D700000000000000002E6991B03D94
D0FF3A92CFFF3A92CFFF3D94D0FF367CACD20000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000001E00000033000000330000
00330000001E0000000000000000000000000000000000000000000000000000
00000000000000000000000000000000001E3B3B3BAC636363FF626263FF6363
63FF3B3B3BAC0000001E00000000000000000000000000000000000000000000
00000000000000000000000000003B3B3BAC6F6E6EFF95918FFF989492FF9591
8FFF6F6E6EFF3B3B3BAC00000000000000000000000000000000000000000000
0000000000000000000000000000636464FF858381FF878481FF868381FF8784
81FF858381FF636464FF00000000000000000000000000000000000000000000
0000000000000000000000000000626363FF8E8C8BFF767371FF767371FF7673
71FF8E8C8BFF626363FF00000000000000000000000000000000000000000000
0000000000000000000000000000626363FFA7A5A5FF7D7B7AFF787675FF7D7B
7AFFA7A5A5FF626363FF00000000000000000000000000000000000000000000
00000000000000000000000000003B3B3B976F6E6EFFA6A5A4FFA9A8A9FFA6A5
A4FF6D6E6EFF3B3B3B9700000000000000000000000000000000000000000000
0000000000000000000000000000000000003B3B3B97626262FF616161FF6262
62FF3B3B3B970000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000024000000330000
002F000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000005F31C100C684FF007D
41ED000000290000000000000000000000000000000000000000000000000000
00000000000000000024000000330000003300000033008847FF00E4A6FF00BE
80FF006F3BD90000002100000000000000000000000000000000000000000000
000000000000005F31C1008A48FF008847FF008746FF008847FF00D9A1FF00D8
A0FF00BC80FF005A2FB900000022000000000000000000000000000000000000
000000000000008947FF43E8C2FF00D7A0FF00D7A0FF00D59FFF00D09CFF00D0
9CFF00D39FFF00B981FF005D32BD000000000000000000000000000000000000
000000000000008845FF6FE8D0FF00C899FF00C899FF00C899FF00C797FF00C8
98FF00CA9AFF63E6CDFF008A47FF000000000000000000000000000000000000
000000000000008946FF99F0E4FF4FE9D5FF51E8D4FF4DE6D1FF94E8D8FF00C3
97FF60E0C7FF00B281FF005E31AC000000000000000000000000000000000000
000000000000005F32B2008946FF008744FF008642FF008847FF82E4D6FF5ADA
C4FF00AD7FFF005A2EA700000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000008847FF7AE4D8FF00AA
7FFF006F39CF0000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000005F32B200AA85FF007E
40E9000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end
item
Image.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000001E00000033000000330000
00330000001E0000000000000000000000000000000000000000000000000000
00000000000000000000000000000000001E6E4F11ACB78319FFB68218FFB783
19FF6E4F11AC0000001E00000000000000000000000000000000000000000000
00000000000000000000000000006E4F11ACC5922FFFEDC074FFF1C47AFFEDC0
74FFC5922FFF6E4F11AC00000000000000000000000000000000000000000000
0000000000000000000000000000B7841AFFEAB45CFFE9B45CFFE8B35BFFE9B4
5CFFEAB45CFFB7841AFF00000000000000000000000000000000000000000000
0000000000000000000000000000B78219FFEBB964FFE3A641FFE3A641FFE3A6
41FFEBB964FFB78219FF00000000000000000000000000000000000000000000
0000000000000000000000000000B78319FFEEC684FFE5AA49FFE2A641FFE5AA
49FFEEC684FFB78319FF00000000000000000000000000000000000000000000
00000000000000000000000000006E4F1197C6922EFFECC482FFEFC886FFECC4
82FFC6912CFF6E4F119700000000000000000000000000000000000000000000
0000000000000000000000000000000000006E4F1197B78319FFB68217FFB783
19FF6E4F11970000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000}
end>
end
end

View File

@ -0,0 +1,395 @@
unit formGenerator;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, VirtualTrees, System.ImageList, Vcl.ImgList, cxGraphics,
Vcl.StdCtrls, untInstructionEditor;
type
TfrmGenerator = class(TForm)
GroupBox: TGroupBox;
btnClose: TButton;
btnGenerate: TButton;
imgIcons16: TcxImageList;
TreeView: TVirtualStringTree;
imgTreeView: TcxImageList;
procedure FormCreate(Sender: TObject);
procedure TreeViewCollapsing(Sender: TBaseVirtualTree; Node: PVirtualNode;
var Allowed: Boolean);
procedure TreeViewFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure TreeViewGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode;
Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean; var ImageIndex: Integer);
procedure TreeViewGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex;
TextType: TVSTTextType; var CellText: string);
procedure btnCloseClick(Sender: TObject);
procedure btnGenerateClick(Sender: TObject);
procedure TreeViewBeforeCellPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas;
Node: PVirtualNode; Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect;
var ContentRect: TRect);
strict private
FEditor: TInstructionEditor;
FProgressNodeTotal: PVirtualNode;
FProgressNode: array[TGeneratorWorkOperation] of PVirtualNode;
FInfoNode: array[0..6] of PVirtualNode;
FCurrentOperation: TGeneratorWorkOperation;
strict private
procedure GeneratorWorkStart(Sender: TObject; Operation: TGeneratorWorkOperation; MinWorkCount,
MaxWorkCount: Integer);
procedure GeneratorWork(Sender: TObject; WorkCount: Integer);
procedure GeneratorWorkEnd(Sender: TObject);
public
property Editor: TInstructionEditor read FEditor write FEditor;
end;
var
frmGenerator: TfrmGenerator;
implementation
uses
untHelperClasses;
{$R *.dfm}
type
TGeneratorNodeType = (ntCategory, ntSpacer, ntOperation, ntValue);
PGeneratorNodeData = ^TGeneratorNodeData;
TGeneratorNodeData = record
public
NodeType: TGeneratorNodeType;
Text: String;
ProgressActive: Boolean;
ProgressMax: Integer;
ProgressUpdateStep: Integer;
Progress: Double;
Value: String;
public
procedure ProgressInit(MaxWorkCount: Integer; MinWorkCount: Integer); inline;
procedure ProgressUpdate(NewProgress: Double); inline;
procedure WorkCountUpdate(WorkCount: Integer); inline;
function IsProgressUpdateStep(WorkCount: Integer): Boolean; inline;
end;
{ TGeneratorNodeData }
function TGeneratorNodeData.IsProgressUpdateStep(WorkCount: Integer): Boolean;
begin
Assert(NodeType = ntOperation);
Result := ((WorkCount mod ProgressUpdateStep) = 0);
end;
procedure TGeneratorNodeData.ProgressInit(MaxWorkCount, MinWorkCount: Integer);
begin
Assert(NodeType = ntOperation);
ProgressMax := (MaxWorkCount - MinWorkCount);
ProgressUpdateStep := Round(ProgressMax / 100) + 1;
end;
procedure TGeneratorNodeData.ProgressUpdate(NewProgress: Double);
var
Format: TFormatSettings;
begin
Assert(NodeType = ntOperation);
Progress := NewProgress;
Format.DecimalSeparator := '.';
Value := FormatFloat('0.00', Progress * 100, Format) + '%';
end;
procedure TGeneratorNodeData.WorkCountUpdate(WorkCount: Integer);
begin
Assert(NodeType = ntOperation);
if (ProgressMax = 0) then
begin
ProgressUpdate(1.0);
end else
begin
ProgressUpdate(WorkCount / ProgressMax);
end;
end;
{ TfrmGenerator }
procedure TfrmGenerator.btnCloseClick(Sender: TObject);
begin
Close;
end;
procedure TfrmGenerator.btnGenerateClick(Sender: TObject);
procedure SetInfoNodeValue(Node: PVirtualNode; const Value: String);
var
NodeData: PGeneratorNodeData;
begin
NodeData := TreeView.GetNodeData(Node);
NodeData^.Value := Value;
end;
var
Generator: TTableGenerator;
Node: PVirtualNode;
NodeData: PGeneratorNodeData;
I: Integer;
begin
TreeView.BeginUpdate;
try
for Node in FProgressNode do
begin
NodeData := TreeView.GetNodeData(Node);
NodeData^.ProgressActive := false;
NodeData^.ProgressUpdate(0);
end;
NodeData := TreeView.GetNodeData(FProgressNodeTotal);
NodeData^.ProgressActive := false;
NodeData^.ProgressUpdate(0);
finally
TreeView.EndUpdate;
end;
Generator := TTableGenerator.Create;
try
Generator.OnWorkStart := GeneratorWorkStart;
Generator.OnWork := GeneratorWork;
Generator.OnWorkEnd := GeneratorWorkEnd;
Generator.GenerateFiles(FEditor,
'D:\Verteron Development\GitHub\zyan-disassembler-engine old\include\Zydis\Internal\');
TreeView.BeginUpdate;
try
for I := Low(FInfoNode) to High(FInfoNode) do
begin
case I of
0: SetInfoNodeValue(FInfoNode[I], IntToStr(Generator.Statistics.FilterCount));
1: SetInfoNodeValue(FInfoNode[I], IntToStr(Generator.Statistics.DefinitionCount));
2: SetInfoNodeValue(FInfoNode[I], IntToStr(Generator.Statistics.MnemonicCount));
3: SetInfoNodeValue(FInfoNode[I], TSizeFormatter.Format(Generator.Statistics.FilterSize));
4: SetInfoNodeValue(FInfoNode[I],
TSizeFormatter.Format(Generator.Statistics.DefinitionSize));
5: SetInfoNodeValue(FInfoNode[I],
TSizeFormatter.Format(Generator.Statistics.MnemonicSize));
6: SetInfoNodeValue(FInfoNode[I], TSizeFormatter.Format(Generator.Statistics.FilterSize
+ Generator.Statistics.DefinitionSize + Generator.Statistics.MnemonicSize));
end;
end;
finally
TreeView.EndUpdate;
end;
Application.ProcessMessages;
finally
Generator.Free;
end;
end;
procedure TfrmGenerator.FormCreate(Sender: TObject);
function AddNodeData(Parent: PVirtualNode; NodeType: TGeneratorNodeType; const Text: String;
const Value: String = ''): PVirtualNode;
var
NodeData: PGeneratorNodeData;
begin
Result := TreeView.AddChild(Parent);
NodeData := TreeView.GetNodeData(Result);
if (Assigned(NodeData)) then
begin
NodeData^.NodeType := NodeType;
NodeData^.Text := Text;
case NodeType of
ntOperation:
begin
NodeData^.ProgressActive := false;
NodeData^.ProgressUpdate(0);
end;
ntValue:
NodeData^.Value := Value;
end;
end;
end;
var
Category: PVirtualNode;
begin
TreeView.NodeDataSize := SizeOf(TGeneratorNodeData);
TreeView.BeginUpdate;
try
Category := AddNodeData(nil, ntCategory, 'Progress');
FProgressNode[woIndexingDefinitions] :=
AddNodeData(Category, ntOperation, 'Indexing definitions');
FProgressNode[woIndexingFilters] :=
AddNodeData(Category, ntOperation, 'Indexing filters');
FProgressNode[woGeneratingFilterFiles] :=
AddNodeData(Category, ntOperation, 'Generating filter files');
FProgressNode[woGeneratingDefinitionFiles] :=
AddNodeData(Category, ntOperation, 'Generating definition files');
FProgressNode[woGeneratingMnemonicFiles] :=
AddNodeData(Category, ntOperation, 'Generating mnemonic files');
FProgressNodeTotal :=
AddNodeData(Category, ntOperation, 'Total progress');
TreeView.Expanded[Category] := true;
AddNodeData(nil, ntSpacer, '');
Category := AddNodeData(nil, ntCategory, 'Statistics');
FInfoNode[0] := AddNodeData(Category, ntValue, 'Filter Count', '-');
FInfoNode[1] := AddNodeData(Category, ntValue, 'Definition Count', '-');
FInfoNode[2] := AddNodeData(Category, ntValue, 'Mnemonic Count', '-');
FInfoNode[3] := AddNodeData(Category, ntValue, 'Filter Size', '-');
FInfoNode[4] := AddNodeData(Category, ntValue, 'Definition Size', '-');
FInfoNode[5] := AddNodeData(Category, ntValue, 'MnemonicSize', '-');
FInfoNode[6] := AddNodeData(Category, ntValue, 'TotalSize', '-');
TreeView.Expanded[Category] := true;
finally
TreeView.EndUpdate;
end;
end;
procedure TfrmGenerator.GeneratorWork(Sender: TObject; WorkCount: Integer);
var
Node: PVirtualNode;
NodeData: PGeneratorNodeData;
ProgressTotal: Double;
begin
NodeData := TreeView.GetNodeData(FProgressNode[FCurrentOperation]);
NodeData^.WorkCountUpdate(WorkCount);
if (NodeData^.IsProgressUpdateStep(WorkCount)) then
begin
TreeView.RepaintNode(FProgressNode[FCurrentOperation]);
ProgressTotal := 0;
for Node in FProgressNode do
begin
NodeData := TreeView.GetNodeData(Node);
ProgressTotal := ProgressTotal + NodeData^.Progress;
end;
NodeData := TreeView.GetNodeData(FProgressNodeTotal);
NodeData^.ProgressUpdate(ProgressTotal / Length(FProgressNode));
TreeView.RepaintNode(FProgressNodeTotal);
Application.ProcessMessages;
end;
end;
procedure TfrmGenerator.GeneratorWorkEnd(Sender: TObject);
var
NodeData: PGeneratorNodeData;
begin
NodeData := TreeView.GetNodeData(FProgressNode[FCurrentOperation]);
NodeData^.ProgressActive := false;
NodeData^.ProgressUpdate(1);
TreeView.RepaintNode(FProgressNode[FCurrentOperation]);
NodeData := TreeView.GetNodeData(FProgressNodeTotal);
if (FCurrentOperation = High(TGeneratorWorkOperation)) then
begin
NodeData^.ProgressActive := false;
end;
NodeData^.ProgressUpdate((Integer(FCurrentOperation) + 1) / Length(FProgressNode));
TreeView.RepaintNode(FProgressNodeTotal);
end;
procedure TfrmGenerator.GeneratorWorkStart(Sender: TObject; Operation: TGeneratorWorkOperation;
MinWorkCount, MaxWorkCount: Integer);
var
NodeData: PGeneratorNodeData;
begin
FCurrentOperation := Operation;
NodeData := TreeView.GetNodeData(FProgressNode[Operation]);
NodeData^.ProgressInit(MaxWorkCount, MinWorkCount);
NodeData^.ProgressActive := true;
TreeView.RepaintNode(FProgressNode[FCurrentOperation]);
NodeData := TreeView.GetNodeData(FProgressNodeTotal);
if (FCurrentOperation = Low(TGeneratorWorkOperation)) then
begin
NodeData^.ProgressActive := true;
TreeView.RepaintNode(FProgressNodeTotal);
end;
end;
procedure TfrmGenerator.TreeViewBeforeCellPaint(Sender: TBaseVirtualTree; TargetCanvas: TCanvas;
Node: PVirtualNode; Column: TColumnIndex; CellPaintMode: TVTCellPaintMode; CellRect: TRect;
var ContentRect: TRect);
var
NodeData: PGeneratorNodeData;
ProgressWidth: Integer;
begin
if (Column = 1) then
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData) and (NodeData^.NodeType = ntOperation) and
(NodeData^.Progress <> 1) and (NodeData^.Progress <> 0)) then
begin
TargetCanvas.Pen.Color := $0000A162;
TargetCanvas.Brush.Color := $0055F2B5;
TargetCanvas.Rectangle(CellRect.Left, CellRect.Top, CellRect.Right,
CellRect.Bottom - CellRect.Top);
TargetCanvas.Pen.Color := $0000A162;
TargetCanvas.Brush.Color := $000FE18E;
ProgressWidth := Round(NodeData^.Progress * (CellRect.Right - CellRect.Left));
TargetCanvas.Rectangle(CellRect.Left, CellRect.Top, CellRect.Left + ProgressWidth,
CellRect.Bottom - CellRect.Top);
end;
end;
end;
procedure TfrmGenerator.TreeViewCollapsing(Sender: TBaseVirtualTree; Node: PVirtualNode;
var Allowed: Boolean);
begin
Allowed := false;
end;
procedure TfrmGenerator.TreeViewFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
var
NodeData: PGeneratorNodeData;
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
Finalize(NodeData^);
end;
end;
procedure TfrmGenerator.TreeViewGetImageIndex(Sender: TBaseVirtualTree; Node: PVirtualNode;
Kind: TVTImageKind; Column: TColumnIndex; var Ghosted: Boolean; var ImageIndex: Integer);
var
NodeData: PGeneratorNodeData;
begin
ImageIndex := -1;
if (Column = 0) and (Kind in [ikNormal, ikSelected]) then
begin
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
case NodeData^.NodeType of
ntCategory:
ImageIndex := 0;
ntOperation:
begin
if (NodeData^.ProgressActive) then
begin
ImageIndex := 2;
end else
begin
ImageIndex := 1;
end;
end;
ntValue:
ImageIndex := 3;
end;
end;
end;
end;
procedure TfrmGenerator.TreeViewGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: string);
var
NodeData: PGeneratorNodeData;
begin
CellText := '';
NodeData := Sender.GetNodeData(Node);
if (Assigned(NodeData)) then
begin
if (NodeData^.NodeType in [ntCategory, ntOperation, ntValue]) then
begin
case Column of
0: CellText := NodeData^.Text;
1: CellText := NodeData^.Value;
end;
end;
end;
end;
end.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -0,0 +1,350 @@
unit untTableGenerator;
interface
uses
System.Classes, System.Generics.Collections, untInstructionEditor;
type
TTableGeneratorInfo = record
public
FilterCount: Integer;
DefinitionCount: Integer;
MnemonicCount: Integer;
FilterSize: Cardinal;
DefinitionSize: Cardinal;
MnemonicSize: Cardinal;
end;
TWorkOperation = (
woIndexingFilters,
woIndexingDefinitions,
woGeneratingFilterFiles,
woGeneratingDefinitionFiles
);
TWorkStartEvent = procedure(Sender: TObject; Operation: TWorkOperation;
MinWorkCount, MaxWorkCount: Integer) of Object;
TWorkEvent = procedure(Sender: TObject; WorkCount: Integer) of Object;
TTableGenerator = class(TObject)
strict private type
TInstructionFilterMap = TObjectDictionary<TInstructionFilterClass, TList<TInstructionFilter>>;
strict private
FFilterMap: TInstructionFilterMap;
FFilterCount: Integer;
FDefinitionCount: Integer;
FMnemonicCount: Integer;
FFilterSize: Cardinal;
FDefinitionSize: Cardinal;
FMnemonicSize: Cardinal;
strict private
FOnWorkStart: TWorkStartEvent;
FOnWork: TWorkEvent;
FOnWorkEnd: TNotifyEvent;
strict private
procedure EditorFilterCreated(Sender: TObject; Filter: TInstructionFilter);
strict private
procedure WorkStart(Operation: TWorkOperation; MinWorkCount, MaxWorkCount: Integer); inline;
procedure Work(WorkCount: Integer); inline;
procedure WorkEnd; inline;
strict private
procedure FinalizeFilterTables(Editor: TInstructionEditor);
function GetNameForTable(FilterClass: TInstructionFilterClass): String; inline;
function GetNameForType(FilterClass: TInstructionFilterClass): String; inline;
procedure GenerateFilterFiles(const OutputDirectory: String;
FilterMap: TInstructionFilterMap; Definitions: TList<TInstructionDefinition>;
FilterCount: Integer);
procedure GenerateDefinitionFiles(const OutputDirectory: String;
Definitions: TList<TInstructionDefinition>);
public
procedure GenerateFiles(Editor: TInstructionEditor; const OutputDirectory: String);
public
property FilterCount: Integer read FFilterCount;
property DefinitionCount: Integer read FDefinitionCount;
property MnemonicCount: Integer read FMnemonicCount;
property FilterSize: Cardinal read FFilterSize;
property DefinitionSize: Cardinal read FDefinitionSize;
property MnemonicSize: Cardinal read FMnemonicSize;
public
property OnWorkStart: TWorkStartEvent read FOnWorkStart write FOnWorkStart;
property OnWork: TWorkEvent read FOnWork write FOnWork;
property OnWorkEnd: TNotifyEvent read FOnWorkEnd write FOnWorkEnd;
end;
implementation
uses
System.SysUtils, System.Generics.Defaults, untInstructionFilters, untHelperClasses;
const
FILENAME_FILTERTABLES = 'InstructionTable.inc';
FILTERARRAY_PREFIX_NAME = 'filter';
FILTERARRAY_PREFIX_TYPENAME = 'ZYDIS_NODETYPE_FILTER_';
FILTERARRAY_ITEMTYPE = 'ZydisInstructionTableNode';
FILTERARRAY_MACRO_INVALID = 'ZYDIS_INVALID';
FILTERARRAY_MACRO_FILTER = 'ZYDIS_FILTER';
FILTERARRAY_MACRO_DEFINITION = 'ZYDIS_DEFINITION';
FILTERARRAY_ITEM_SIZE = 3;
{ TTableGenerator }
procedure TTableGenerator.EditorFilterCreated(Sender: TObject; Filter: TInstructionFilter);
var
List: TList<TInstructionFilter>;
begin
if (Filter.IsDefinitionContainer) or (Filter is TEncodingFilter) then Exit;
if (FFilterMap.ContainsKey(TInstructionFilterClass(Filter.ClassType))) then
begin
List := FFilterMap[TInstructionFilterClass(Filter.ClassType)];
end else
begin
List := TList<TInstructionFilter>.Create;
FFilterMap.Add(TInstructionFilterClass(Filter.ClassType), List);
end;
Filter.Data := Pointer(List.Count);
List.Add(Filter);
Inc(FFilterCount);
if (Filter.NeutralElementType in [netNotAvailable, netValue]) then
begin
Inc(FFilterSize, Filter.GetCapacity * FILTERARRAY_ITEM_SIZE);
end else
begin
Inc(FFilterSize, (Filter.GetCapacity - 1) * FILTERARRAY_ITEM_SIZE);
end;
end;
procedure TTableGenerator.FinalizeFilterTables(Editor: TInstructionEditor);
begin
// Get rid of all encoding-filters as they are only needed in the editor
// Move LES instruction into the first field of the 3-byte vex-filter
Assert(not Assigned(Editor.RootTable.Items[$C4].Items[$03].Items[$00]));
Editor.RootTable.Items[$C4].Items[$03].SetItem($00, Editor.RootTable.Items[$C4].Items[$00]);
// Move LDS instruction into the first field of the 2-byte vex-filter
Assert(not Assigned(Editor.RootTable.Items[$C5].Items[$03].Items[$00]));
Editor.RootTable.Items[$C5].Items[$03].SetItem($00, Editor.RootTable.Items[$C5].Items[$00]);
// Move BOUND instruction into the first field of the evex-filter
Assert(not Assigned(Editor.RootTable.Items[$62].Items[$04].Items[$00]));
Editor.RootTable.Items[$62].Items[$04].SetItem($00, Editor.RootTable.Items[$62].Items[$00]);
// Move POP instruction into the first field of the xop-filter
Assert(not Assigned(Editor.RootTable.Items[$8F].Items[$02].Items[$00]));
Editor.RootTable.Items[$8F].Items[$02].SetItem($00, Editor.RootTable.Items[$8F].Items[$00]);
// Remove the encoding-filter for 3DNow instructions
Editor.RootTable.Items[$0F].SetItem($0F, Editor.RootTable.Items[$0F].Items[$0F].Items[$01]);
// Remove the encoding-filter for 3-byte VEX instructions
Editor.RootTable.SetItem($C4, Editor.RootTable.Items[$C4].Items[$03]);
// Remove the encoding-filter for 2-byte VEX instructions
Editor.RootTable.SetItem($C5, Editor.RootTable.Items[$C5].Items[$03]);
// Remove the encoding-filter for EVEX instructions
Editor.RootTable.SetItem($62, Editor.RootTable.Items[$62].Items[$04]);
// Remove the encoding-filter for XOP instructions
Editor.RootTable.SetItem($8F, Editor.RootTable.Items[$8f].Items[$02]);
end;
procedure TTableGenerator.GenerateDefinitionFiles(const OutputDirectory: String;
Definitions: TList<TInstructionDefinition>);
begin
WorkStart(woGeneratingDefinitionFiles, 0, Definitions.Count);
WorkEnd;
end;
procedure TTableGenerator.GenerateFiles(Editor: TInstructionEditor; const OutputDirectory: String);
var
E: TInstructionEditor;
D: TInstructionDefinition;
I: Integer;
Definitions: TList<TInstructionDefinition>;
Comparison: TComparison<TInstructionDefinition>;
begin
if (not Assigned(Editor.RootTable)) then
begin
raise Exception.Create('The instruction editor does not contain tables.');
end;
if (Editor.RootTable.HasConflicts) then
begin
//raise Exception.Create('The instruction editor has unresolved conflicts.');
end;
FDefinitionCount := Editor.DefinitionCount;
E := TInstructionEditor.Create;
try
E.OnFilterCreated := EditorFilterCreated;
E.BeginUpdate;
try
FFilterMap := TObjectDictionary<TInstructionFilterClass,
TList<TInstructionFilter>>.Create([doOwnsValues]);
try
E.Reset;
// Create filter indizes by copying all definitions to the internal editor instance
WorkStart(woIndexingFilters, 0, Editor.DefinitionCount);
for I := 0 to Editor.DefinitionCount - 1 do
begin
D := E.CreateDefinition('unnamed');
D.Assign(Editor.Definitions[I]);
Work(I + 1);
end;
WorkEnd;
FinalizeFilterTables(E);
Definitions := TList<TInstructionDefinition>.Create;
try
// Create definition indizes and a sorted definition-list
WorkStart(woIndexingDefinitions, 0, E.DefinitionCount * 2);
for I := 0 to E.DefinitionCount - 1 do
begin
Definitions.Add(E.Definitions[I]);
Work(I + 1);
end;
Comparison :=
function(const Left, Right: TInstructionDefinition): Integer
begin
Result := CompareStr(Left.Mnemonic, Right.Mnemonic);
end;
Definitions.Sort(TComparer<TInstructionDefinition>.Construct(Comparison));
for I := 0 to Definitions.Count - 1 do
begin
Definitions[I].Data := Pointer(I);
Work(E.DefinitionCount + I + 1);
end;
WorkEnd;
// Generate files
GenerateFilterFiles(OutputDirectory, FFilterMap, Definitions, E.FilterCount);
GenerateDefinitionFiles(OutputDirectory, Definitions);
finally
Definitions.Free;
end;
finally
FFilterMap.Free;
end;
finally
E.EndUpdate;
end;
finally
E.Free;
end;
end;
procedure TTableGenerator.GenerateFilterFiles(const OutputDirectory: String;
FilterMap: TInstructionFilterMap; Definitions: TList<TInstructionDefinition>;
FilterCount: Integer);
var
WorkCount, IndexShift: Integer;
Buffer: TStringBuffer;
StringList: TStringList;
I, J, K: Integer;
FilterList: TList<TInstructionFilter>;
begin
Buffer := TStringBuffer.Create;
try
WorkCount := 0;
WorkStart(woGeneratingFilterFiles, 0, FilterCount);
for I := Low(InstructionFilterClasses) to High(InstructionFilterClasses) do
begin
IndexShift := 1;
if (InstructionFilterClasses[I].GetNeutralElementType in [netNotAvailable, netValue]) then
begin
IndexShift := 0;
end;
Buffer.AppendLn(Format('const %s %s%s[][%d] = ', [
FILTERARRAY_ITEMTYPE,
FILTERARRAY_PREFIX_NAME, GetNameForTable(InstructionFilterClasses[I]),
Integer(InstructionFilterClasses[I].GetCapacity) - IndexShift]));
Buffer.AppendLn('{');
if (FilterMap.ContainsKey(InstructionFilterClasses[I])) then
begin
FilterList := FilterMap[InstructionFilterClasses[I]];
for J := 0 to FilterList.Count - 1 do
begin
Buffer.AppendLn(' {');
for K := IndexShift to FilterList[J].Capacity - 1 do
begin
Buffer.Append(Format(' /*%.4x*/ ', [K]));
if (not Assigned(FilterList[J].Items[K])) then
begin
Buffer.Append(FILTERARRAY_MACRO_INVALID);
end else if (FilterList[J].Items[K] is TDefinitionContainer) then
begin
Assert((FilterList[J].Items[K] as TDefinitionContainer).DefinitionCount > 0);
Buffer.Append(Format('%s(0x%.4x)', [FILTERARRAY_MACRO_DEFINITION,
Integer((FilterList[J].Items[K] as TDefinitionContainer).Definitions[0].Data)]));
end else
begin
Buffer.Append(Format('%s(%s%s, 0x%.4x)', [FILTERARRAY_MACRO_FILTER,
FILTERARRAY_PREFIX_TYPENAME,
GetNameForType(TInstructionFilterClass(FilterList[J].Items[K].ClassType)),
Integer(FilterList[J].Items[K].Data)]));
end;
if (K < Integer(FilterList[J].Capacity - 1)) then
begin
Buffer.AppendLn(',');
end else
begin
Buffer.AppendLn('');
end;
end;
Buffer.Append(' }');
if (J < FilterList.Count - 1) then
begin
Buffer.AppendLn(',');
end else
begin
Buffer.AppendLn('');
end;
Inc(WorkCount);
Work(WorkCount);
end;
end;
Buffer.AppendLn('};');
if (I < High(InstructionFilterClasses)) then
begin
Buffer.AppendLn('');
end;
end;
WorkEnd;
StringList := TStringList.Create;
try
StringList.Text := Buffer.Value;
StringList.SaveToFile(IncludeTrailingPathDelimiter(OutputDirectory) + FILENAME_FILTERTABLES);
finally
StringList.Free;
end;
finally
Buffer.Free;
end;
end;
function TTableGenerator.GetNameForTable(FilterClass: TInstructionFilterClass): String;
begin
Result := FilterClass.GetDescription;
end;
function TTableGenerator.GetNameForType(FilterClass: TInstructionFilterClass): String;
begin
Result := AnsiUpperCase(FilterClass.GetDescription);
end;
procedure TTableGenerator.Work(WorkCount: Integer);
begin
if (Assigned(FOnWork)) then
begin
FOnWork(Self, WorkCount);
end;
end;
procedure TTableGenerator.WorkEnd;
begin
if (Assigned(FOnWorkEnd)) then
begin
FOnWorkEnd(Self);
end;
end;
procedure TTableGenerator.WorkStart(Operation: TWorkOperation; MinWorkCount, MaxWorkCount: Integer);
begin
if (Assigned(FOnWorkStart)) then
begin
FOnWorkStart(Self, Operation, MinWorkCount, MaxWorkCount);
end;
end;
end.