Update pkgref vers, rename some props, remove some ifaces, update code

This commit is contained in:
0xd4d 2020-04-16 19:15:38 +02:00
parent 12ddf66a3a
commit d04255022a
22 changed files with 334 additions and 438 deletions

View File

@ -36,10 +36,10 @@
<!-- Update app.config whenever some of these versions change (eg. dnlib version) -->
<DiaSymReaderVersion>1.7.0</DiaSymReaderVersion>
<DnlibVersion>3.3.1</DnlibVersion>
<IcedVersion>1.5.0</IcedVersion>
<MSBuildNuGetVersion>16.4.0</MSBuildNuGetVersion>
<MSDiagRuntimeVersion>1.1.61812</MSDiagRuntimeVersion>
<DnlibVersion>3.3.2</DnlibVersion>
<IcedVersion>1.6.0</IcedVersion>
<MSBuildNuGetVersion>16.5.0</MSBuildNuGetVersion>
<MSDiagRuntimeVersion>1.1.116301</MSDiagRuntimeVersion>
<MSVSCompositionVersion>16.4.11</MSVSCompositionVersion>
<MSVSIntellisenseVersion>15.5.27130</MSVSIntellisenseVersion>
<MSVSTextVersion>15.5.27130</MSVSTextVersion>

View File

@ -197,7 +197,7 @@ namespace dnSpy.AsmEditor.Assembly {
VersionMinor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true);
VersionBuild = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true);
VersionRevision = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true);
PublicKey = new HexStringVM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); UpdatePublicKeyFlag(); }) { UpperCaseHex = false };
PublicKey = new HexStringVM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); UpdatePublicKeyFlag(); }) { UppercaseHex = false };
CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService);
DeclSecuritiesVM = new DeclSecuritiesVM(ownerModule, decompilerService, null, null);
Reinitialize();

View File

@ -1,40 +0,0 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
namespace dnSpy.Contracts.Disassembly {
/// <summary>
/// GNU assembler (AT&amp;T syntax) disassembly settings
/// </summary>
public interface IGasDisassemblySettings : IX86DisassemblySettings {
/// <summary>
/// If true, the formatter doesn't add '%' to registers, eg. %eax vs eax
/// </summary>
bool NakedRegisters { get; set; }
/// <summary>
/// Shows the mnemonic size suffix, eg. 'mov %eax,%ecx' vs 'movl %eax,%ecx'
/// </summary>
bool ShowMnemonicSizeSuffix { get; set; }
/// <summary>
/// Add a space after the comma if it's a memory operand, eg. '(%eax,%ecx,2)' vs '(%eax, %ecx, 2)'
/// </summary>
bool SpaceAfterMemoryOperandComma { get; set; }
}
}

View File

@ -1,40 +0,0 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
namespace dnSpy.Contracts.Disassembly {
/// <summary>
/// masm disassembly settings
/// </summary>
public interface IMasmDisassemblySettings : IX86DisassemblySettings {
/// <summary>
/// Add a DS segment override even if it's not present. Used if it's 16/32-bit code and mem op is a displ, eg. 'mov eax,[12345678]' vs 'mov eax,ds:[12345678]'
/// </summary>
bool AddDsPrefix32 { get; set; }
/// <summary>
/// Show symbols in brackets, eg. '[ecx+symbol]' vs 'symbol[ecx]' and '[symbol]' vs 'symbol'
/// </summary>
bool SymbolDisplInBrackets { get; set; }
/// <summary>
/// Show displacements in brackets, eg. '[ecx+1234h]' vs '1234h[ecx]'
/// </summary>
bool DisplInBrackets { get; set; }
}
}

View File

@ -1,30 +0,0 @@
/*
Copyright (C) 2014-2019 de4dot@gmail.com
This file is part of dnSpy
dnSpy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
dnSpy is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with dnSpy. If not, see <http://www.gnu.org/licenses/>.
*/
namespace dnSpy.Contracts.Disassembly {
/// <summary>
/// nasm disassembly settings
/// </summary>
public interface INasmDisassemblySettings : IX86DisassemblySettings {
/// <summary>
/// Shows byte, word, dword or qword if it's a sign extended immediate operand value, eg. 'or rcx,-1' vs 'or rcx,byte -1'
/// </summary>
bool ShowSignExtendedImmediateSize { get; set; }
}
}

View File

@ -27,32 +27,32 @@ namespace dnSpy.Contracts.Disassembly {
/// <summary>
/// Prefixes are upper cased
/// </summary>
bool UpperCasePrefixes { get; set; }
bool UppercasePrefixes { get; set; }
/// <summary>
/// Mnemonics are upper cased
/// </summary>
bool UpperCaseMnemonics { get; set; }
bool UppercaseMnemonics { get; set; }
/// <summary>
/// Registers are upper cased
/// </summary>
bool UpperCaseRegisters { get; set; }
bool UppercaseRegisters { get; set; }
/// <summary>
/// Keywords are upper cased (eg. BYTE PTR, SHORT)
/// </summary>
bool UpperCaseKeywords { get; set; }
bool UppercaseKeywords { get; set; }
/// <summary>
/// Upper case decorators, eg. {z}, {sae}, {rd-sae}
/// </summary>
bool UpperCaseDecorators { get; set; }
bool UppercaseDecorators { get; set; }
/// <summary>
/// Everything is upper cased, except numbers and their prefixes/suffixes
/// </summary>
bool UpperCaseAll { get; set; }
bool UppercaseAll { get; set; }
/// <summary>
/// Character index (0-based) where the first operand is formatted. Can be set to 0 to format it immediately after the mnemonic.
@ -180,7 +180,7 @@ namespace dnSpy.Contracts.Disassembly {
/// <summary>
/// Use upper case hex digits
/// </summary>
bool UpperCaseHex { get; set; }
bool UppercaseHex { get; set; }
/// <summary>
/// Small hex numbers (-9 .. 9) are shown in decimal
@ -242,5 +242,40 @@ namespace dnSpy.Contracts.Disassembly {
/// Show the original value after the symbol name, eg. 'mov eax,[myfield (12345678)]' vs 'mov eax,[myfield]'
/// </summary>
bool ShowSymbolAddress { get; set; }
/// <summary>
/// If true, the formatter doesn't add '%' to registers, eg. %eax vs eax
/// </summary>
bool GasNakedRegisters { get; set; }
/// <summary>
/// Shows the mnemonic size suffix, eg. 'mov %eax,%ecx' vs 'movl %eax,%ecx'
/// </summary>
bool GasShowMnemonicSizeSuffix { get; set; }
/// <summary>
/// Add a space after the comma if it's a memory operand, eg. '(%eax,%ecx,2)' vs '(%eax, %ecx, 2)'
/// </summary>
bool GasSpaceAfterMemoryOperandComma { get; set; }
/// <summary>
/// Add a DS segment override even if it's not present. Used if it's 16/32-bit code and mem op is a displ, eg. 'mov eax,[12345678]' vs 'mov eax,ds:[12345678]'
/// </summary>
bool MasmAddDsPrefix32 { get; set; }
/// <summary>
/// Show symbols in brackets, eg. '[ecx+symbol]' vs 'symbol[ecx]' and '[symbol]' vs 'symbol'
/// </summary>
bool MasmSymbolDisplInBrackets { get; set; }
/// <summary>
/// Show displacements in brackets, eg. '[ecx+1234h]' vs '1234h[ecx]'
/// </summary>
bool MasmDisplInBrackets { get; set; }
/// <summary>
/// Shows byte, word, dword or qword if it's a sign extended immediate operand value, eg. 'or rcx,-1' vs 'or rcx,byte -1'
/// </summary>
bool NasmShowSignExtendedImmediateSize { get; set; }
}
}

View File

@ -373,11 +373,11 @@ namespace dnSpy.Contracts.MVVM {
/// <summary>
/// Gets/sets whether to use upper case hex digits
/// </summary>
public bool UpperCaseHex {
get => upperCaseHex;
set => upperCaseHex = value;
public bool UppercaseHex {
get => uppercaseHex;
set => uppercaseHex = value;
}
bool upperCaseHex = true;
bool uppercaseHex = true;
/// <summary>
/// Constructor
@ -396,7 +396,7 @@ namespace dnSpy.Contracts.MVVM {
: base(onUpdated) => SetValueFromConstructor(value!);// can be null, but we can't use 'T?'
/// <inheritdoc/>
protected override string OnNewValue(IList<byte> value) => SimpleTypeConverter.ByteArrayToString(value, UpperCaseHex);
protected override string OnNewValue(IList<byte> value) => SimpleTypeConverter.ByteArrayToString(value, UppercaseHex);
/// <inheritdoc/>
protected override string? ConvertToValue(out IList<byte> value) {

View File

@ -27,6 +27,6 @@ namespace dnSpy.Disassembly.Viewer {
InstructionAddresses = 0x00000002,
InstructionBytes = 0x00000004,
AddLabels = 0x00000008,
UpperCaseHex = 0x00000010,
UppercaseHex = 0x00000010,
}
}

View File

@ -230,7 +230,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
WriteComment(output, commentPrefix, GetCodeSizeString(blocks));
output.Write(Environment.NewLine, BoxedTextColor.Text);
bool upperCaseHex = (formatterOptions & InternalFormatterOptions.UpperCaseHex) != 0;
bool uppercaseHex = (formatterOptions & InternalFormatterOptions.UppercaseHex) != 0;
var variables = codeInfo?.Variables ?? Array.Empty<X86Variable>();
if (variables.Length != 0) {
var sb = new System.Text.StringBuilder();
@ -257,9 +257,9 @@ namespace dnSpy.Disassembly.Viewer.X86 {
sb.Append("???");
sb.Append(' ');
}
sb.Append(FormatAddress(bitness, varInfo.LiveAddress, upperCaseHex));
sb.Append(FormatAddress(bitness, varInfo.LiveAddress, uppercaseHex));
sb.Append('-');
sb.Append(FormatAddress(bitness, varInfo.LiveAddress + varInfo.LiveLength, upperCaseHex));
sb.Append(FormatAddress(bitness, varInfo.LiveAddress + varInfo.LiveLength, uppercaseHex));
sb.Append(' ');
switch (varInfo.LocationKind) {
case X86VariableLocationKind.Other:
@ -282,7 +282,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
sb.Append('+');
if (memOffs != 0) {
sb.Append(formatter.Options.HexPrefix ?? string.Empty);
sb.Append(memOffs.ToString(upperCaseHex ? "X2" : "x2"));
sb.Append(memOffs.ToString(uppercaseHex ? "X2" : "x2"));
sb.Append(formatter.Options.HexSuffix ?? string.Empty);
}
sb.Append(']');
@ -316,7 +316,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
for (int j = 0; j < instrs.Length; j++) {
ref var instr = ref instrs[j].Instruction;
if ((formatterOptions & InternalFormatterOptions.InstructionAddresses) != 0) {
var address = FormatAddress(bitness, instr.IP, upperCaseHex);
var address = FormatAddress(bitness, instr.IP, uppercaseHex);
output.Write(address, BoxedTextColor.AsmAddress);
output.Write(" ", BoxedTextColor.Text);
}
@ -328,7 +328,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
var codeBytes = code.Array!;
for (int k = 0; k < code.Count; k++) {
byte b = codeBytes[k + code.Offset];
output.Write(b.ToString(upperCaseHex ? "X2" : "x2"), BoxedTextColor.AsmHexBytes);
output.Write(b.ToString(uppercaseHex ? "X2" : "x2"), BoxedTextColor.AsmHexBytes);
}
int missingBytes = HEXBYTES_COLUMN_BYTE_LENGTH - code.Count;
for (int k = 0; k < missingBytes; k++)
@ -357,16 +357,16 @@ namespace dnSpy.Disassembly.Viewer.X86 {
return codeSize;
}
static string FormatAddress(int bitness, ulong address, bool upperCaseHex) {
static string FormatAddress(int bitness, ulong address, bool uppercaseHex) {
switch (bitness) {
case 16:
return address.ToString(upperCaseHex ? "X4" : "x4");
return address.ToString(uppercaseHex ? "X4" : "x4");
case 32:
return address.ToString(upperCaseHex ? "X8" : "x8");
return address.ToString(uppercaseHex ? "X8" : "x8");
case 64:
return address.ToString(upperCaseHex ? "X16" : "x16");
return address.ToString(uppercaseHex ? "X16" : "x16");
default:
Debug.Fail($"Unknown bitness: {bitness}");

View File

@ -30,9 +30,9 @@ namespace dnSpy.Disassembly.Viewer.X86 {
[Export(typeof(DisassemblyContentProviderFactoryDependencies))]
sealed class DisassemblyContentProviderFactoryDependencies {
public DisassemblyContentSettings DisasmSettings { get; }
public IMasmDisassemblySettings MasmSettings { get; }
public INasmDisassemblySettings NasmSettings { get; }
public IGasDisassemblySettings GasSettings { get; }
public IX86DisassemblySettings MasmSettings { get; }
public IX86DisassemblySettings NasmSettings { get; }
public IX86DisassemblySettings GasSettings { get; }
[ImportingConstructor]
DisassemblyContentProviderFactoryDependencies(DisassemblyContentSettingsImpl disasm, MasmDisassemblySettingsImpl masm, NasmDisassemblySettingsImpl nasm, GasDisassemblySettingsImpl gas) {
@ -140,7 +140,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
break;
case 8:
addresses.Add((ulong)(int)instr.MemoryDisplacement);
addresses.Add(instr.MemoryDisplacement64);
break;
}
}

View File

@ -52,9 +52,9 @@ namespace dnSpy.Disassembly.Viewer.X86 {
readonly int bitness;
readonly CachedSymbolResolver cachedSymbolResolver;
readonly DisassemblyContentSettings disasmSettings;
readonly IMasmDisassemblySettings masmSettings;
readonly INasmDisassemblySettings nasmSettings;
readonly IGasDisassemblySettings gasSettings;
readonly IX86DisassemblySettings masmSettings;
readonly IX86DisassemblySettings nasmSettings;
readonly IX86DisassemblySettings gasSettings;
readonly DisassemblyContentFormatterOptions formatterOptions;
readonly string? header;
readonly NativeCodeOptimization optimization;
@ -110,7 +110,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
}
}
public DisassemblyContentProviderImpl(int bitness, CachedSymbolResolver cachedSymbolResolver, DisassemblyContentSettings disasmSettings, IMasmDisassemblySettings masmSettings, INasmDisassemblySettings nasmSettings, IGasDisassemblySettings gasSettings, DisassemblyContentFormatterOptions formatterOptions, string? header, NativeCodeOptimization optimization, Block[] blocks, X86NativeCodeInfo? codeInfo, NativeVariableInfo[]? variableInfo, string? methodName, string? shortMethodName, string? moduleName) {
public DisassemblyContentProviderImpl(int bitness, CachedSymbolResolver cachedSymbolResolver, DisassemblyContentSettings disasmSettings, IX86DisassemblySettings masmSettings, IX86DisassemblySettings nasmSettings, IX86DisassemblySettings gasSettings, DisassemblyContentFormatterOptions formatterOptions, string? header, NativeCodeOptimization optimization, Block[] blocks, X86NativeCodeInfo? codeInfo, NativeVariableInfo[]? variableInfo, string? methodName, string? shortMethodName, string? moduleName) {
this.bitness = bitness;
this.cachedSymbolResolver = cachedSymbolResolver ?? throw new ArgumentNullException(nameof(cachedSymbolResolver));
this.disasmSettings = disasmSettings ?? throw new ArgumentNullException(nameof(disasmSettings));
@ -135,13 +135,13 @@ namespace dnSpy.Disassembly.Viewer.X86 {
(Formatter formatter, string commentPrefix, DisassemblyContentKind contentKind) GetDisassemblerInfo(X86Disassembler disasm) {
switch (disasm) {
case X86Disassembler.Masm:
return (new MasmFormatter(masmSettings.ToMasm(), symbolResolver), MASM_COMMENT, DisassemblyContentKind.Masm);
return (new MasmFormatter(masmSettings.ToIcedOptions(), symbolResolver), MASM_COMMENT, DisassemblyContentKind.Masm);
case X86Disassembler.Nasm:
return (new NasmFormatter(nasmSettings.ToNasm(), symbolResolver), NASM_COMMENT, DisassemblyContentKind.Nasm);
return (new NasmFormatter(nasmSettings.ToIcedOptions(), symbolResolver), NASM_COMMENT, DisassemblyContentKind.Nasm);
case X86Disassembler.Gas:
return (new GasFormatter(gasSettings.ToGas(), symbolResolver), GAS_COMMENT, DisassemblyContentKind.ATT);
return (new GasFormatter(gasSettings.ToIcedOptions(), symbolResolver), GAS_COMMENT, DisassemblyContentKind.ATT);
default:
Debug.Fail($"Unknown disassembler: {disasm}");
@ -149,7 +149,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
}
}
InternalFormatterOptions GetInternalFormatterOptions(bool upperCaseHex) {
InternalFormatterOptions GetInternalFormatterOptions(bool uppercaseHex) {
var options = InternalFormatterOptions.None;
if (EmptyLineBetweenBasicBlocks)
options |= InternalFormatterOptions.EmptyLineBetweenBasicBlocks;
@ -159,8 +159,8 @@ namespace dnSpy.Disassembly.Viewer.X86 {
options |= InternalFormatterOptions.InstructionBytes;
if (AddLabels)
options |= InternalFormatterOptions.AddLabels;
if (upperCaseHex)
options |= InternalFormatterOptions.UpperCaseHex;
if (uppercaseHex)
options |= InternalFormatterOptions.UppercaseHex;
return options;
}
@ -175,7 +175,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
var output = new DisassemblyContentOutput();
var disasmInfo = GetDisassemblerInfo(disasmSettings.X86Disassembler);
DisassemblyContentGenerator.Write(bitness, output, header, optimization, disasmInfo.formatter, disasmInfo.commentPrefix, GetInternalFormatterOptions(disasmInfo.formatter.Options.UpperCaseHex), blocks, codeInfo, variableInfo, methodName, moduleName);
DisassemblyContentGenerator.Write(bitness, output, header, optimization, disasmInfo.formatter, disasmInfo.commentPrefix, GetInternalFormatterOptions(disasmInfo.formatter.Options.UppercaseHex), blocks, codeInfo, variableInfo, methodName, moduleName);
return output.Create(disasmInfo.contentKind);
}

View File

@ -144,7 +144,7 @@ namespace dnSpy.Disassembly.X86 {
switch (instr.MemoryDisplSize) {
case 2:
case 4: displ = instr.MemoryDisplacement; break;
case 8: displ = (ulong)(int)instr.MemoryDisplacement; break;
case 8: displ = instr.MemoryDisplacement64; break;
default:
Debug.Fail($"Unknown mem displ size: {instr.MemoryDisplSize}");
goto case 8;

View File

@ -42,12 +42,12 @@ namespace dnSpy.Disassembly.X86 {
public sealed override object? UIObject => this;
public DisasmBooleanSetting UseHexNumbers { get; }
public DisasmBooleanSetting UpperCasePrefixes { get; }
public DisasmBooleanSetting UpperCaseMnemonics { get; }
public DisasmBooleanSetting UpperCaseRegisters { get; }
public DisasmBooleanSetting UpperCaseKeywords { get; }
public DisasmBooleanSetting UpperCaseHex { get; }
public DisasmBooleanSetting UpperCaseAll { get; }
public DisasmBooleanSetting UppercasePrefixes { get; }
public DisasmBooleanSetting UppercaseMnemonics { get; }
public DisasmBooleanSetting UppercaseRegisters { get; }
public DisasmBooleanSetting UppercaseKeywords { get; }
public DisasmBooleanSetting UppercaseHex { get; }
public DisasmBooleanSetting UppercaseAll { get; }
public DisasmBooleanSetting SpaceAfterOperandSeparator { get; }
public DisasmBooleanSetting SpaceAfterMemoryBracket { get; }
public DisasmBooleanSetting SpaceBetweenMemoryAddOperators { get; }
@ -67,6 +67,9 @@ namespace dnSpy.Disassembly.X86 {
public DisasmBooleanSetting ShowBranchSize { get; }
public DisasmBooleanSetting UsePseudoOps { get; }
public DisasmBooleanSetting ShowSymbolAddress { get; }
public DisasmBooleanSetting GasNakedRegisters { get; }
public DisasmBooleanSetting GasShowMnemonicSizeSuffix { get; }
public DisasmBooleanSetting GasSpaceAfterMemoryOperandComma { get; }
public Int32VM OperandColumnVM { get; }
@ -128,12 +131,12 @@ namespace dnSpy.Disassembly.X86 {
() => Settings.NumberBase == Contracts.Disassembly.NumberBase.Hexadecimal,
value => Settings.NumberBase = value ? Contracts.Disassembly.NumberBase.Hexadecimal : Contracts.Disassembly.NumberBase.Decimal,
Instruction.Create(Code.Mov_r64_imm64, Register.RDX, 0x123456789ABCDEF0));
UpperCasePrefixes = AddDisasmBoolSetting(() => Settings.UpperCasePrefixes, value => Settings.UpperCasePrefixes = value, Instruction.CreateMovsb(64, repPrefix: RepPrefixKind.Repe));
UpperCaseMnemonics = AddDisasmBoolSetting(() => Settings.UpperCaseMnemonics, value => Settings.UpperCaseMnemonics = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
UpperCaseRegisters = AddDisasmBoolSetting(() => Settings.UpperCaseRegisters, value => Settings.UpperCaseRegisters = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
UpperCaseKeywords = AddDisasmBoolSetting(() => Settings.UpperCaseKeywords, value => Settings.UpperCaseKeywords = value, Instruction.Create(Code.Mov_rm8_imm8, new MemoryOperand(Register.RCX, 4, 1), 0x5A));
UpperCaseHex = AddDisasmBoolSetting(() => Settings.UpperCaseHex, value => Settings.UpperCaseHex = value, Instruction.Create(Code.Mov_r64_imm64, Register.RDX, 0x123456789ABCDEF0));
UpperCaseAll = AddDisasmBoolSetting(() => Settings.UpperCaseAll, value => Settings.UpperCaseAll = value, Instruction.CreateMovsb(64, repPrefix: RepPrefixKind.Repe));
UppercasePrefixes = AddDisasmBoolSetting(() => Settings.UppercasePrefixes, value => Settings.UppercasePrefixes = value, Instruction.CreateMovsb(64, repPrefix: RepPrefixKind.Repe));
UppercaseMnemonics = AddDisasmBoolSetting(() => Settings.UppercaseMnemonics, value => Settings.UppercaseMnemonics = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
UppercaseRegisters = AddDisasmBoolSetting(() => Settings.UppercaseRegisters, value => Settings.UppercaseRegisters = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
UppercaseKeywords = AddDisasmBoolSetting(() => Settings.UppercaseKeywords, value => Settings.UppercaseKeywords = value, Instruction.Create(Code.Mov_rm8_imm8, new MemoryOperand(Register.RCX, 4, 1), 0x5A));
UppercaseHex = AddDisasmBoolSetting(() => Settings.UppercaseHex, value => Settings.UppercaseHex = value, Instruction.Create(Code.Mov_r64_imm64, Register.RDX, 0x123456789ABCDEF0));
UppercaseAll = AddDisasmBoolSetting(() => Settings.UppercaseAll, value => Settings.UppercaseAll = value, Instruction.CreateMovsb(64, repPrefix: RepPrefixKind.Repe));
SpaceAfterOperandSeparator = AddDisasmBoolSetting(() => Settings.SpaceAfterOperandSeparator, value => Settings.SpaceAfterOperandSeparator = value, Instruction.Create(Code.Shld_rm16_r16_CL, Register.DX, Register.AX, Register.CL));
SpaceAfterMemoryBracket = AddDisasmBoolSetting(() => Settings.SpaceAfterMemoryBracket, value => Settings.SpaceAfterMemoryBracket = value, Instruction.Create(Code.Push_rm64, new MemoryOperand(Register.RBP, Register.RDI, 4, -0x12345678, 8, false, Register.None)));
SpaceBetweenMemoryAddOperators = AddDisasmBoolSetting(() => Settings.SpaceBetweenMemoryAddOperators, value => Settings.SpaceBetweenMemoryAddOperators = value, Instruction.Create(Code.Push_rm64, new MemoryOperand(Register.RBP, Register.RDI, 4, -0x12345678, 8, false, Register.None)));
@ -153,6 +156,9 @@ namespace dnSpy.Disassembly.X86 {
ShowBranchSize = AddDisasmBoolSetting(() => Settings.ShowBranchSize, value => Settings.ShowBranchSize = value, Instruction.CreateBranch(Code.Je_rel8_64, X86_RIP + 5));
UsePseudoOps = AddDisasmBoolSetting(() => Settings.UsePseudoOps, value => Settings.UsePseudoOps = value, Instruction.Create(Code.EVEX_Vcmpps_k_k1_ymm_ymmm256b32_imm8, Register.K3, Register.YMM2, Register.YMM27, 7));
ShowSymbolAddress = AddDisasmBoolSetting(() => Settings.ShowSymbolAddress, value => Settings.ShowSymbolAddress = value, Instruction.Create(Code.Mov_r64_imm64, Register.RCX, SYMBOLADDR));
GasNakedRegisters = AddDisasmBoolSetting(() => Settings.GasNakedRegisters, value => Settings.GasNakedRegisters = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
GasShowMnemonicSizeSuffix = AddDisasmBoolSetting(() => Settings.GasShowMnemonicSizeSuffix, value => Settings.GasShowMnemonicSizeSuffix = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
GasSpaceAfterMemoryOperandComma = AddDisasmBoolSetting(() => Settings.GasSpaceAfterMemoryOperandComma, value => Settings.GasSpaceAfterMemoryOperandComma = value, Instruction.Create(Code.Mov_rm64_r64, new MemoryOperand(Register.RAX, Register.RDI, 4, 0x12345678, 8), Register.RCX));
OperandColumnVM = new Int32VM(x86DisassemblySettings.FirstOperandCharIndex + 1, a => {
if (!OperandColumnVM.HasError)
@ -184,14 +190,12 @@ namespace dnSpy.Disassembly.X86 {
}
void InitializeFormatterOptions(FormatterOptions options) {
InitializeFormatterOptionsCore(options);
options.UpperCasePrefixes = x86DisassemblySettings.UpperCasePrefixes;
options.UpperCaseMnemonics = x86DisassemblySettings.UpperCaseMnemonics;
options.UpperCaseRegisters = x86DisassemblySettings.UpperCaseRegisters;
options.UpperCaseKeywords = x86DisassemblySettings.UpperCaseKeywords;
options.UpperCaseDecorators = x86DisassemblySettings.UpperCaseDecorators;
options.UpperCaseAll = x86DisassemblySettings.UpperCaseAll;
options.UppercasePrefixes = x86DisassemblySettings.UppercasePrefixes;
options.UppercaseMnemonics = x86DisassemblySettings.UppercaseMnemonics;
options.UppercaseRegisters = x86DisassemblySettings.UppercaseRegisters;
options.UppercaseKeywords = x86DisassemblySettings.UppercaseKeywords;
options.UppercaseDecorators = x86DisassemblySettings.UppercaseDecorators;
options.UppercaseAll = x86DisassemblySettings.UppercaseAll;
options.FirstOperandCharIndex = x86DisassemblySettings.FirstOperandCharIndex;
options.TabSize = x86DisassemblySettings.TabSize;
options.SpaceAfterOperandSeparator = x86DisassemblySettings.SpaceAfterOperandSeparator;
@ -216,7 +220,7 @@ namespace dnSpy.Disassembly.X86 {
options.BinaryDigitGroupSize = x86DisassemblySettings.BinaryDigitGroupSize;
options.DigitSeparator = x86DisassemblySettings.DigitSeparator;
options.LeadingZeroes = x86DisassemblySettings.LeadingZeroes;
options.UpperCaseHex = x86DisassemblySettings.UpperCaseHex;
options.UppercaseHex = x86DisassemblySettings.UppercaseHex;
options.SmallHexNumbersInDecimal = x86DisassemblySettings.SmallHexNumbersInDecimal;
options.AddLeadingZeroToHexNumbers = x86DisassemblySettings.AddLeadingZeroToHexNumbers;
options.NumberBase = UseHexNumbers.Value ? Iced.Intel.NumberBase.Hexadecimal : Iced.Intel.NumberBase.Decimal;
@ -229,12 +233,17 @@ namespace dnSpy.Disassembly.X86 {
options.ShowBranchSize = x86DisassemblySettings.ShowBranchSize;
options.UsePseudoOps = x86DisassemblySettings.UsePseudoOps;
options.ShowSymbolAddress = x86DisassemblySettings.ShowSymbolAddress;
options.GasNakedRegisters = x86DisassemblySettings.GasNakedRegisters;
options.GasShowMnemonicSizeSuffix = x86DisassemblySettings.GasShowMnemonicSizeSuffix;
options.GasSpaceAfterMemoryOperandComma = x86DisassemblySettings.GasSpaceAfterMemoryOperandComma;
options.MasmAddDsPrefix32 = x86DisassemblySettings.MasmAddDsPrefix32;
options.MasmDisplInBrackets = x86DisassemblySettings.MasmDisplInBrackets;
options.MasmSymbolDisplInBrackets = x86DisassemblySettings.MasmSymbolDisplInBrackets;
options.NasmShowSignExtendedImmediateSize = x86DisassemblySettings.NasmShowSignExtendedImmediateSize;
// The options are only used to show an example so ignore these properties
options.TabSize = 0;
options.FirstOperandCharIndex = 0;
}
protected abstract void InitializeFormatterOptionsCore(FormatterOptions options);
}
}

View File

@ -27,71 +27,71 @@ namespace dnSpy.Disassembly.X86 {
public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged(string propName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
public bool UpperCasePrefixes {
get => upperCasePrefixes;
public bool UppercasePrefixes {
get => uppercasePrefixes;
set {
if (value != upperCasePrefixes) {
upperCasePrefixes = value;
OnPropertyChanged(nameof(UpperCasePrefixes));
if (value != uppercasePrefixes) {
uppercasePrefixes = value;
OnPropertyChanged(nameof(UppercasePrefixes));
}
}
}
bool upperCasePrefixes;
bool uppercasePrefixes;
public bool UpperCaseMnemonics {
get => upperCaseMnemonics;
public bool UppercaseMnemonics {
get => uppercaseMnemonics;
set {
if (value != upperCaseMnemonics) {
upperCaseMnemonics = value;
OnPropertyChanged(nameof(UpperCaseMnemonics));
if (value != uppercaseMnemonics) {
uppercaseMnemonics = value;
OnPropertyChanged(nameof(UppercaseMnemonics));
}
}
}
bool upperCaseMnemonics;
bool uppercaseMnemonics;
public bool UpperCaseRegisters {
get => upperCaseRegisters;
public bool UppercaseRegisters {
get => uppercaseRegisters;
set {
if (value != upperCaseRegisters) {
upperCaseRegisters = value;
OnPropertyChanged(nameof(UpperCaseRegisters));
if (value != uppercaseRegisters) {
uppercaseRegisters = value;
OnPropertyChanged(nameof(UppercaseRegisters));
}
}
}
bool upperCaseRegisters;
bool uppercaseRegisters;
public bool UpperCaseKeywords {
get => upperCaseKeywords;
public bool UppercaseKeywords {
get => uppercaseKeywords;
set {
if (value != upperCaseKeywords) {
upperCaseKeywords = value;
OnPropertyChanged(nameof(UpperCaseKeywords));
if (value != uppercaseKeywords) {
uppercaseKeywords = value;
OnPropertyChanged(nameof(UppercaseKeywords));
}
}
}
bool upperCaseKeywords;
bool uppercaseKeywords;
public bool UpperCaseDecorators {
get => upperCaseDecorators;
public bool UppercaseDecorators {
get => uppercaseDecorators;
set {
if (value != upperCaseDecorators) {
upperCaseDecorators = value;
OnPropertyChanged(nameof(UpperCaseDecorators));
if (value != uppercaseDecorators) {
uppercaseDecorators = value;
OnPropertyChanged(nameof(UppercaseDecorators));
}
}
}
bool upperCaseDecorators;
bool uppercaseDecorators;
public bool UpperCaseAll {
get => upperCaseAll;
public bool UppercaseAll {
get => uppercaseAll;
set {
if (value != upperCaseAll) {
upperCaseAll = value;
OnPropertyChanged(nameof(UpperCaseAll));
if (value != uppercaseAll) {
uppercaseAll = value;
OnPropertyChanged(nameof(UppercaseAll));
}
}
}
bool upperCaseAll;
bool uppercaseAll;
public int FirstOperandCharIndex {
get => firstOperandCharIndex;
@ -357,16 +357,16 @@ namespace dnSpy.Disassembly.X86 {
}
bool leadingZeroes;
public bool UpperCaseHex {
get => upperCaseHex;
public bool UppercaseHex {
get => uppercaseHex;
set {
if (value != upperCaseHex) {
upperCaseHex = value;
OnPropertyChanged(nameof(UpperCaseHex));
if (value != uppercaseHex) {
uppercaseHex = value;
OnPropertyChanged(nameof(UppercaseHex));
}
}
}
bool upperCaseHex = true;
bool uppercaseHex = true;
public bool SmallHexNumbersInDecimal {
get => smallHexNumbersInDecimal;
@ -503,13 +503,90 @@ namespace dnSpy.Disassembly.X86 {
}
bool showSymbolAddress = true;
public bool GasNakedRegisters {
get => gasNakedRegisters;
set {
if (value != gasNakedRegisters) {
gasNakedRegisters = value;
OnPropertyChanged(nameof(GasNakedRegisters));
}
}
}
bool gasNakedRegisters;
public bool GasShowMnemonicSizeSuffix {
get => gasShowMnemonicSizeSuffix;
set {
if (value != gasShowMnemonicSizeSuffix) {
gasShowMnemonicSizeSuffix = value;
OnPropertyChanged(nameof(GasShowMnemonicSizeSuffix));
}
}
}
bool gasShowMnemonicSizeSuffix;
public bool GasSpaceAfterMemoryOperandComma {
get => gasSpaceAfterMemoryOperandComma;
set {
if (value != gasSpaceAfterMemoryOperandComma) {
gasSpaceAfterMemoryOperandComma = value;
OnPropertyChanged(nameof(GasSpaceAfterMemoryOperandComma));
}
}
}
bool gasSpaceAfterMemoryOperandComma;
public bool MasmAddDsPrefix32 {
get => masmAddDsPrefix32;
set {
if (value != masmAddDsPrefix32) {
masmAddDsPrefix32 = value;
OnPropertyChanged(nameof(MasmAddDsPrefix32));
}
}
}
bool masmAddDsPrefix32 = true;
public bool MasmSymbolDisplInBrackets {
get => masmSymbolDisplInBrackets;
set {
if (value != masmSymbolDisplInBrackets) {
masmSymbolDisplInBrackets = value;
OnPropertyChanged(nameof(MasmSymbolDisplInBrackets));
}
}
}
bool masmSymbolDisplInBrackets = true;
public bool MasmDisplInBrackets {
get => masmDisplInBrackets;
set {
if (value != masmDisplInBrackets) {
masmDisplInBrackets = value;
OnPropertyChanged(nameof(MasmDisplInBrackets));
}
}
}
bool masmDisplInBrackets = true;
public bool NasmShowSignExtendedImmediateSize {
get => nasmShowSignExtendedImmediateSize;
set {
if (value != nasmShowSignExtendedImmediateSize) {
nasmShowSignExtendedImmediateSize = value;
OnPropertyChanged(nameof(NasmShowSignExtendedImmediateSize));
}
}
}
bool nasmShowSignExtendedImmediateSize;
protected void ReadSettings(ISettingsSection sect) {
UpperCasePrefixes = sect.Attribute<bool?>(nameof(UpperCasePrefixes)) ?? UpperCasePrefixes;
UpperCaseMnemonics = sect.Attribute<bool?>(nameof(UpperCaseMnemonics)) ?? UpperCaseMnemonics;
UpperCaseRegisters = sect.Attribute<bool?>(nameof(UpperCaseRegisters)) ?? UpperCaseRegisters;
UpperCaseKeywords = sect.Attribute<bool?>(nameof(UpperCaseKeywords)) ?? UpperCaseKeywords;
UpperCaseDecorators = sect.Attribute<bool?>(nameof(UpperCaseDecorators)) ?? UpperCaseDecorators;
UpperCaseAll = sect.Attribute<bool?>(nameof(UpperCaseAll)) ?? UpperCaseAll;
UppercasePrefixes = sect.Attribute<bool?>(nameof(UppercasePrefixes)) ?? UppercasePrefixes;
UppercaseMnemonics = sect.Attribute<bool?>(nameof(UppercaseMnemonics)) ?? UppercaseMnemonics;
UppercaseRegisters = sect.Attribute<bool?>(nameof(UppercaseRegisters)) ?? UppercaseRegisters;
UppercaseKeywords = sect.Attribute<bool?>(nameof(UppercaseKeywords)) ?? UppercaseKeywords;
UppercaseDecorators = sect.Attribute<bool?>(nameof(UppercaseDecorators)) ?? UppercaseDecorators;
UppercaseAll = sect.Attribute<bool?>(nameof(UppercaseAll)) ?? UppercaseAll;
FirstOperandCharIndex = sect.Attribute<int?>(nameof(FirstOperandCharIndex)) ?? FirstOperandCharIndex;
TabSize = sect.Attribute<int?>(nameof(TabSize)) ?? TabSize;
SpaceAfterOperandSeparator = sect.Attribute<bool?>(nameof(SpaceAfterOperandSeparator)) ?? SpaceAfterOperandSeparator;
@ -534,7 +611,7 @@ namespace dnSpy.Disassembly.X86 {
BinaryDigitGroupSize = sect.Attribute<int?>(nameof(BinaryDigitGroupSize)) ?? BinaryDigitGroupSize;
DigitSeparator = sect.Attribute<string>(nameof(DigitSeparator)) ?? DigitSeparator;
LeadingZeroes = sect.Attribute<bool?>(nameof(LeadingZeroes)) ?? LeadingZeroes;
UpperCaseHex = sect.Attribute<bool?>(nameof(UpperCaseHex)) ?? UpperCaseHex;
UppercaseHex = sect.Attribute<bool?>(nameof(UppercaseHex)) ?? UppercaseHex;
SmallHexNumbersInDecimal = sect.Attribute<bool?>(nameof(SmallHexNumbersInDecimal)) ?? SmallHexNumbersInDecimal;
AddLeadingZeroToHexNumbers = sect.Attribute<bool?>(nameof(AddLeadingZeroToHexNumbers)) ?? AddLeadingZeroToHexNumbers;
NumberBase = sect.Attribute<NumberBase?>(nameof(NumberBase)) ?? NumberBase;
@ -547,15 +624,22 @@ namespace dnSpy.Disassembly.X86 {
ShowBranchSize = sect.Attribute<bool?>(nameof(ShowBranchSize)) ?? ShowBranchSize;
UsePseudoOps = sect.Attribute<bool?>(nameof(UsePseudoOps)) ?? UsePseudoOps;
ShowSymbolAddress = sect.Attribute<bool?>(nameof(ShowSymbolAddress)) ?? ShowSymbolAddress;
GasNakedRegisters = sect.Attribute<bool?>(nameof(GasNakedRegisters)) ?? GasNakedRegisters;
GasShowMnemonicSizeSuffix = sect.Attribute<bool?>(nameof(GasShowMnemonicSizeSuffix)) ?? GasShowMnemonicSizeSuffix;
GasSpaceAfterMemoryOperandComma = sect.Attribute<bool?>(nameof(GasSpaceAfterMemoryOperandComma)) ?? GasSpaceAfterMemoryOperandComma;
MasmAddDsPrefix32 = sect.Attribute<bool?>(nameof(MasmAddDsPrefix32)) ?? MasmAddDsPrefix32;
MasmSymbolDisplInBrackets = sect.Attribute<bool?>(nameof(MasmSymbolDisplInBrackets)) ?? MasmSymbolDisplInBrackets;
MasmDisplInBrackets = sect.Attribute<bool?>(nameof(MasmDisplInBrackets)) ?? MasmDisplInBrackets;
NasmShowSignExtendedImmediateSize = sect.Attribute<bool?>(nameof(NasmShowSignExtendedImmediateSize)) ?? NasmShowSignExtendedImmediateSize;
}
protected void WriteSettings(ISettingsSection sect) {
sect.Attribute(nameof(UpperCasePrefixes), UpperCasePrefixes);
sect.Attribute(nameof(UpperCaseMnemonics), UpperCaseMnemonics);
sect.Attribute(nameof(UpperCaseRegisters), UpperCaseRegisters);
sect.Attribute(nameof(UpperCaseKeywords), UpperCaseKeywords);
sect.Attribute(nameof(UpperCaseDecorators), UpperCaseDecorators);
sect.Attribute(nameof(UpperCaseAll), UpperCaseAll);
sect.Attribute(nameof(UppercasePrefixes), UppercasePrefixes);
sect.Attribute(nameof(UppercaseMnemonics), UppercaseMnemonics);
sect.Attribute(nameof(UppercaseRegisters), UppercaseRegisters);
sect.Attribute(nameof(UppercaseKeywords), UppercaseKeywords);
sect.Attribute(nameof(UppercaseDecorators), UppercaseDecorators);
sect.Attribute(nameof(UppercaseAll), UppercaseAll);
sect.Attribute(nameof(FirstOperandCharIndex), FirstOperandCharIndex);
sect.Attribute(nameof(TabSize), TabSize);
sect.Attribute(nameof(SpaceAfterOperandSeparator), SpaceAfterOperandSeparator);
@ -580,7 +664,7 @@ namespace dnSpy.Disassembly.X86 {
sect.Attribute(nameof(BinaryDigitGroupSize), BinaryDigitGroupSize);
sect.Attribute(nameof(DigitSeparator), DigitSeparator);
sect.Attribute(nameof(LeadingZeroes), LeadingZeroes);
sect.Attribute(nameof(UpperCaseHex), UpperCaseHex);
sect.Attribute(nameof(UppercaseHex), UppercaseHex);
sect.Attribute(nameof(SmallHexNumbersInDecimal), SmallHexNumbersInDecimal);
sect.Attribute(nameof(AddLeadingZeroToHexNumbers), AddLeadingZeroToHexNumbers);
sect.Attribute(nameof(NumberBase), NumberBase);
@ -593,17 +677,24 @@ namespace dnSpy.Disassembly.X86 {
sect.Attribute(nameof(ShowBranchSize), ShowBranchSize);
sect.Attribute(nameof(UsePseudoOps), UsePseudoOps);
sect.Attribute(nameof(ShowSymbolAddress), ShowSymbolAddress);
sect.Attribute(nameof(GasNakedRegisters), GasNakedRegisters);
sect.Attribute(nameof(GasShowMnemonicSizeSuffix), GasShowMnemonicSizeSuffix);
sect.Attribute(nameof(GasSpaceAfterMemoryOperandComma), GasSpaceAfterMemoryOperandComma);
sect.Attribute(nameof(MasmAddDsPrefix32), MasmAddDsPrefix32);
sect.Attribute(nameof(MasmSymbolDisplInBrackets), MasmSymbolDisplInBrackets);
sect.Attribute(nameof(MasmDisplInBrackets), MasmDisplInBrackets);
sect.Attribute(nameof(NasmShowSignExtendedImmediateSize), NasmShowSignExtendedImmediateSize);
}
protected DisassemblySettings CopyTo(DisassemblySettings other) {
if (other is null)
throw new ArgumentNullException(nameof(other));
other.UpperCasePrefixes = UpperCasePrefixes;
other.UpperCaseMnemonics = UpperCaseMnemonics;
other.UpperCaseRegisters = UpperCaseRegisters;
other.UpperCaseKeywords = UpperCaseKeywords;
other.UpperCaseDecorators = UpperCaseDecorators;
other.UpperCaseAll = UpperCaseAll;
other.UppercasePrefixes = UppercasePrefixes;
other.UppercaseMnemonics = UppercaseMnemonics;
other.UppercaseRegisters = UppercaseRegisters;
other.UppercaseKeywords = UppercaseKeywords;
other.UppercaseDecorators = UppercaseDecorators;
other.UppercaseAll = UppercaseAll;
other.FirstOperandCharIndex = FirstOperandCharIndex;
other.TabSize = TabSize;
other.SpaceAfterOperandSeparator = SpaceAfterOperandSeparator;
@ -628,7 +719,7 @@ namespace dnSpy.Disassembly.X86 {
other.BinaryDigitGroupSize = BinaryDigitGroupSize;
other.DigitSeparator = DigitSeparator;
other.LeadingZeroes = LeadingZeroes;
other.UpperCaseHex = UpperCaseHex;
other.UppercaseHex = UppercaseHex;
other.SmallHexNumbersInDecimal = SmallHexNumbersInDecimal;
other.AddLeadingZeroToHexNumbers = AddLeadingZeroToHexNumbers;
other.NumberBase = NumberBase;
@ -641,6 +732,13 @@ namespace dnSpy.Disassembly.X86 {
other.ShowBranchSize = ShowBranchSize;
other.UsePseudoOps = UsePseudoOps;
other.ShowSymbolAddress = ShowSymbolAddress;
other.GasNakedRegisters = GasNakedRegisters;
other.GasShowMnemonicSizeSuffix = GasShowMnemonicSizeSuffix;
other.GasSpaceAfterMemoryOperandComma = GasSpaceAfterMemoryOperandComma;
other.MasmAddDsPrefix32 = MasmAddDsPrefix32;
other.MasmSymbolDisplInBrackets = MasmSymbolDisplInBrackets;
other.MasmDisplInBrackets = MasmDisplInBrackets;
other.NasmShowSignExtendedImmediateSize = NasmShowSignExtendedImmediateSize;
return other;
}
}

View File

@ -56,7 +56,7 @@ namespace dnSpy.Disassembly.X86 {
options.BinaryDigitGroupSize = settings.BinaryDigitGroupSize;
options.DigitSeparator = settings.DigitSeparator;
options.LeadingZeroes = settings.LeadingZeroes;
options.UpperCaseHex = settings.UpperCaseHex;
options.UppercaseHex = settings.UppercaseHex;
options.SmallHexNumbersInDecimal = settings.SmallHexNumbersInDecimal;
options.AddLeadingZeroToHexNumbers = settings.AddLeadingZeroToHexNumbers;
options.NumberBase = ToIcedNumberBase(settings.NumberBase);
@ -70,12 +70,12 @@ namespace dnSpy.Disassembly.X86 {
options.ShowBranchSize = settings.ShowBranchSize;
options.DecimalSuffix = settings.DecimalSuffix;
options.HexDigitGroupSize = settings.HexDigitGroupSize;
options.UpperCasePrefixes = settings.UpperCasePrefixes;
options.UpperCaseMnemonics = settings.UpperCaseMnemonics;
options.UpperCaseRegisters = settings.UpperCaseRegisters;
options.UpperCaseKeywords = settings.UpperCaseKeywords;
options.UpperCaseDecorators = settings.UpperCaseDecorators;
options.UpperCaseAll = settings.UpperCaseAll;
options.UppercasePrefixes = settings.UppercasePrefixes;
options.UppercaseMnemonics = settings.UppercaseMnemonics;
options.UppercaseRegisters = settings.UppercaseRegisters;
options.UppercaseKeywords = settings.UppercaseKeywords;
options.UppercaseDecorators = settings.UppercaseDecorators;
options.UppercaseAll = settings.UppercaseAll;
options.FirstOperandCharIndex = settings.FirstOperandCharIndex;
options.TabSize = settings.TabSize;
options.SpaceAfterOperandSeparator = settings.SpaceAfterOperandSeparator;
@ -91,28 +91,19 @@ namespace dnSpy.Disassembly.X86 {
options.DecimalPrefix = settings.DecimalPrefix;
options.UsePseudoOps = settings.UsePseudoOps;
options.ShowSymbolAddress = settings.ShowSymbolAddress;
options.GasNakedRegisters = settings.GasNakedRegisters;
options.GasShowMnemonicSizeSuffix = settings.GasShowMnemonicSizeSuffix;
options.GasSpaceAfterMemoryOperandComma = settings.GasSpaceAfterMemoryOperandComma;
options.MasmAddDsPrefix32 = settings.MasmAddDsPrefix32;
options.MasmDisplInBrackets = settings.MasmDisplInBrackets;
options.MasmSymbolDisplInBrackets = settings.MasmSymbolDisplInBrackets;
options.NasmShowSignExtendedImmediateSize = settings.NasmShowSignExtendedImmediateSize;
}
public static MasmFormatterOptions ToMasm(this IMasmDisassemblySettings settings) {
var options = new MasmFormatterOptions();
public static FormatterOptions ToIcedOptions(this IX86DisassemblySettings settings) {
var options = new FormatterOptions();
CopyBase(options, settings);
return options;
}
public static NasmFormatterOptions ToNasm(this INasmDisassemblySettings settings) {
var options = new NasmFormatterOptions();
CopyBase(options, settings);
options.ShowSignExtendedImmediateSize = settings.ShowSignExtendedImmediateSize;
return options;
}
public static GasFormatterOptions ToGas(this IGasDisassemblySettings settings) {
var options = new GasFormatterOptions();
CopyBase(options, settings);
options.NakedRegisters = settings.NakedRegisters;
options.ShowMnemonicSizeSuffix = settings.ShowMnemonicSizeSuffix;
options.SpaceAfterMemoryOperandComma = settings.SpaceAfterMemoryOperandComma;
return options;
}
}
}

View File

@ -26,25 +26,8 @@ namespace dnSpy.Disassembly.X86 {
public override Guid Guid => new Guid("B2A9B538-925A-4029-9158-8C2FE632764D");
public override string Title => CodeStyleConstants.GAS_NAME;
public DisasmBooleanSetting NakedRegisters { get; }
public DisasmBooleanSetting ShowMnemonicSizeSuffix { get; }
public DisasmBooleanSetting SpaceAfterMemoryOperandComma { get; }
GasDisassemblySettings GasSettings => (GasDisassemblySettings)Settings;
public GasAppSettingsPage(GasDisassemblySettings x86DisassemblySettings)
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new GasFormatter(new GasFormatterOptions(), SymbolResolver.Instance)) {
NakedRegisters = AddDisasmBoolSetting(() => GasSettings.NakedRegisters, value => GasSettings.NakedRegisters = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
ShowMnemonicSizeSuffix = AddDisasmBoolSetting(() => GasSettings.ShowMnemonicSizeSuffix, value => GasSettings.ShowMnemonicSizeSuffix = value, Instruction.Create(Code.Xchg_r64_RAX, Register.RSI, Register.RAX));
SpaceAfterMemoryOperandComma = AddDisasmBoolSetting(() => GasSettings.SpaceAfterMemoryOperandComma, value => GasSettings.SpaceAfterMemoryOperandComma = value, Instruction.Create(Code.Mov_rm64_r64, new MemoryOperand(Register.RAX, Register.RDI, 4, 0x12345678, 8), Register.RCX));
}
protected override void InitializeFormatterOptionsCore(FormatterOptions options) {
var gas = (GasFormatterOptions)options;
gas.NakedRegisters = GasSettings.NakedRegisters;
gas.ShowMnemonicSizeSuffix = GasSettings.ShowMnemonicSizeSuffix;
gas.SpaceAfterMemoryOperandComma = GasSettings.SpaceAfterMemoryOperandComma;
}
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new GasFormatter(SymbolResolver.Instance)) { }
public override void OnApply() =>
((GasDisassemblySettings)x86DisassemblySettings).CopyTo((GasDisassemblySettings)_global_x86DisassemblySettings);

View File

@ -24,60 +24,23 @@ using dnSpy.Contracts.Disassembly;
using dnSpy.Contracts.Settings;
namespace dnSpy.Disassembly.X86 {
class GasDisassemblySettings : DisassemblySettings, IGasDisassemblySettings {
class GasDisassemblySettings : DisassemblySettings, IX86DisassemblySettings {
public GasDisassemblySettings() {
HexPrefix = "0x";
OctalPrefix = "0";
BinaryPrefix = "0b";
}
public bool NakedRegisters {
get => nakedRegisters;
set {
if (value != nakedRegisters) {
nakedRegisters = value;
OnPropertyChanged(nameof(NakedRegisters));
}
}
}
bool nakedRegisters;
public bool ShowMnemonicSizeSuffix {
get => showMnemonicSizeSuffix;
set {
if (value != showMnemonicSizeSuffix) {
showMnemonicSizeSuffix = value;
OnPropertyChanged(nameof(ShowMnemonicSizeSuffix));
}
}
}
bool showMnemonicSizeSuffix;
public bool SpaceAfterMemoryOperandComma {
get => spaceAfterMemoryOperandComma;
set {
if (value != spaceAfterMemoryOperandComma) {
spaceAfterMemoryOperandComma = value;
OnPropertyChanged(nameof(SpaceAfterMemoryOperandComma));
}
}
}
bool spaceAfterMemoryOperandComma;
public GasDisassemblySettings Clone() => CopyTo(new GasDisassemblySettings());
public GasDisassemblySettings CopyTo(GasDisassemblySettings other) {
if (other is null)
throw new ArgumentNullException(nameof(other));
base.CopyTo(other);
other.NakedRegisters = NakedRegisters;
other.ShowMnemonicSizeSuffix = ShowMnemonicSizeSuffix;
other.SpaceAfterMemoryOperandComma = SpaceAfterMemoryOperandComma;
return other;
}
}
[Export(typeof(IGasDisassemblySettings))]
[Export(typeof(GasDisassemblySettingsImpl))]
sealed class GasDisassemblySettingsImpl : GasDisassemblySettings {
static readonly Guid SETTINGS_GUID = new Guid("40476B68-2E8A-4507-8F59-727FE87A04EE");
@ -90,9 +53,6 @@ namespace dnSpy.Disassembly.X86 {
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
ReadSettings(sect);
NakedRegisters = sect.Attribute<bool?>(nameof(NakedRegisters)) ?? NakedRegisters;
ShowMnemonicSizeSuffix = sect.Attribute<bool?>(nameof(ShowMnemonicSizeSuffix)) ?? ShowMnemonicSizeSuffix;
SpaceAfterMemoryOperandComma = sect.Attribute<bool?>(nameof(SpaceAfterMemoryOperandComma)) ?? SpaceAfterMemoryOperandComma;
PropertyChanged += OnPropertyChanged;
}
@ -102,9 +62,6 @@ namespace dnSpy.Disassembly.X86 {
void Save() {
var sect = settingsService.RecreateSection(SETTINGS_GUID);
WriteSettings(sect);
sect.Attribute(nameof(NakedRegisters), NakedRegisters);
sect.Attribute(nameof(ShowMnemonicSizeSuffix), ShowMnemonicSizeSuffix);
sect.Attribute(nameof(SpaceAfterMemoryOperandComma), SpaceAfterMemoryOperandComma);
}
}
}

View File

@ -27,9 +27,7 @@ namespace dnSpy.Disassembly.X86 {
public override string Title => CodeStyleConstants.MASM_NAME;
public MasmAppSettingsPage(MasmDisassemblySettings x86DisassemblySettings)
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new MasmFormatter(new MasmFormatterOptions(), SymbolResolver.Instance)) { }
protected override void InitializeFormatterOptionsCore(FormatterOptions options) { }
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new MasmFormatter(SymbolResolver.Instance)) { }
public override void OnApply() =>
((MasmDisassemblySettings)x86DisassemblySettings).CopyTo((MasmDisassemblySettings)_global_x86DisassemblySettings);

View File

@ -24,60 +24,23 @@ using dnSpy.Contracts.Disassembly;
using dnSpy.Contracts.Settings;
namespace dnSpy.Disassembly.X86 {
class MasmDisassemblySettings : DisassemblySettings, IMasmDisassemblySettings {
class MasmDisassemblySettings : DisassemblySettings, IX86DisassemblySettings {
public MasmDisassemblySettings() {
HexSuffix = "h";
OctalSuffix = "o";
BinarySuffix = "b";
}
public bool AddDsPrefix32 {
get => addDsPrefix32;
set {
if (value != addDsPrefix32) {
addDsPrefix32 = value;
OnPropertyChanged(nameof(AddDsPrefix32));
}
}
}
bool addDsPrefix32 = true;
public bool SymbolDisplInBrackets {
get => symbolDisplInBrackets;
set {
if (value != symbolDisplInBrackets) {
symbolDisplInBrackets = value;
OnPropertyChanged(nameof(SymbolDisplInBrackets));
}
}
}
bool symbolDisplInBrackets = true;
public bool DisplInBrackets {
get => displInBrackets;
set {
if (value != displInBrackets) {
displInBrackets = value;
OnPropertyChanged(nameof(DisplInBrackets));
}
}
}
bool displInBrackets = true;
public MasmDisassemblySettings Clone() => CopyTo(new MasmDisassemblySettings());
public MasmDisassemblySettings CopyTo(MasmDisassemblySettings other) {
if (other is null)
throw new ArgumentNullException(nameof(other));
base.CopyTo(other);
other.AddDsPrefix32 = AddDsPrefix32;
other.SymbolDisplInBrackets = SymbolDisplInBrackets;
other.DisplInBrackets = DisplInBrackets;
return other;
}
}
[Export(typeof(IMasmDisassemblySettings))]
[Export(typeof(MasmDisassemblySettingsImpl))]
sealed class MasmDisassemblySettingsImpl : MasmDisassemblySettings {
static readonly Guid SETTINGS_GUID = new Guid("F70D9AFD-0233-4630-A2A7-0C5A157158FF");
@ -90,9 +53,6 @@ namespace dnSpy.Disassembly.X86 {
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
ReadSettings(sect);
AddDsPrefix32 = sect.Attribute<bool?>(nameof(AddDsPrefix32)) ?? AddDsPrefix32;
SymbolDisplInBrackets = sect.Attribute<bool?>(nameof(SymbolDisplInBrackets)) ?? SymbolDisplInBrackets;
DisplInBrackets = sect.Attribute<bool?>(nameof(DisplInBrackets)) ?? DisplInBrackets;
PropertyChanged += OnPropertyChanged;
}
@ -102,9 +62,6 @@ namespace dnSpy.Disassembly.X86 {
void Save() {
var sect = settingsService.RecreateSection(SETTINGS_GUID);
WriteSettings(sect);
sect.Attribute(nameof(AddDsPrefix32), AddDsPrefix32);
sect.Attribute(nameof(SymbolDisplInBrackets), SymbolDisplInBrackets);
sect.Attribute(nameof(DisplInBrackets), DisplInBrackets);
}
}
}

View File

@ -26,15 +26,8 @@ namespace dnSpy.Disassembly.X86 {
public override Guid Guid => new Guid("929A1758-C8CC-450E-A214-90B390A846DF");
public override string Title => CodeStyleConstants.NASM_NAME;
NasmDisassemblySettings NasmSettings => (NasmDisassemblySettings)Settings;
public NasmAppSettingsPage(NasmDisassemblySettings x86DisassemblySettings)
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new NasmFormatter(new NasmFormatterOptions(), SymbolResolver.Instance)) { }
protected override void InitializeFormatterOptionsCore(FormatterOptions options) {
var nasm = (NasmFormatterOptions)options;
nasm.ShowSignExtendedImmediateSize = NasmSettings.ShowSignExtendedImmediateSize;
}
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new NasmFormatter(SymbolResolver.Instance)) { }
public override void OnApply() =>
((NasmDisassemblySettings)x86DisassemblySettings).CopyTo((NasmDisassemblySettings)_global_x86DisassemblySettings);

View File

@ -24,36 +24,23 @@ using dnSpy.Contracts.Disassembly;
using dnSpy.Contracts.Settings;
namespace dnSpy.Disassembly.X86 {
class NasmDisassemblySettings : DisassemblySettings, INasmDisassemblySettings {
class NasmDisassemblySettings : DisassemblySettings, IX86DisassemblySettings {
public NasmDisassemblySettings() {
HexSuffix = "h";
OctalSuffix = "o";
BinarySuffix = "b";
}
public bool ShowSignExtendedImmediateSize {
get => showSignExtendedImmediateSize;
set {
if (value != showSignExtendedImmediateSize) {
showSignExtendedImmediateSize = value;
OnPropertyChanged(nameof(ShowSignExtendedImmediateSize));
}
}
}
bool showSignExtendedImmediateSize;
public NasmDisassemblySettings Clone() => CopyTo(new NasmDisassemblySettings());
public NasmDisassemblySettings CopyTo(NasmDisassemblySettings other) {
if (other is null)
throw new ArgumentNullException(nameof(other));
base.CopyTo(other);
other.ShowSignExtendedImmediateSize = ShowSignExtendedImmediateSize;
return other;
}
}
[Export(typeof(INasmDisassemblySettings))]
[Export(typeof(NasmDisassemblySettingsImpl))]
sealed class NasmDisassemblySettingsImpl : NasmDisassemblySettings {
static readonly Guid SETTINGS_GUID = new Guid("2F066064-741B-454E-9D21-B04BCF802018");
@ -66,7 +53,6 @@ namespace dnSpy.Disassembly.X86 {
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
ReadSettings(sect);
ShowSignExtendedImmediateSize = sect.Attribute<bool?>(nameof(ShowSignExtendedImmediateSize)) ?? ShowSignExtendedImmediateSize;
PropertyChanged += OnPropertyChanged;
}
@ -76,7 +62,6 @@ namespace dnSpy.Disassembly.X86 {
void Save() {
var sect = settingsService.RecreateSection(SETTINGS_GUID);
WriteSettings(sect);
sect.Attribute(nameof(ShowSignExtendedImmediateSize), ShowSignExtendedImmediateSize);
}
}
}

View File

@ -6804,18 +6804,18 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCasePrefixes.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCasePrefixes}"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCasePrefixes.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseMnemonics.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseMnemonics}"/>
<TextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseMnemonics.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseRegisters}"/>
<TextBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseKeywords.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseKeywords}"/>
<TextBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseKeywords.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseHex.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseHex}"/>
<TextBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseHex.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseAll.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseAll}"/>
<TextBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseAll.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercasePrefixes.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCasePrefixes}"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercasePrefixes.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseMnemonics.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseMnemonics}"/>
<TextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseMnemonics.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseRegisters}"/>
<TextBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseKeywords.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseKeywords}"/>
<TextBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseKeywords.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseHex.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseHex}"/>
<TextBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseHex.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseAll.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseAll}"/>
<TextBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseAll.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterOperandSeparator.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterOperandSeparator}"/>
<TextBox Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding SpaceAfterOperandSeparator.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterMemoryBracket.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterMemoryBracket}"/>
@ -6931,18 +6931,18 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCasePrefixes.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCasePrefixes}"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCasePrefixes.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseMnemonics.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseMnemonics}"/>
<TextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseMnemonics.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseRegisters}"/>
<TextBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseKeywords.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseKeywords}"/>
<TextBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseKeywords.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseHex.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseHex}"/>
<TextBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseHex.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseAll.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseAll}"/>
<TextBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseAll.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercasePrefixes.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCasePrefixes}"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercasePrefixes.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseMnemonics.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseMnemonics}"/>
<TextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseMnemonics.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseRegisters}"/>
<TextBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseKeywords.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseKeywords}"/>
<TextBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseKeywords.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseHex.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseHex}"/>
<TextBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseHex.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseAll.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseAll}"/>
<TextBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseAll.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterOperandSeparator.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterOperandSeparator}"/>
<TextBox Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding SpaceAfterOperandSeparator.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterMemoryBracket.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterMemoryBracket}"/>
@ -7052,22 +7052,22 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCasePrefixes.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCasePrefixes}"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCasePrefixes.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseMnemonics.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseMnemonics}"/>
<TextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseMnemonics.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseRegisters}"/>
<TextBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseHex.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseHex}"/>
<TextBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseHex.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UpperCaseAll.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseAll}"/>
<TextBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UpperCaseAll.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercasePrefixes.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCasePrefixes}"/>
<TextBox Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercasePrefixes.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseMnemonics.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseMnemonics}"/>
<TextBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseMnemonics.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseRegisters}"/>
<TextBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseHex.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseHex}"/>
<TextBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseHex.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UppercaseAll.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UpperCaseAll}"/>
<TextBox Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UppercaseAll.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterOperandSeparator.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterOperandSeparator}"/>
<TextBox Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding SpaceAfterOperandSeparator.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="12" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterMemoryBracket.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterMemoryBracket}"/>
<TextBox Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding SpaceAfterMemoryBracket.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding SpaceAfterMemoryOperandComma.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterMemoryOperandComma}"/>
<TextBox Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding SpaceAfterMemoryOperandComma.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding GasSpaceAfterMemoryOperandComma.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_SpaceAfterMemoryOperandComma}"/>
<TextBox Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding GasSpaceAfterMemoryOperandComma.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="16" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding AlwaysShowScale.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_AlwaysShowScale}"/>
<TextBox Grid.Row="17" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding AlwaysShowScale.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="18" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding AlwaysShowSegmentRegister.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_AlwaysShowSegmentRegister}"/>
@ -7092,10 +7092,10 @@
<TextBox Grid.Row="37" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UsePseudoOps.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="38" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding ShowSymbolAddress.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_ShowSymbolAddress}"/>
<TextBox Grid.Row="39" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding ShowSymbolAddress.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="40" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding NakedRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_NakedRegisters}"/>
<TextBox Grid.Row="41" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding NakedRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="42" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding ShowMnemonicSizeSuffix.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_ShowMnemonicSizeSuffix}"/>
<TextBox Grid.Row="43" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding ShowMnemonicSizeSuffix.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="40" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding GasNakedRegisters.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_NakedRegisters}"/>
<TextBox Grid.Row="41" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding GasNakedRegisters.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="42" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding GasShowMnemonicSizeSuffix.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_ShowMnemonicSizeSuffix}"/>
<TextBox Grid.Row="43" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding GasShowMnemonicSizeSuffix.Disassembly, Mode=OneWay}" />
<CheckBox Grid.Row="44" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" IsChecked="{Binding UseHexNumbers.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_UseHexNumbers}"/>
<TextBox Grid.Row="45" Grid.Column="0" Grid.ColumnSpan="2" Margin="0 5 0 0" Background="Transparent" IsReadOnly="True" TextWrapping="NoWrap" Text="{Binding UseHexNumbers.Disassembly, Mode=OneWay}" />
<Label Grid.Row="46" Grid.Column="0" Margin="-5 5 0 0" Target="{Binding ElementName=opColumnTextBox}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_OperandColumn}" />