Capstone Documentation Beta

Class Platform​Instruction​Base

public class PlatformInstructionBase<InsType: InstructionType, GroupType: RawRepresentable>: Instruction where GroupType.RawValue == UInt8

Base class for platform-specific instructions without registers.

Parameters

Ins​Type

type of enumeration used to represent instructions in this architecture.

Group​Type

type of enumeration used to represent instruction groups in this architecture.

%3 PlatformInstructionBase PlatformInstructionBase Instruction Instruction PlatformInstructionBase->Instruction

Superclass

Instruction

Base class for all disassembled instructions.

Properties

instruction

var instruction: InsType

The identifier for this instruction.

This is the instruction mnemonic, represented in an architecture-specific enumeration.

instruction​Type

var instructionType: InstructionType.Type

The type for instructions used in this architecture.

This is an enumeration with values corresponding to instruction mnemonics. The same as the InsType generic parameter.

groups

var groups: [GroupType]

List of architecture-specific groups the instruction belongs to.

The list will be empty in any of these cases:

  • detail mode is off

  • capstone is built in diet mode

  • instruction groups are not implemented for this architecture See baseGroups for architecture-agnostic groups.

Methods

is​In(group:​)

public func isIn(group: GroupType) -> Bool

Check if an instruction belong to a particular group.

This API is only valid when detail mode is on (it's off by default). When in 'diet' mode, this API is irrelevant because engine does not store groups.

Parameters

group Group​Type

group to check.

Returns

true if the instruction belongs to this group, false otherwise.