mirror of
https://github.com/dnSpy/dnSpy.git
synced 2025-01-09 12:27:30 +08:00
Update pkgref vers, rename some props, remove some ifaces, update code
This commit is contained in:
parent
12ddf66a3a
commit
d04255022a
@ -36,10 +36,10 @@
|
|||||||
|
|
||||||
<!-- Update app.config whenever some of these versions change (eg. dnlib version) -->
|
<!-- Update app.config whenever some of these versions change (eg. dnlib version) -->
|
||||||
<DiaSymReaderVersion>1.7.0</DiaSymReaderVersion>
|
<DiaSymReaderVersion>1.7.0</DiaSymReaderVersion>
|
||||||
<DnlibVersion>3.3.1</DnlibVersion>
|
<DnlibVersion>3.3.2</DnlibVersion>
|
||||||
<IcedVersion>1.5.0</IcedVersion>
|
<IcedVersion>1.6.0</IcedVersion>
|
||||||
<MSBuildNuGetVersion>16.4.0</MSBuildNuGetVersion>
|
<MSBuildNuGetVersion>16.5.0</MSBuildNuGetVersion>
|
||||||
<MSDiagRuntimeVersion>1.1.61812</MSDiagRuntimeVersion>
|
<MSDiagRuntimeVersion>1.1.116301</MSDiagRuntimeVersion>
|
||||||
<MSVSCompositionVersion>16.4.11</MSVSCompositionVersion>
|
<MSVSCompositionVersion>16.4.11</MSVSCompositionVersion>
|
||||||
<MSVSIntellisenseVersion>15.5.27130</MSVSIntellisenseVersion>
|
<MSVSIntellisenseVersion>15.5.27130</MSVSIntellisenseVersion>
|
||||||
<MSVSTextVersion>15.5.27130</MSVSTextVersion>
|
<MSVSTextVersion>15.5.27130</MSVSTextVersion>
|
||||||
|
@ -197,7 +197,7 @@ namespace dnSpy.AsmEditor.Assembly {
|
|||||||
VersionMinor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true);
|
VersionMinor = new UInt16VM(a => { HasErrorUpdated(); OnPropertyChanged(nameof(AssemblyFullName)); }, true);
|
||||||
VersionBuild = 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);
|
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);
|
CustomAttributesVM = new CustomAttributesVM(ownerModule, decompilerService);
|
||||||
DeclSecuritiesVM = new DeclSecuritiesVM(ownerModule, decompilerService, null, null);
|
DeclSecuritiesVM = new DeclSecuritiesVM(ownerModule, decompilerService, null, null);
|
||||||
Reinitialize();
|
Reinitialize();
|
||||||
|
@ -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&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; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -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; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,32 +27,32 @@ namespace dnSpy.Contracts.Disassembly {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prefixes are upper cased
|
/// Prefixes are upper cased
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCasePrefixes { get; set; }
|
bool UppercasePrefixes { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Mnemonics are upper cased
|
/// Mnemonics are upper cased
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCaseMnemonics { get; set; }
|
bool UppercaseMnemonics { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Registers are upper cased
|
/// Registers are upper cased
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCaseRegisters { get; set; }
|
bool UppercaseRegisters { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Keywords are upper cased (eg. BYTE PTR, SHORT)
|
/// Keywords are upper cased (eg. BYTE PTR, SHORT)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCaseKeywords { get; set; }
|
bool UppercaseKeywords { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Upper case decorators, eg. {z}, {sae}, {rd-sae}
|
/// Upper case decorators, eg. {z}, {sae}, {rd-sae}
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCaseDecorators { get; set; }
|
bool UppercaseDecorators { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Everything is upper cased, except numbers and their prefixes/suffixes
|
/// Everything is upper cased, except numbers and their prefixes/suffixes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCaseAll { get; set; }
|
bool UppercaseAll { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Character index (0-based) where the first operand is formatted. Can be set to 0 to format it immediately after the mnemonic.
|
/// 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>
|
/// <summary>
|
||||||
/// Use upper case hex digits
|
/// Use upper case hex digits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool UpperCaseHex { get; set; }
|
bool UppercaseHex { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Small hex numbers (-9 .. 9) are shown in decimal
|
/// 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]'
|
/// Show the original value after the symbol name, eg. 'mov eax,[myfield (12345678)]' vs 'mov eax,[myfield]'
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool ShowSymbolAddress { get; set; }
|
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -373,11 +373,11 @@ namespace dnSpy.Contracts.MVVM {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets/sets whether to use upper case hex digits
|
/// Gets/sets whether to use upper case hex digits
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool UpperCaseHex {
|
public bool UppercaseHex {
|
||||||
get => upperCaseHex;
|
get => uppercaseHex;
|
||||||
set => upperCaseHex = value;
|
set => uppercaseHex = value;
|
||||||
}
|
}
|
||||||
bool upperCaseHex = true;
|
bool uppercaseHex = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
@ -396,7 +396,7 @@ namespace dnSpy.Contracts.MVVM {
|
|||||||
: base(onUpdated) => SetValueFromConstructor(value!);// can be null, but we can't use 'T?'
|
: base(onUpdated) => SetValueFromConstructor(value!);// can be null, but we can't use 'T?'
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
protected override string OnNewValue(IList<byte> value) => SimpleTypeConverter.ByteArrayToString(value, UpperCaseHex);
|
protected override string OnNewValue(IList<byte> value) => SimpleTypeConverter.ByteArrayToString(value, UppercaseHex);
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
protected override string? ConvertToValue(out IList<byte> value) {
|
protected override string? ConvertToValue(out IList<byte> value) {
|
||||||
|
@ -27,6 +27,6 @@ namespace dnSpy.Disassembly.Viewer {
|
|||||||
InstructionAddresses = 0x00000002,
|
InstructionAddresses = 0x00000002,
|
||||||
InstructionBytes = 0x00000004,
|
InstructionBytes = 0x00000004,
|
||||||
AddLabels = 0x00000008,
|
AddLabels = 0x00000008,
|
||||||
UpperCaseHex = 0x00000010,
|
UppercaseHex = 0x00000010,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
WriteComment(output, commentPrefix, GetCodeSizeString(blocks));
|
WriteComment(output, commentPrefix, GetCodeSizeString(blocks));
|
||||||
output.Write(Environment.NewLine, BoxedTextColor.Text);
|
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>();
|
var variables = codeInfo?.Variables ?? Array.Empty<X86Variable>();
|
||||||
if (variables.Length != 0) {
|
if (variables.Length != 0) {
|
||||||
var sb = new System.Text.StringBuilder();
|
var sb = new System.Text.StringBuilder();
|
||||||
@ -257,9 +257,9 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
sb.Append("???");
|
sb.Append("???");
|
||||||
sb.Append(' ');
|
sb.Append(' ');
|
||||||
}
|
}
|
||||||
sb.Append(FormatAddress(bitness, varInfo.LiveAddress, upperCaseHex));
|
sb.Append(FormatAddress(bitness, varInfo.LiveAddress, uppercaseHex));
|
||||||
sb.Append('-');
|
sb.Append('-');
|
||||||
sb.Append(FormatAddress(bitness, varInfo.LiveAddress + varInfo.LiveLength, upperCaseHex));
|
sb.Append(FormatAddress(bitness, varInfo.LiveAddress + varInfo.LiveLength, uppercaseHex));
|
||||||
sb.Append(' ');
|
sb.Append(' ');
|
||||||
switch (varInfo.LocationKind) {
|
switch (varInfo.LocationKind) {
|
||||||
case X86VariableLocationKind.Other:
|
case X86VariableLocationKind.Other:
|
||||||
@ -282,7 +282,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
sb.Append('+');
|
sb.Append('+');
|
||||||
if (memOffs != 0) {
|
if (memOffs != 0) {
|
||||||
sb.Append(formatter.Options.HexPrefix ?? string.Empty);
|
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(formatter.Options.HexSuffix ?? string.Empty);
|
||||||
}
|
}
|
||||||
sb.Append(']');
|
sb.Append(']');
|
||||||
@ -316,7 +316,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
for (int j = 0; j < instrs.Length; j++) {
|
for (int j = 0; j < instrs.Length; j++) {
|
||||||
ref var instr = ref instrs[j].Instruction;
|
ref var instr = ref instrs[j].Instruction;
|
||||||
if ((formatterOptions & InternalFormatterOptions.InstructionAddresses) != 0) {
|
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(address, BoxedTextColor.AsmAddress);
|
||||||
output.Write(" ", BoxedTextColor.Text);
|
output.Write(" ", BoxedTextColor.Text);
|
||||||
}
|
}
|
||||||
@ -328,7 +328,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
var codeBytes = code.Array!;
|
var codeBytes = code.Array!;
|
||||||
for (int k = 0; k < code.Count; k++) {
|
for (int k = 0; k < code.Count; k++) {
|
||||||
byte b = codeBytes[k + code.Offset];
|
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;
|
int missingBytes = HEXBYTES_COLUMN_BYTE_LENGTH - code.Count;
|
||||||
for (int k = 0; k < missingBytes; k++)
|
for (int k = 0; k < missingBytes; k++)
|
||||||
@ -357,16 +357,16 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
return codeSize;
|
return codeSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
static string FormatAddress(int bitness, ulong address, bool upperCaseHex) {
|
static string FormatAddress(int bitness, ulong address, bool uppercaseHex) {
|
||||||
switch (bitness) {
|
switch (bitness) {
|
||||||
case 16:
|
case 16:
|
||||||
return address.ToString(upperCaseHex ? "X4" : "x4");
|
return address.ToString(uppercaseHex ? "X4" : "x4");
|
||||||
|
|
||||||
case 32:
|
case 32:
|
||||||
return address.ToString(upperCaseHex ? "X8" : "x8");
|
return address.ToString(uppercaseHex ? "X8" : "x8");
|
||||||
|
|
||||||
case 64:
|
case 64:
|
||||||
return address.ToString(upperCaseHex ? "X16" : "x16");
|
return address.ToString(uppercaseHex ? "X16" : "x16");
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Debug.Fail($"Unknown bitness: {bitness}");
|
Debug.Fail($"Unknown bitness: {bitness}");
|
||||||
|
@ -30,9 +30,9 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
[Export(typeof(DisassemblyContentProviderFactoryDependencies))]
|
[Export(typeof(DisassemblyContentProviderFactoryDependencies))]
|
||||||
sealed class DisassemblyContentProviderFactoryDependencies {
|
sealed class DisassemblyContentProviderFactoryDependencies {
|
||||||
public DisassemblyContentSettings DisasmSettings { get; }
|
public DisassemblyContentSettings DisasmSettings { get; }
|
||||||
public IMasmDisassemblySettings MasmSettings { get; }
|
public IX86DisassemblySettings MasmSettings { get; }
|
||||||
public INasmDisassemblySettings NasmSettings { get; }
|
public IX86DisassemblySettings NasmSettings { get; }
|
||||||
public IGasDisassemblySettings GasSettings { get; }
|
public IX86DisassemblySettings GasSettings { get; }
|
||||||
|
|
||||||
[ImportingConstructor]
|
[ImportingConstructor]
|
||||||
DisassemblyContentProviderFactoryDependencies(DisassemblyContentSettingsImpl disasm, MasmDisassemblySettingsImpl masm, NasmDisassemblySettingsImpl nasm, GasDisassemblySettingsImpl gas) {
|
DisassemblyContentProviderFactoryDependencies(DisassemblyContentSettingsImpl disasm, MasmDisassemblySettingsImpl masm, NasmDisassemblySettingsImpl nasm, GasDisassemblySettingsImpl gas) {
|
||||||
@ -140,7 +140,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
addresses.Add((ulong)(int)instr.MemoryDisplacement);
|
addresses.Add(instr.MemoryDisplacement64);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,9 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
readonly int bitness;
|
readonly int bitness;
|
||||||
readonly CachedSymbolResolver cachedSymbolResolver;
|
readonly CachedSymbolResolver cachedSymbolResolver;
|
||||||
readonly DisassemblyContentSettings disasmSettings;
|
readonly DisassemblyContentSettings disasmSettings;
|
||||||
readonly IMasmDisassemblySettings masmSettings;
|
readonly IX86DisassemblySettings masmSettings;
|
||||||
readonly INasmDisassemblySettings nasmSettings;
|
readonly IX86DisassemblySettings nasmSettings;
|
||||||
readonly IGasDisassemblySettings gasSettings;
|
readonly IX86DisassemblySettings gasSettings;
|
||||||
readonly DisassemblyContentFormatterOptions formatterOptions;
|
readonly DisassemblyContentFormatterOptions formatterOptions;
|
||||||
readonly string? header;
|
readonly string? header;
|
||||||
readonly NativeCodeOptimization optimization;
|
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.bitness = bitness;
|
||||||
this.cachedSymbolResolver = cachedSymbolResolver ?? throw new ArgumentNullException(nameof(cachedSymbolResolver));
|
this.cachedSymbolResolver = cachedSymbolResolver ?? throw new ArgumentNullException(nameof(cachedSymbolResolver));
|
||||||
this.disasmSettings = disasmSettings ?? throw new ArgumentNullException(nameof(disasmSettings));
|
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) {
|
(Formatter formatter, string commentPrefix, DisassemblyContentKind contentKind) GetDisassemblerInfo(X86Disassembler disasm) {
|
||||||
switch (disasm) {
|
switch (disasm) {
|
||||||
case X86Disassembler.Masm:
|
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:
|
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:
|
case X86Disassembler.Gas:
|
||||||
return (new GasFormatter(gasSettings.ToGas(), symbolResolver), GAS_COMMENT, DisassemblyContentKind.ATT);
|
return (new GasFormatter(gasSettings.ToIcedOptions(), symbolResolver), GAS_COMMENT, DisassemblyContentKind.ATT);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Debug.Fail($"Unknown disassembler: {disasm}");
|
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;
|
var options = InternalFormatterOptions.None;
|
||||||
if (EmptyLineBetweenBasicBlocks)
|
if (EmptyLineBetweenBasicBlocks)
|
||||||
options |= InternalFormatterOptions.EmptyLineBetweenBasicBlocks;
|
options |= InternalFormatterOptions.EmptyLineBetweenBasicBlocks;
|
||||||
@ -159,8 +159,8 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
options |= InternalFormatterOptions.InstructionBytes;
|
options |= InternalFormatterOptions.InstructionBytes;
|
||||||
if (AddLabels)
|
if (AddLabels)
|
||||||
options |= InternalFormatterOptions.AddLabels;
|
options |= InternalFormatterOptions.AddLabels;
|
||||||
if (upperCaseHex)
|
if (uppercaseHex)
|
||||||
options |= InternalFormatterOptions.UpperCaseHex;
|
options |= InternalFormatterOptions.UppercaseHex;
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ namespace dnSpy.Disassembly.Viewer.X86 {
|
|||||||
|
|
||||||
var output = new DisassemblyContentOutput();
|
var output = new DisassemblyContentOutput();
|
||||||
var disasmInfo = GetDisassemblerInfo(disasmSettings.X86Disassembler);
|
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);
|
return output.Create(disasmInfo.contentKind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
switch (instr.MemoryDisplSize) {
|
switch (instr.MemoryDisplSize) {
|
||||||
case 2:
|
case 2:
|
||||||
case 4: displ = instr.MemoryDisplacement; break;
|
case 4: displ = instr.MemoryDisplacement; break;
|
||||||
case 8: displ = (ulong)(int)instr.MemoryDisplacement; break;
|
case 8: displ = instr.MemoryDisplacement64; break;
|
||||||
default:
|
default:
|
||||||
Debug.Fail($"Unknown mem displ size: {instr.MemoryDisplSize}");
|
Debug.Fail($"Unknown mem displ size: {instr.MemoryDisplSize}");
|
||||||
goto case 8;
|
goto case 8;
|
||||||
|
@ -42,12 +42,12 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
public sealed override object? UIObject => this;
|
public sealed override object? UIObject => this;
|
||||||
|
|
||||||
public DisasmBooleanSetting UseHexNumbers { get; }
|
public DisasmBooleanSetting UseHexNumbers { get; }
|
||||||
public DisasmBooleanSetting UpperCasePrefixes { get; }
|
public DisasmBooleanSetting UppercasePrefixes { get; }
|
||||||
public DisasmBooleanSetting UpperCaseMnemonics { get; }
|
public DisasmBooleanSetting UppercaseMnemonics { get; }
|
||||||
public DisasmBooleanSetting UpperCaseRegisters { get; }
|
public DisasmBooleanSetting UppercaseRegisters { get; }
|
||||||
public DisasmBooleanSetting UpperCaseKeywords { get; }
|
public DisasmBooleanSetting UppercaseKeywords { get; }
|
||||||
public DisasmBooleanSetting UpperCaseHex { get; }
|
public DisasmBooleanSetting UppercaseHex { get; }
|
||||||
public DisasmBooleanSetting UpperCaseAll { get; }
|
public DisasmBooleanSetting UppercaseAll { get; }
|
||||||
public DisasmBooleanSetting SpaceAfterOperandSeparator { get; }
|
public DisasmBooleanSetting SpaceAfterOperandSeparator { get; }
|
||||||
public DisasmBooleanSetting SpaceAfterMemoryBracket { get; }
|
public DisasmBooleanSetting SpaceAfterMemoryBracket { get; }
|
||||||
public DisasmBooleanSetting SpaceBetweenMemoryAddOperators { get; }
|
public DisasmBooleanSetting SpaceBetweenMemoryAddOperators { get; }
|
||||||
@ -67,6 +67,9 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
public DisasmBooleanSetting ShowBranchSize { get; }
|
public DisasmBooleanSetting ShowBranchSize { get; }
|
||||||
public DisasmBooleanSetting UsePseudoOps { get; }
|
public DisasmBooleanSetting UsePseudoOps { get; }
|
||||||
public DisasmBooleanSetting ShowSymbolAddress { get; }
|
public DisasmBooleanSetting ShowSymbolAddress { get; }
|
||||||
|
public DisasmBooleanSetting GasNakedRegisters { get; }
|
||||||
|
public DisasmBooleanSetting GasShowMnemonicSizeSuffix { get; }
|
||||||
|
public DisasmBooleanSetting GasSpaceAfterMemoryOperandComma { get; }
|
||||||
|
|
||||||
public Int32VM OperandColumnVM { get; }
|
public Int32VM OperandColumnVM { get; }
|
||||||
|
|
||||||
@ -128,12 +131,12 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
() => Settings.NumberBase == Contracts.Disassembly.NumberBase.Hexadecimal,
|
() => Settings.NumberBase == Contracts.Disassembly.NumberBase.Hexadecimal,
|
||||||
value => Settings.NumberBase = value ? Contracts.Disassembly.NumberBase.Hexadecimal : Contracts.Disassembly.NumberBase.Decimal,
|
value => Settings.NumberBase = value ? Contracts.Disassembly.NumberBase.Hexadecimal : Contracts.Disassembly.NumberBase.Decimal,
|
||||||
Instruction.Create(Code.Mov_r64_imm64, Register.RDX, 0x123456789ABCDEF0));
|
Instruction.Create(Code.Mov_r64_imm64, Register.RDX, 0x123456789ABCDEF0));
|
||||||
UpperCasePrefixes = AddDisasmBoolSetting(() => Settings.UpperCasePrefixes, value => Settings.UpperCasePrefixes = 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));
|
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));
|
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));
|
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));
|
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));
|
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));
|
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)));
|
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)));
|
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));
|
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));
|
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));
|
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 => {
|
OperandColumnVM = new Int32VM(x86DisassemblySettings.FirstOperandCharIndex + 1, a => {
|
||||||
if (!OperandColumnVM.HasError)
|
if (!OperandColumnVM.HasError)
|
||||||
@ -184,14 +190,12 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InitializeFormatterOptions(FormatterOptions options) {
|
void InitializeFormatterOptions(FormatterOptions options) {
|
||||||
InitializeFormatterOptionsCore(options);
|
options.UppercasePrefixes = x86DisassemblySettings.UppercasePrefixes;
|
||||||
|
options.UppercaseMnemonics = x86DisassemblySettings.UppercaseMnemonics;
|
||||||
options.UpperCasePrefixes = x86DisassemblySettings.UpperCasePrefixes;
|
options.UppercaseRegisters = x86DisassemblySettings.UppercaseRegisters;
|
||||||
options.UpperCaseMnemonics = x86DisassemblySettings.UpperCaseMnemonics;
|
options.UppercaseKeywords = x86DisassemblySettings.UppercaseKeywords;
|
||||||
options.UpperCaseRegisters = x86DisassemblySettings.UpperCaseRegisters;
|
options.UppercaseDecorators = x86DisassemblySettings.UppercaseDecorators;
|
||||||
options.UpperCaseKeywords = x86DisassemblySettings.UpperCaseKeywords;
|
options.UppercaseAll = x86DisassemblySettings.UppercaseAll;
|
||||||
options.UpperCaseDecorators = x86DisassemblySettings.UpperCaseDecorators;
|
|
||||||
options.UpperCaseAll = x86DisassemblySettings.UpperCaseAll;
|
|
||||||
options.FirstOperandCharIndex = x86DisassemblySettings.FirstOperandCharIndex;
|
options.FirstOperandCharIndex = x86DisassemblySettings.FirstOperandCharIndex;
|
||||||
options.TabSize = x86DisassemblySettings.TabSize;
|
options.TabSize = x86DisassemblySettings.TabSize;
|
||||||
options.SpaceAfterOperandSeparator = x86DisassemblySettings.SpaceAfterOperandSeparator;
|
options.SpaceAfterOperandSeparator = x86DisassemblySettings.SpaceAfterOperandSeparator;
|
||||||
@ -216,7 +220,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
options.BinaryDigitGroupSize = x86DisassemblySettings.BinaryDigitGroupSize;
|
options.BinaryDigitGroupSize = x86DisassemblySettings.BinaryDigitGroupSize;
|
||||||
options.DigitSeparator = x86DisassemblySettings.DigitSeparator;
|
options.DigitSeparator = x86DisassemblySettings.DigitSeparator;
|
||||||
options.LeadingZeroes = x86DisassemblySettings.LeadingZeroes;
|
options.LeadingZeroes = x86DisassemblySettings.LeadingZeroes;
|
||||||
options.UpperCaseHex = x86DisassemblySettings.UpperCaseHex;
|
options.UppercaseHex = x86DisassemblySettings.UppercaseHex;
|
||||||
options.SmallHexNumbersInDecimal = x86DisassemblySettings.SmallHexNumbersInDecimal;
|
options.SmallHexNumbersInDecimal = x86DisassemblySettings.SmallHexNumbersInDecimal;
|
||||||
options.AddLeadingZeroToHexNumbers = x86DisassemblySettings.AddLeadingZeroToHexNumbers;
|
options.AddLeadingZeroToHexNumbers = x86DisassemblySettings.AddLeadingZeroToHexNumbers;
|
||||||
options.NumberBase = UseHexNumbers.Value ? Iced.Intel.NumberBase.Hexadecimal : Iced.Intel.NumberBase.Decimal;
|
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.ShowBranchSize = x86DisassemblySettings.ShowBranchSize;
|
||||||
options.UsePseudoOps = x86DisassemblySettings.UsePseudoOps;
|
options.UsePseudoOps = x86DisassemblySettings.UsePseudoOps;
|
||||||
options.ShowSymbolAddress = x86DisassemblySettings.ShowSymbolAddress;
|
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
|
// The options are only used to show an example so ignore these properties
|
||||||
options.TabSize = 0;
|
options.TabSize = 0;
|
||||||
options.FirstOperandCharIndex = 0;
|
options.FirstOperandCharIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void InitializeFormatterOptionsCore(FormatterOptions options);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,71 +27,71 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
public event PropertyChangedEventHandler? PropertyChanged;
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
protected void OnPropertyChanged(string propName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
|
protected void OnPropertyChanged(string propName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
|
||||||
|
|
||||||
public bool UpperCasePrefixes {
|
public bool UppercasePrefixes {
|
||||||
get => upperCasePrefixes;
|
get => uppercasePrefixes;
|
||||||
set {
|
set {
|
||||||
if (value != upperCasePrefixes) {
|
if (value != uppercasePrefixes) {
|
||||||
upperCasePrefixes = value;
|
uppercasePrefixes = value;
|
||||||
OnPropertyChanged(nameof(UpperCasePrefixes));
|
OnPropertyChanged(nameof(UppercasePrefixes));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCasePrefixes;
|
bool uppercasePrefixes;
|
||||||
|
|
||||||
public bool UpperCaseMnemonics {
|
public bool UppercaseMnemonics {
|
||||||
get => upperCaseMnemonics;
|
get => uppercaseMnemonics;
|
||||||
set {
|
set {
|
||||||
if (value != upperCaseMnemonics) {
|
if (value != uppercaseMnemonics) {
|
||||||
upperCaseMnemonics = value;
|
uppercaseMnemonics = value;
|
||||||
OnPropertyChanged(nameof(UpperCaseMnemonics));
|
OnPropertyChanged(nameof(UppercaseMnemonics));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCaseMnemonics;
|
bool uppercaseMnemonics;
|
||||||
|
|
||||||
public bool UpperCaseRegisters {
|
public bool UppercaseRegisters {
|
||||||
get => upperCaseRegisters;
|
get => uppercaseRegisters;
|
||||||
set {
|
set {
|
||||||
if (value != upperCaseRegisters) {
|
if (value != uppercaseRegisters) {
|
||||||
upperCaseRegisters = value;
|
uppercaseRegisters = value;
|
||||||
OnPropertyChanged(nameof(UpperCaseRegisters));
|
OnPropertyChanged(nameof(UppercaseRegisters));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCaseRegisters;
|
bool uppercaseRegisters;
|
||||||
|
|
||||||
public bool UpperCaseKeywords {
|
public bool UppercaseKeywords {
|
||||||
get => upperCaseKeywords;
|
get => uppercaseKeywords;
|
||||||
set {
|
set {
|
||||||
if (value != upperCaseKeywords) {
|
if (value != uppercaseKeywords) {
|
||||||
upperCaseKeywords = value;
|
uppercaseKeywords = value;
|
||||||
OnPropertyChanged(nameof(UpperCaseKeywords));
|
OnPropertyChanged(nameof(UppercaseKeywords));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCaseKeywords;
|
bool uppercaseKeywords;
|
||||||
|
|
||||||
public bool UpperCaseDecorators {
|
public bool UppercaseDecorators {
|
||||||
get => upperCaseDecorators;
|
get => uppercaseDecorators;
|
||||||
set {
|
set {
|
||||||
if (value != upperCaseDecorators) {
|
if (value != uppercaseDecorators) {
|
||||||
upperCaseDecorators = value;
|
uppercaseDecorators = value;
|
||||||
OnPropertyChanged(nameof(UpperCaseDecorators));
|
OnPropertyChanged(nameof(UppercaseDecorators));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCaseDecorators;
|
bool uppercaseDecorators;
|
||||||
|
|
||||||
public bool UpperCaseAll {
|
public bool UppercaseAll {
|
||||||
get => upperCaseAll;
|
get => uppercaseAll;
|
||||||
set {
|
set {
|
||||||
if (value != upperCaseAll) {
|
if (value != uppercaseAll) {
|
||||||
upperCaseAll = value;
|
uppercaseAll = value;
|
||||||
OnPropertyChanged(nameof(UpperCaseAll));
|
OnPropertyChanged(nameof(UppercaseAll));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCaseAll;
|
bool uppercaseAll;
|
||||||
|
|
||||||
public int FirstOperandCharIndex {
|
public int FirstOperandCharIndex {
|
||||||
get => firstOperandCharIndex;
|
get => firstOperandCharIndex;
|
||||||
@ -357,16 +357,16 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
}
|
}
|
||||||
bool leadingZeroes;
|
bool leadingZeroes;
|
||||||
|
|
||||||
public bool UpperCaseHex {
|
public bool UppercaseHex {
|
||||||
get => upperCaseHex;
|
get => uppercaseHex;
|
||||||
set {
|
set {
|
||||||
if (value != upperCaseHex) {
|
if (value != uppercaseHex) {
|
||||||
upperCaseHex = value;
|
uppercaseHex = value;
|
||||||
OnPropertyChanged(nameof(UpperCaseHex));
|
OnPropertyChanged(nameof(UppercaseHex));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool upperCaseHex = true;
|
bool uppercaseHex = true;
|
||||||
|
|
||||||
public bool SmallHexNumbersInDecimal {
|
public bool SmallHexNumbersInDecimal {
|
||||||
get => smallHexNumbersInDecimal;
|
get => smallHexNumbersInDecimal;
|
||||||
@ -503,13 +503,90 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
}
|
}
|
||||||
bool showSymbolAddress = true;
|
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) {
|
protected void ReadSettings(ISettingsSection sect) {
|
||||||
UpperCasePrefixes = sect.Attribute<bool?>(nameof(UpperCasePrefixes)) ?? UpperCasePrefixes;
|
UppercasePrefixes = sect.Attribute<bool?>(nameof(UppercasePrefixes)) ?? UppercasePrefixes;
|
||||||
UpperCaseMnemonics = sect.Attribute<bool?>(nameof(UpperCaseMnemonics)) ?? UpperCaseMnemonics;
|
UppercaseMnemonics = sect.Attribute<bool?>(nameof(UppercaseMnemonics)) ?? UppercaseMnemonics;
|
||||||
UpperCaseRegisters = sect.Attribute<bool?>(nameof(UpperCaseRegisters)) ?? UpperCaseRegisters;
|
UppercaseRegisters = sect.Attribute<bool?>(nameof(UppercaseRegisters)) ?? UppercaseRegisters;
|
||||||
UpperCaseKeywords = sect.Attribute<bool?>(nameof(UpperCaseKeywords)) ?? UpperCaseKeywords;
|
UppercaseKeywords = sect.Attribute<bool?>(nameof(UppercaseKeywords)) ?? UppercaseKeywords;
|
||||||
UpperCaseDecorators = sect.Attribute<bool?>(nameof(UpperCaseDecorators)) ?? UpperCaseDecorators;
|
UppercaseDecorators = sect.Attribute<bool?>(nameof(UppercaseDecorators)) ?? UppercaseDecorators;
|
||||||
UpperCaseAll = sect.Attribute<bool?>(nameof(UpperCaseAll)) ?? UpperCaseAll;
|
UppercaseAll = sect.Attribute<bool?>(nameof(UppercaseAll)) ?? UppercaseAll;
|
||||||
FirstOperandCharIndex = sect.Attribute<int?>(nameof(FirstOperandCharIndex)) ?? FirstOperandCharIndex;
|
FirstOperandCharIndex = sect.Attribute<int?>(nameof(FirstOperandCharIndex)) ?? FirstOperandCharIndex;
|
||||||
TabSize = sect.Attribute<int?>(nameof(TabSize)) ?? TabSize;
|
TabSize = sect.Attribute<int?>(nameof(TabSize)) ?? TabSize;
|
||||||
SpaceAfterOperandSeparator = sect.Attribute<bool?>(nameof(SpaceAfterOperandSeparator)) ?? SpaceAfterOperandSeparator;
|
SpaceAfterOperandSeparator = sect.Attribute<bool?>(nameof(SpaceAfterOperandSeparator)) ?? SpaceAfterOperandSeparator;
|
||||||
@ -534,7 +611,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
BinaryDigitGroupSize = sect.Attribute<int?>(nameof(BinaryDigitGroupSize)) ?? BinaryDigitGroupSize;
|
BinaryDigitGroupSize = sect.Attribute<int?>(nameof(BinaryDigitGroupSize)) ?? BinaryDigitGroupSize;
|
||||||
DigitSeparator = sect.Attribute<string>(nameof(DigitSeparator)) ?? DigitSeparator;
|
DigitSeparator = sect.Attribute<string>(nameof(DigitSeparator)) ?? DigitSeparator;
|
||||||
LeadingZeroes = sect.Attribute<bool?>(nameof(LeadingZeroes)) ?? LeadingZeroes;
|
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;
|
SmallHexNumbersInDecimal = sect.Attribute<bool?>(nameof(SmallHexNumbersInDecimal)) ?? SmallHexNumbersInDecimal;
|
||||||
AddLeadingZeroToHexNumbers = sect.Attribute<bool?>(nameof(AddLeadingZeroToHexNumbers)) ?? AddLeadingZeroToHexNumbers;
|
AddLeadingZeroToHexNumbers = sect.Attribute<bool?>(nameof(AddLeadingZeroToHexNumbers)) ?? AddLeadingZeroToHexNumbers;
|
||||||
NumberBase = sect.Attribute<NumberBase?>(nameof(NumberBase)) ?? NumberBase;
|
NumberBase = sect.Attribute<NumberBase?>(nameof(NumberBase)) ?? NumberBase;
|
||||||
@ -547,15 +624,22 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
ShowBranchSize = sect.Attribute<bool?>(nameof(ShowBranchSize)) ?? ShowBranchSize;
|
ShowBranchSize = sect.Attribute<bool?>(nameof(ShowBranchSize)) ?? ShowBranchSize;
|
||||||
UsePseudoOps = sect.Attribute<bool?>(nameof(UsePseudoOps)) ?? UsePseudoOps;
|
UsePseudoOps = sect.Attribute<bool?>(nameof(UsePseudoOps)) ?? UsePseudoOps;
|
||||||
ShowSymbolAddress = sect.Attribute<bool?>(nameof(ShowSymbolAddress)) ?? ShowSymbolAddress;
|
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) {
|
protected void WriteSettings(ISettingsSection sect) {
|
||||||
sect.Attribute(nameof(UpperCasePrefixes), UpperCasePrefixes);
|
sect.Attribute(nameof(UppercasePrefixes), UppercasePrefixes);
|
||||||
sect.Attribute(nameof(UpperCaseMnemonics), UpperCaseMnemonics);
|
sect.Attribute(nameof(UppercaseMnemonics), UppercaseMnemonics);
|
||||||
sect.Attribute(nameof(UpperCaseRegisters), UpperCaseRegisters);
|
sect.Attribute(nameof(UppercaseRegisters), UppercaseRegisters);
|
||||||
sect.Attribute(nameof(UpperCaseKeywords), UpperCaseKeywords);
|
sect.Attribute(nameof(UppercaseKeywords), UppercaseKeywords);
|
||||||
sect.Attribute(nameof(UpperCaseDecorators), UpperCaseDecorators);
|
sect.Attribute(nameof(UppercaseDecorators), UppercaseDecorators);
|
||||||
sect.Attribute(nameof(UpperCaseAll), UpperCaseAll);
|
sect.Attribute(nameof(UppercaseAll), UppercaseAll);
|
||||||
sect.Attribute(nameof(FirstOperandCharIndex), FirstOperandCharIndex);
|
sect.Attribute(nameof(FirstOperandCharIndex), FirstOperandCharIndex);
|
||||||
sect.Attribute(nameof(TabSize), TabSize);
|
sect.Attribute(nameof(TabSize), TabSize);
|
||||||
sect.Attribute(nameof(SpaceAfterOperandSeparator), SpaceAfterOperandSeparator);
|
sect.Attribute(nameof(SpaceAfterOperandSeparator), SpaceAfterOperandSeparator);
|
||||||
@ -580,7 +664,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
sect.Attribute(nameof(BinaryDigitGroupSize), BinaryDigitGroupSize);
|
sect.Attribute(nameof(BinaryDigitGroupSize), BinaryDigitGroupSize);
|
||||||
sect.Attribute(nameof(DigitSeparator), DigitSeparator);
|
sect.Attribute(nameof(DigitSeparator), DigitSeparator);
|
||||||
sect.Attribute(nameof(LeadingZeroes), LeadingZeroes);
|
sect.Attribute(nameof(LeadingZeroes), LeadingZeroes);
|
||||||
sect.Attribute(nameof(UpperCaseHex), UpperCaseHex);
|
sect.Attribute(nameof(UppercaseHex), UppercaseHex);
|
||||||
sect.Attribute(nameof(SmallHexNumbersInDecimal), SmallHexNumbersInDecimal);
|
sect.Attribute(nameof(SmallHexNumbersInDecimal), SmallHexNumbersInDecimal);
|
||||||
sect.Attribute(nameof(AddLeadingZeroToHexNumbers), AddLeadingZeroToHexNumbers);
|
sect.Attribute(nameof(AddLeadingZeroToHexNumbers), AddLeadingZeroToHexNumbers);
|
||||||
sect.Attribute(nameof(NumberBase), NumberBase);
|
sect.Attribute(nameof(NumberBase), NumberBase);
|
||||||
@ -593,17 +677,24 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
sect.Attribute(nameof(ShowBranchSize), ShowBranchSize);
|
sect.Attribute(nameof(ShowBranchSize), ShowBranchSize);
|
||||||
sect.Attribute(nameof(UsePseudoOps), UsePseudoOps);
|
sect.Attribute(nameof(UsePseudoOps), UsePseudoOps);
|
||||||
sect.Attribute(nameof(ShowSymbolAddress), ShowSymbolAddress);
|
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) {
|
protected DisassemblySettings CopyTo(DisassemblySettings other) {
|
||||||
if (other is null)
|
if (other is null)
|
||||||
throw new ArgumentNullException(nameof(other));
|
throw new ArgumentNullException(nameof(other));
|
||||||
other.UpperCasePrefixes = UpperCasePrefixes;
|
other.UppercasePrefixes = UppercasePrefixes;
|
||||||
other.UpperCaseMnemonics = UpperCaseMnemonics;
|
other.UppercaseMnemonics = UppercaseMnemonics;
|
||||||
other.UpperCaseRegisters = UpperCaseRegisters;
|
other.UppercaseRegisters = UppercaseRegisters;
|
||||||
other.UpperCaseKeywords = UpperCaseKeywords;
|
other.UppercaseKeywords = UppercaseKeywords;
|
||||||
other.UpperCaseDecorators = UpperCaseDecorators;
|
other.UppercaseDecorators = UppercaseDecorators;
|
||||||
other.UpperCaseAll = UpperCaseAll;
|
other.UppercaseAll = UppercaseAll;
|
||||||
other.FirstOperandCharIndex = FirstOperandCharIndex;
|
other.FirstOperandCharIndex = FirstOperandCharIndex;
|
||||||
other.TabSize = TabSize;
|
other.TabSize = TabSize;
|
||||||
other.SpaceAfterOperandSeparator = SpaceAfterOperandSeparator;
|
other.SpaceAfterOperandSeparator = SpaceAfterOperandSeparator;
|
||||||
@ -628,7 +719,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
other.BinaryDigitGroupSize = BinaryDigitGroupSize;
|
other.BinaryDigitGroupSize = BinaryDigitGroupSize;
|
||||||
other.DigitSeparator = DigitSeparator;
|
other.DigitSeparator = DigitSeparator;
|
||||||
other.LeadingZeroes = LeadingZeroes;
|
other.LeadingZeroes = LeadingZeroes;
|
||||||
other.UpperCaseHex = UpperCaseHex;
|
other.UppercaseHex = UppercaseHex;
|
||||||
other.SmallHexNumbersInDecimal = SmallHexNumbersInDecimal;
|
other.SmallHexNumbersInDecimal = SmallHexNumbersInDecimal;
|
||||||
other.AddLeadingZeroToHexNumbers = AddLeadingZeroToHexNumbers;
|
other.AddLeadingZeroToHexNumbers = AddLeadingZeroToHexNumbers;
|
||||||
other.NumberBase = NumberBase;
|
other.NumberBase = NumberBase;
|
||||||
@ -641,6 +732,13 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
other.ShowBranchSize = ShowBranchSize;
|
other.ShowBranchSize = ShowBranchSize;
|
||||||
other.UsePseudoOps = UsePseudoOps;
|
other.UsePseudoOps = UsePseudoOps;
|
||||||
other.ShowSymbolAddress = ShowSymbolAddress;
|
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;
|
return other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
options.BinaryDigitGroupSize = settings.BinaryDigitGroupSize;
|
options.BinaryDigitGroupSize = settings.BinaryDigitGroupSize;
|
||||||
options.DigitSeparator = settings.DigitSeparator;
|
options.DigitSeparator = settings.DigitSeparator;
|
||||||
options.LeadingZeroes = settings.LeadingZeroes;
|
options.LeadingZeroes = settings.LeadingZeroes;
|
||||||
options.UpperCaseHex = settings.UpperCaseHex;
|
options.UppercaseHex = settings.UppercaseHex;
|
||||||
options.SmallHexNumbersInDecimal = settings.SmallHexNumbersInDecimal;
|
options.SmallHexNumbersInDecimal = settings.SmallHexNumbersInDecimal;
|
||||||
options.AddLeadingZeroToHexNumbers = settings.AddLeadingZeroToHexNumbers;
|
options.AddLeadingZeroToHexNumbers = settings.AddLeadingZeroToHexNumbers;
|
||||||
options.NumberBase = ToIcedNumberBase(settings.NumberBase);
|
options.NumberBase = ToIcedNumberBase(settings.NumberBase);
|
||||||
@ -70,12 +70,12 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
options.ShowBranchSize = settings.ShowBranchSize;
|
options.ShowBranchSize = settings.ShowBranchSize;
|
||||||
options.DecimalSuffix = settings.DecimalSuffix;
|
options.DecimalSuffix = settings.DecimalSuffix;
|
||||||
options.HexDigitGroupSize = settings.HexDigitGroupSize;
|
options.HexDigitGroupSize = settings.HexDigitGroupSize;
|
||||||
options.UpperCasePrefixes = settings.UpperCasePrefixes;
|
options.UppercasePrefixes = settings.UppercasePrefixes;
|
||||||
options.UpperCaseMnemonics = settings.UpperCaseMnemonics;
|
options.UppercaseMnemonics = settings.UppercaseMnemonics;
|
||||||
options.UpperCaseRegisters = settings.UpperCaseRegisters;
|
options.UppercaseRegisters = settings.UppercaseRegisters;
|
||||||
options.UpperCaseKeywords = settings.UpperCaseKeywords;
|
options.UppercaseKeywords = settings.UppercaseKeywords;
|
||||||
options.UpperCaseDecorators = settings.UpperCaseDecorators;
|
options.UppercaseDecorators = settings.UppercaseDecorators;
|
||||||
options.UpperCaseAll = settings.UpperCaseAll;
|
options.UppercaseAll = settings.UppercaseAll;
|
||||||
options.FirstOperandCharIndex = settings.FirstOperandCharIndex;
|
options.FirstOperandCharIndex = settings.FirstOperandCharIndex;
|
||||||
options.TabSize = settings.TabSize;
|
options.TabSize = settings.TabSize;
|
||||||
options.SpaceAfterOperandSeparator = settings.SpaceAfterOperandSeparator;
|
options.SpaceAfterOperandSeparator = settings.SpaceAfterOperandSeparator;
|
||||||
@ -91,28 +91,19 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
options.DecimalPrefix = settings.DecimalPrefix;
|
options.DecimalPrefix = settings.DecimalPrefix;
|
||||||
options.UsePseudoOps = settings.UsePseudoOps;
|
options.UsePseudoOps = settings.UsePseudoOps;
|
||||||
options.ShowSymbolAddress = settings.ShowSymbolAddress;
|
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) {
|
public static FormatterOptions ToIcedOptions(this IX86DisassemblySettings settings) {
|
||||||
var options = new MasmFormatterOptions();
|
var options = new FormatterOptions();
|
||||||
CopyBase(options, settings);
|
CopyBase(options, settings);
|
||||||
return options;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,25 +26,8 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
public override Guid Guid => new Guid("B2A9B538-925A-4029-9158-8C2FE632764D");
|
public override Guid Guid => new Guid("B2A9B538-925A-4029-9158-8C2FE632764D");
|
||||||
public override string Title => CodeStyleConstants.GAS_NAME;
|
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)
|
public GasAppSettingsPage(GasDisassemblySettings x86DisassemblySettings)
|
||||||
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new GasFormatter(new GasFormatterOptions(), SymbolResolver.Instance)) {
|
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new GasFormatter(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;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnApply() =>
|
public override void OnApply() =>
|
||||||
((GasDisassemblySettings)x86DisassemblySettings).CopyTo((GasDisassemblySettings)_global_x86DisassemblySettings);
|
((GasDisassemblySettings)x86DisassemblySettings).CopyTo((GasDisassemblySettings)_global_x86DisassemblySettings);
|
||||||
|
@ -24,60 +24,23 @@ using dnSpy.Contracts.Disassembly;
|
|||||||
using dnSpy.Contracts.Settings;
|
using dnSpy.Contracts.Settings;
|
||||||
|
|
||||||
namespace dnSpy.Disassembly.X86 {
|
namespace dnSpy.Disassembly.X86 {
|
||||||
class GasDisassemblySettings : DisassemblySettings, IGasDisassemblySettings {
|
class GasDisassemblySettings : DisassemblySettings, IX86DisassemblySettings {
|
||||||
public GasDisassemblySettings() {
|
public GasDisassemblySettings() {
|
||||||
HexPrefix = "0x";
|
HexPrefix = "0x";
|
||||||
OctalPrefix = "0";
|
OctalPrefix = "0";
|
||||||
BinaryPrefix = "0b";
|
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 Clone() => CopyTo(new GasDisassemblySettings());
|
||||||
|
|
||||||
public GasDisassemblySettings CopyTo(GasDisassemblySettings other) {
|
public GasDisassemblySettings CopyTo(GasDisassemblySettings other) {
|
||||||
if (other is null)
|
if (other is null)
|
||||||
throw new ArgumentNullException(nameof(other));
|
throw new ArgumentNullException(nameof(other));
|
||||||
base.CopyTo(other);
|
base.CopyTo(other);
|
||||||
other.NakedRegisters = NakedRegisters;
|
|
||||||
other.ShowMnemonicSizeSuffix = ShowMnemonicSizeSuffix;
|
|
||||||
other.SpaceAfterMemoryOperandComma = SpaceAfterMemoryOperandComma;
|
|
||||||
return other;
|
return other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Export(typeof(IGasDisassemblySettings))]
|
|
||||||
[Export(typeof(GasDisassemblySettingsImpl))]
|
[Export(typeof(GasDisassemblySettingsImpl))]
|
||||||
sealed class GasDisassemblySettingsImpl : GasDisassemblySettings {
|
sealed class GasDisassemblySettingsImpl : GasDisassemblySettings {
|
||||||
static readonly Guid SETTINGS_GUID = new Guid("40476B68-2E8A-4507-8F59-727FE87A04EE");
|
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);
|
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
|
||||||
ReadSettings(sect);
|
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;
|
PropertyChanged += OnPropertyChanged;
|
||||||
}
|
}
|
||||||
@ -102,9 +62,6 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
void Save() {
|
void Save() {
|
||||||
var sect = settingsService.RecreateSection(SETTINGS_GUID);
|
var sect = settingsService.RecreateSection(SETTINGS_GUID);
|
||||||
WriteSettings(sect);
|
WriteSettings(sect);
|
||||||
sect.Attribute(nameof(NakedRegisters), NakedRegisters);
|
|
||||||
sect.Attribute(nameof(ShowMnemonicSizeSuffix), ShowMnemonicSizeSuffix);
|
|
||||||
sect.Attribute(nameof(SpaceAfterMemoryOperandComma), SpaceAfterMemoryOperandComma);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,7 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
public override string Title => CodeStyleConstants.MASM_NAME;
|
public override string Title => CodeStyleConstants.MASM_NAME;
|
||||||
|
|
||||||
public MasmAppSettingsPage(MasmDisassemblySettings x86DisassemblySettings)
|
public MasmAppSettingsPage(MasmDisassemblySettings x86DisassemblySettings)
|
||||||
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new MasmFormatter(new MasmFormatterOptions(), SymbolResolver.Instance)) { }
|
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new MasmFormatter(SymbolResolver.Instance)) { }
|
||||||
|
|
||||||
protected override void InitializeFormatterOptionsCore(FormatterOptions options) { }
|
|
||||||
|
|
||||||
public override void OnApply() =>
|
public override void OnApply() =>
|
||||||
((MasmDisassemblySettings)x86DisassemblySettings).CopyTo((MasmDisassemblySettings)_global_x86DisassemblySettings);
|
((MasmDisassemblySettings)x86DisassemblySettings).CopyTo((MasmDisassemblySettings)_global_x86DisassemblySettings);
|
||||||
|
@ -24,60 +24,23 @@ using dnSpy.Contracts.Disassembly;
|
|||||||
using dnSpy.Contracts.Settings;
|
using dnSpy.Contracts.Settings;
|
||||||
|
|
||||||
namespace dnSpy.Disassembly.X86 {
|
namespace dnSpy.Disassembly.X86 {
|
||||||
class MasmDisassemblySettings : DisassemblySettings, IMasmDisassemblySettings {
|
class MasmDisassemblySettings : DisassemblySettings, IX86DisassemblySettings {
|
||||||
public MasmDisassemblySettings() {
|
public MasmDisassemblySettings() {
|
||||||
HexSuffix = "h";
|
HexSuffix = "h";
|
||||||
OctalSuffix = "o";
|
OctalSuffix = "o";
|
||||||
BinarySuffix = "b";
|
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 Clone() => CopyTo(new MasmDisassemblySettings());
|
||||||
|
|
||||||
public MasmDisassemblySettings CopyTo(MasmDisassemblySettings other) {
|
public MasmDisassemblySettings CopyTo(MasmDisassemblySettings other) {
|
||||||
if (other is null)
|
if (other is null)
|
||||||
throw new ArgumentNullException(nameof(other));
|
throw new ArgumentNullException(nameof(other));
|
||||||
base.CopyTo(other);
|
base.CopyTo(other);
|
||||||
other.AddDsPrefix32 = AddDsPrefix32;
|
|
||||||
other.SymbolDisplInBrackets = SymbolDisplInBrackets;
|
|
||||||
other.DisplInBrackets = DisplInBrackets;
|
|
||||||
return other;
|
return other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Export(typeof(IMasmDisassemblySettings))]
|
|
||||||
[Export(typeof(MasmDisassemblySettingsImpl))]
|
[Export(typeof(MasmDisassemblySettingsImpl))]
|
||||||
sealed class MasmDisassemblySettingsImpl : MasmDisassemblySettings {
|
sealed class MasmDisassemblySettingsImpl : MasmDisassemblySettings {
|
||||||
static readonly Guid SETTINGS_GUID = new Guid("F70D9AFD-0233-4630-A2A7-0C5A157158FF");
|
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);
|
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
|
||||||
ReadSettings(sect);
|
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;
|
PropertyChanged += OnPropertyChanged;
|
||||||
}
|
}
|
||||||
@ -102,9 +62,6 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
void Save() {
|
void Save() {
|
||||||
var sect = settingsService.RecreateSection(SETTINGS_GUID);
|
var sect = settingsService.RecreateSection(SETTINGS_GUID);
|
||||||
WriteSettings(sect);
|
WriteSettings(sect);
|
||||||
sect.Attribute(nameof(AddDsPrefix32), AddDsPrefix32);
|
|
||||||
sect.Attribute(nameof(SymbolDisplInBrackets), SymbolDisplInBrackets);
|
|
||||||
sect.Attribute(nameof(DisplInBrackets), DisplInBrackets);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,15 +26,8 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
public override Guid Guid => new Guid("929A1758-C8CC-450E-A214-90B390A846DF");
|
public override Guid Guid => new Guid("929A1758-C8CC-450E-A214-90B390A846DF");
|
||||||
public override string Title => CodeStyleConstants.NASM_NAME;
|
public override string Title => CodeStyleConstants.NASM_NAME;
|
||||||
|
|
||||||
NasmDisassemblySettings NasmSettings => (NasmDisassemblySettings)Settings;
|
|
||||||
|
|
||||||
public NasmAppSettingsPage(NasmDisassemblySettings x86DisassemblySettings)
|
public NasmAppSettingsPage(NasmDisassemblySettings x86DisassemblySettings)
|
||||||
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new NasmFormatter(new NasmFormatterOptions(), SymbolResolver.Instance)) { }
|
: base(x86DisassemblySettings, x86DisassemblySettings.Clone(), new NasmFormatter(SymbolResolver.Instance)) { }
|
||||||
|
|
||||||
protected override void InitializeFormatterOptionsCore(FormatterOptions options) {
|
|
||||||
var nasm = (NasmFormatterOptions)options;
|
|
||||||
nasm.ShowSignExtendedImmediateSize = NasmSettings.ShowSignExtendedImmediateSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnApply() =>
|
public override void OnApply() =>
|
||||||
((NasmDisassemblySettings)x86DisassemblySettings).CopyTo((NasmDisassemblySettings)_global_x86DisassemblySettings);
|
((NasmDisassemblySettings)x86DisassemblySettings).CopyTo((NasmDisassemblySettings)_global_x86DisassemblySettings);
|
||||||
|
@ -24,36 +24,23 @@ using dnSpy.Contracts.Disassembly;
|
|||||||
using dnSpy.Contracts.Settings;
|
using dnSpy.Contracts.Settings;
|
||||||
|
|
||||||
namespace dnSpy.Disassembly.X86 {
|
namespace dnSpy.Disassembly.X86 {
|
||||||
class NasmDisassemblySettings : DisassemblySettings, INasmDisassemblySettings {
|
class NasmDisassemblySettings : DisassemblySettings, IX86DisassemblySettings {
|
||||||
public NasmDisassemblySettings() {
|
public NasmDisassemblySettings() {
|
||||||
HexSuffix = "h";
|
HexSuffix = "h";
|
||||||
OctalSuffix = "o";
|
OctalSuffix = "o";
|
||||||
BinarySuffix = "b";
|
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 Clone() => CopyTo(new NasmDisassemblySettings());
|
||||||
|
|
||||||
public NasmDisassemblySettings CopyTo(NasmDisassemblySettings other) {
|
public NasmDisassemblySettings CopyTo(NasmDisassemblySettings other) {
|
||||||
if (other is null)
|
if (other is null)
|
||||||
throw new ArgumentNullException(nameof(other));
|
throw new ArgumentNullException(nameof(other));
|
||||||
base.CopyTo(other);
|
base.CopyTo(other);
|
||||||
other.ShowSignExtendedImmediateSize = ShowSignExtendedImmediateSize;
|
|
||||||
return other;
|
return other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Export(typeof(INasmDisassemblySettings))]
|
|
||||||
[Export(typeof(NasmDisassemblySettingsImpl))]
|
[Export(typeof(NasmDisassemblySettingsImpl))]
|
||||||
sealed class NasmDisassemblySettingsImpl : NasmDisassemblySettings {
|
sealed class NasmDisassemblySettingsImpl : NasmDisassemblySettings {
|
||||||
static readonly Guid SETTINGS_GUID = new Guid("2F066064-741B-454E-9D21-B04BCF802018");
|
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);
|
var sect = settingsService.GetOrCreateSection(SETTINGS_GUID);
|
||||||
ReadSettings(sect);
|
ReadSettings(sect);
|
||||||
ShowSignExtendedImmediateSize = sect.Attribute<bool?>(nameof(ShowSignExtendedImmediateSize)) ?? ShowSignExtendedImmediateSize;
|
|
||||||
|
|
||||||
PropertyChanged += OnPropertyChanged;
|
PropertyChanged += OnPropertyChanged;
|
||||||
}
|
}
|
||||||
@ -76,7 +62,6 @@ namespace dnSpy.Disassembly.X86 {
|
|||||||
void Save() {
|
void Save() {
|
||||||
var sect = settingsService.RecreateSection(SETTINGS_GUID);
|
var sect = settingsService.RecreateSection(SETTINGS_GUID);
|
||||||
WriteSettings(sect);
|
WriteSettings(sect);
|
||||||
sect.Attribute(nameof(ShowSignExtendedImmediateSize), ShowSignExtendedImmediateSize);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6804,18 +6804,18 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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 SpaceAfterMemoryOperandComma.Disassembly, Mode=OneWay}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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}" />
|
<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}"/>
|
<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 NakedRegisters.Disassembly, Mode=OneWay}" />
|
<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 ShowMnemonicSizeSuffix.Value}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_ShowMnemonicSizeSuffix}"/>
|
<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 ShowMnemonicSizeSuffix.Disassembly, Mode=OneWay}" />
|
<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}"/>
|
<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}" />
|
<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}" />
|
<Label Grid.Row="46" Grid.Column="0" Margin="-5 5 0 0" Target="{Binding ElementName=opColumnTextBox}" Content="{x:Static p:dnSpy_Resources.DisassemblySettings_OperandColumn}" />
|
||||||
|
Loading…
Reference in New Issue
Block a user