Module: Crabstone

Defined in:
lib/arch/arm_const.rb,
lib/arch/arm.rb,
lib/arch/ppc.rb,
lib/arch/x86.rb,
lib/arch/mips.rb,
lib/crabstone.rb,
lib/arch/arm64.rb,
lib/arch/sparc.rb,
lib/arch/xcore.rb,
lib/arch/systemz.rb,
lib/arch/ppc_const.rb,
lib/arch/x86_const.rb,
lib/arch/mips_const.rb,
lib/arch/sysz_const.rb,
lib/arch/arm64_const.rb,
lib/arch/sparc_const.rb,
lib/arch/xcore_const.rb,
lib/arch/arm_registers.rb,
lib/arch/ppc_registers.rb,
lib/arch/x86_registers.rb,
lib/arch/mips_registers.rb,
lib/arch/sysz_registers.rb,
lib/arch/arm64_registers.rb,
lib/arch/sparc_registers.rb,
lib/arch/xcore_registers.rb

Overview

THIS FILE WAS AUTO-GENERATED – DO NOT EDIT! Command: ./genreg /Users/ben/src/capstone/bindings/python/capstone/ 2015-05-02T13:24:08+12:00

Defined Under Namespace

Modules: ARM, ARM64, Binding, MIPS, PPC, Sparc, SysZ, X86, XCore Classes: Disassembler, ErrArch, ErrCsh, ErrDetail, ErrDiet, ErrHandle, ErrMem, ErrMemSetup, ErrMode, ErrOK, ErrOption, ErrSkipData, ErrVersion, ErrX86ATT, ErrX86Intel, Instruction

Constant Summary collapse

VERSION =
'3.0.3'
BINDING_MAJ =

API version

3
BINDING_MIN =
0
ARCH_ARM =

architectures

0
ARCH_ARM64 =
1
ARCH_MIPS =
2
ARCH_X86 =
3
ARCH_PPC =
4
ARCH_SPARC =
5
ARCH_SYSZ =
6
ARCH_XCORE =
7
ARCH_MAX =
8
ARCH_ALL =
0xFFFF
MODE_LITTLE_ENDIAN =

disasm mode

0
MODE_ARM =

little-endian mode (default mode)

0
MODE_16 =

32-bit ARM

1 << 1
MODE_32 =

16-bit mode (X86)

1 << 2
MODE_64 =

32-bit mode (X86)

1 << 3
MODE_THUMB =

64-bit mode (X86, PPC)

1 << 4
MODE_MCLASS =

ARM’s Thumb mode, including Thumb-2

1 << 5
MODE_V8 =

ARM’s Cortex-M series

1 << 6
MODE_MICRO =

ARMv8 A32 encodings for ARM

1 << 4
MODE_MIPS3 =

MicroMips mode (MIPS)

1 << 5
MODE_MIPS32R6 =

Mips III ISA

1 << 6
MODE_MIPSGP64 =

Mips32r6 ISA

1 << 7
MODE_V9 =

General Purpose Registers are 64-bit wide (MIPS)

1 << 4
MODE_BIG_ENDIAN =

SparcV9 mode (Sparc)

1 << 31
MODE_MIPS32 =

big-endian mode

MODE_32
MODE_MIPS64 =

Mips32 ISA (Mips)

MODE_64
OPT_SYNTAX =

Capstone option type

1
OPT_DETAIL =

Intel X86 asm syntax (ARCH_X86 arch)

2
OPT_MODE =

Break down instruction structure into details

3
OPT_MEM =

Change engine’s mode at run-time

4
OPT_SKIPDATA =

Change engine’s mode at run-time

5
OPT_SKIPDATA_SETUP =

Skip data when disassembling

6
OPT_OFF =

Capstone option value

0
OPT_ON =

Turn OFF an option - default option of OPT_DETAIL

3
OP_INVALID =

Common instruction operand types - to be consistent across all architectures.

0
OP_REG =
1
OP_IMM =
2
OP_MEM =
3
OP_FP =
4
GRP_INVALID =

Common instruction groups - to be consistent across all architectures.

0
GRP_JUMP =

uninitialized/invalid group.

1
GRP_CALL =

all jump instructions (conditional+direct+indirect jumps)

2
GRP_RET =

all call instructions

3
GRP_INT =

all return instructions

4
GRP_IRET =

all interrupt instructions (int+syscall)

5
OPT_SYNTAX_DEFAULT =

Capstone syntax value

0
OPT_SYNTAX_INTEL =

Default assembly syntax of all platforms (OPT_SYNTAX)

1
OPT_SYNTAX_ATT =

Intel X86 asm syntax - default syntax on X86 (OPT_SYNTAX, ARCH_X86)

2
OPT_SYNTAX_NOREGNAME =

ATT asm syntax (OPT_SYNTAX, ARCH_X86)

3
SUPPORT_DIET =

query id for cs_support()

ARCH_ALL + 1
SUPPORT_X86_REDUCE =
ARCH_ALL + 2
SYNTAX =
{
  :intel      => 1,
  :att        => 2,
  :no_regname => 3 # for PPC only
}
DETAIL =
{
  true  => 3, #trololol
  false => 0
}
SKIPDATA =
{
  true  => 3, #trololol
  false => 0
}
ERRNO =
{
  0  => ErrOK,
  1  => ErrMem,
  2  => ErrArch,
  3  => ErrHandle,
  4  => ErrCsh,
  5  => ErrMode,
  6  => ErrOption,
  7  => ErrDetail,
  8  => ErrMemSetup,
  9  => ErrVersion,
  10 => ErrDiet,
  11 => ErrSkipData,
  12 => ErrX86ATT,
  13 => ErrX86Intel,
}
ERRNO_KLASS =
ERRNO.invert
DIET_MODE =

This is a C engine build option, so we can set it here, not when we instantiate a new Disassembler.

Binding.cs_support SUPPORT_DIET

Class Method Summary collapse

Class Method Details

.raise_errno(errno) ⇒ Object

Raises:

  • (RuntimeError)


151
152
153
154
155
156
# File 'lib/crabstone.rb', line 151

def self.raise_errno errno
  err_klass = ERRNO[errno]
  raise RuntimeError, "Internal Error: Tried to raise unknown errno" unless err_klass
  err_str = Binding.cs_strerror(errno)
  raise err_klass, err_str
end