/* 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 . */ using System.ComponentModel; namespace dnSpy.Contracts.Disassembly { /// /// x86/x64 disassembly settings /// public interface IX86DisassemblySettings : INotifyPropertyChanged { /// /// Prefixes are upper cased /// bool UppercasePrefixes { get; set; } /// /// Mnemonics are upper cased /// bool UppercaseMnemonics { get; set; } /// /// Registers are upper cased /// bool UppercaseRegisters { get; set; } /// /// Keywords are upper cased (eg. BYTE PTR, SHORT) /// bool UppercaseKeywords { get; set; } /// /// Upper case decorators, eg. {z}, {sae}, {rd-sae} /// bool UppercaseDecorators { get; set; } /// /// Everything is upper cased, except numbers and their prefixes/suffixes /// bool UppercaseAll { get; set; } /// /// Character index (0-based) where the first operand is formatted. Can be set to 0 to format it immediately after the mnemonic. /// At least one space or tab is always added betewen the mnemonic and the first operand. /// int FirstOperandCharIndex { get; set; } /// /// Size of a tab character or <= 0 to use spaces /// int TabSize { get; set; } /// /// Add a space after the operand separator, eg. "rax, rcx" vs "rax,rcx" /// bool SpaceAfterOperandSeparator { get; set; } /// /// Add a space between the memory expression and the brackets, eg. "[ rax ]" vs "[rax]" /// bool SpaceAfterMemoryBracket { get; set; } /// /// Add spaces between memory operand "+" and "-" operators, eg. "[rax + rcx]" vs "[rax+rcx]" /// bool SpaceBetweenMemoryAddOperators { get; set; } /// /// Add spaces between memory operand "*" operator, eg. "[rax * 4]" vs "[rax*4]" /// bool SpaceBetweenMemoryMulOperators { get; set; } /// /// Show memory operand scale value before the index register, eg. "[4*rax]" vs "[rax*4]" /// bool ScaleBeforeIndex { get; set; } /// /// Always show the scale value even if it's *1, eg. "[rax+rcx*1]" vs "[rax+rcx]" /// bool AlwaysShowScale { get; set; } /// /// Always show the effective segment register. If the option is false, only show the segment register if /// there's a segment override prefix. Eg. "ds:[rax]" vs "[rax]" /// bool AlwaysShowSegmentRegister { get; set; } /// /// Show zero displacements, eg. '[rcx*2+0]' vs '[rcx*2]' /// bool ShowZeroDisplacements { get; set; } /// /// Hex number prefix or null/empty string, eg. "0x" /// string? HexPrefix { get; set; } /// /// Hex number suffix or null/empty string, eg. "h" /// string? HexSuffix { get; set; } /// /// Size of a digit group /// int HexDigitGroupSize { get; set; } /// /// Decimal number prefix or null/empty string /// string? DecimalPrefix { get; set; } /// /// Decimal number suffix or null/empty string /// string? DecimalSuffix { get; set; } /// /// Size of a digit group /// int DecimalDigitGroupSize { get; set; } /// /// Octal number prefix or null/empty string /// string? OctalPrefix { get; set; } /// /// Octal number suffix or null/empty string /// string? OctalSuffix { get; set; } /// /// Size of a digit group /// int OctalDigitGroupSize { get; set; } /// /// Binary number prefix or null/empty string /// string? BinaryPrefix { get; set; } /// /// Binary number suffix or null/empty string /// string? BinarySuffix { get; set; } /// /// Size of a digit group /// int BinaryDigitGroupSize { get; set; } /// /// Digit separator or null/empty string /// string? DigitSeparator { get; set; } /// /// Add leading zeroes to hexadecimal/octal/binary numbers, eg. 0x0000000A/0000000Ah vs 0xA/0Ah. /// This option has no effect on branch targets, use . /// bool LeadingZeroes { get; set; } /// /// Use upper case hex digits /// bool UppercaseHex { get; set; } /// /// Small hex numbers (-9 .. 9) are shown in decimal /// bool SmallHexNumbersInDecimal { get; set; } /// /// Add a leading zero to numbers if there's no prefix and the number starts with hex digits A-F, eg. Ah vs 0Ah /// bool AddLeadingZeroToHexNumbers { get; set; } /// /// Number base /// NumberBase NumberBase { get; set; } /// /// Add leading zeroes to branch offsets, eg. 'je 00000123h' vs 'je 123h'. Used by call near, call far, jmp near, jmp far, jcc, loop, loopcc, xbegin /// bool BranchLeadingZeroes { get; set; } /// /// Show immediate operands as signed numbers, eg. 'mov eax,FFFFFFFF' vs 'mov eax,-1' /// bool SignedImmediateOperands { get; set; } /// /// Displacements are signed numbers, eg. 'mov al,[eax-2000h]' vs 'mov al,[eax+0FFFFE000h]' /// bool SignedMemoryDisplacements { get; set; } /// /// Sign extend memory displacements to the address size (16-bit, 32-bit, 64-bit), eg. 'mov al,[eax+12h]' vs 'mov al,[eax+00000012h]' /// bool DisplacementLeadingZeroes { get; set; } /// /// Options that control if the memory size (eg. dword ptr) is shown or not. /// This is ignored by the GAS (AT&T) formatter. /// MemorySizeOptions MemorySizeOptions { get; set; } /// /// true to show RIP relative addresses as '[rip+12345678h]', false to show RIP relative addresses as '[1029384756AFBECDh]' /// bool RipRelativeAddresses { get; set; } /// /// Shows near, short, etc if it's a branch instruction, eg. 'je short 1234h' vs 'je 1234h' /// bool ShowBranchSize { get; set; } /// /// Use pseudo instructions, eg. vcmpngesd vs vcmpsd+imm8 /// bool UsePseudoOps { get; set; } /// /// Show the original value after the symbol name, eg. 'mov eax,[myfield (12345678)]' vs 'mov eax,[myfield]' /// bool ShowSymbolAddress { get; set; } /// /// If true, the formatter doesn't add '%' to registers, eg. %eax vs eax /// bool GasNakedRegisters { get; set; } /// /// Shows the mnemonic size suffix, eg. 'mov %eax,%ecx' vs 'movl %eax,%ecx' /// bool GasShowMnemonicSizeSuffix { get; set; } /// /// Add a space after the comma if it's a memory operand, eg. '(%eax,%ecx,2)' vs '(%eax, %ecx, 2)' /// bool GasSpaceAfterMemoryOperandComma { get; set; } /// /// 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]' /// bool MasmAddDsPrefix32 { get; set; } /// /// Show symbols in brackets, eg. '[ecx+symbol]' vs 'symbol[ecx]' and '[symbol]' vs 'symbol' /// bool MasmSymbolDisplInBrackets { get; set; } /// /// Show displacements in brackets, eg. '[ecx+1234h]' vs '1234h[ecx]' /// bool MasmDisplInBrackets { get; set; } /// /// Shows byte, word, dword or qword if it's a sign extended immediate operand value, eg. 'or rcx,-1' vs 'or rcx,byte -1' /// bool NasmShowSignExtendedImmediateSize { get; set; } } }