Capstone Documentation Beta

Enumeration Disassembly​Option

public enum DisassemblyOption

Runtime option for the disassembler engine.

Enumeration Cases

syntax

case syntax(syntax: Syntax)

Assembly output syntax.

detail

case detail(value: Bool)

Break down instruction structure into details.

This enables accessing the following details from instructions:

  • Operands

  • Instruction groups

  • Registers accessed

mode

case mode(mode: Mode)

Change engine's mode at run-time.

skip​Data​Enabled

case skipDataEnabled(_ enabled: Bool)

Skip data when disassembling.

skip​Data

case skipData(mnemonic: String? = nil, callback: SkipDataCallback? = nil)

Custom setup to skip data when disassembling:

Setting this implicitly enables skip data.

  • mnemonic: If nil, ".byte" is used

  • callback: User-defined callback to be called when Capstone hits data.

Note: if the callback is nil, Capstone will skip a number of bytes depending on architecture:

  • Arm: 2 bytes (Thumb mode) or 4 bytes.

  • Arm64: 4 bytes.

  • Mips: 4 bytes.

  • M680x: 1 byte.

  • PowerPC: 4 bytes.

  • Sparc: 4 bytes.

  • SystemZ: 2 bytes.

  • X86: 1 byte.

  • XCore: 2 bytes.

  • EVM: 1 byte.

  • MOS65xx: 1 byte.

mnemonic

case mnemonic(_ mnemonic: String?, instruction: InstructionType)

Customize an instruction mnemonic.

Set to nil to remove the customization, and return to the default value.

unsigned

case unsigned(value: Bool)

Print immediate operands in unsigned form.

This affects the instruction description and operands string, not the values of operands.