FastFormatter¶
- class iced_x86.FastFormatter¶
Fast formatter with less formatting options and with a masm-like syntax.
Use it if formatting speed is more important than being able to re-assemble formatted instructions.
This formatter is ~1.25x faster than the other formatters (the time includes decoding + formatting).
Examples:
from iced_x86 import * data = b"\x62\xF2\x4F\xDD\x72\x50\x01" decoder = Decoder(64, data) instr = decoder.decode() formatter = FastFormatter() formatter.space_after_operand_separator = True disasm = formatter.format(instr) assert disasm == "vcvtne2ps2bf16 zmm2{k5}{z}, zmm6, dword bcst [rax+4h]"
- always_show_memory_size¶
Always show the size of memory operands
Default
Value
Example
Example
Truemov eax,dword ptr [ebx]add byte ptr [eax],0x12👍
Falsemov eax,[ebx]add byte ptr [eax],0x12- Type:
- always_show_segment_register¶
Always show the effective segment register.
If the option is
False, only show the segment register if there’s a segment override prefix.Default
Value
Example
Truemov eax,ds:[ecx]👍
Falsemov eax,[ecx]- Type:
- format(instruction)¶
Formats the whole instruction: prefixes, mnemonic, operands
- Parameters:
instruction (Instruction) – Instruction to format
- Returns:
The formatted string
- Return type:
- rip_relative_addresses¶
Show
RIP+displor the virtual addressDefault
Value
Example
Truemov eax,[rip+12345678h]👍
Falsemov eax,[1029384756AFBECDh]- Type:
- show_symbol_address¶
Show the original value after the symbol name
Default
Value
Example
Truemov eax,[myfield (12345678)]👍
Falsemov eax,[myfield]- Type:
- space_after_operand_separator¶
Add a space after the operand separator
Default
Value
Example
Truemov rax, rcx👍
Falsemov rax,rcx- Type:
- use_hex_prefix¶
Use a hex prefix (
0x) or a hex suffix (h)Default
Value
Example
True0x5A👍
False5Ah- Type: