Rizin
unix-like reverse engineering framework and cli tools
Package capstone

Packages

 arm
 
 arm64
 
 arm64_const
 
 arm_const
 
 evm
 
 evm_const
 
 m680x
 
 m680x_const
 
 m68k
 
 m68k_const
 
 mips
 
 mips_const
 
 ppc
 
 ppc_const
 
 sparc
 
 sparc_const
 
 systemz
 
 sysz_const
 
 tms320c64x
 
 tms320c64x_const
 
 x86
 
 x86_const
 
 xcore
 
 xcore_const
 

Classes

class  Arm
 
class  Arm64
 
class  Arm64_const
 
class  Arm_const
 
class  Evm_const
 
class  M680x
 
class  M680x_const
 
class  M68k_const
 
class  Mips
 
class  Mips_const
 
class  Ppc
 
class  Ppc_const
 
class  Sparc
 
class  Sparc_const
 
class  Systemz
 
class  Sysz_const
 
class  TMS320C64x_const
 
class  X86
 
class  X86_const
 
class  Xcore
 
class  Xcore_const
 
class  _cs_arch
 
class  _cs_detail
 
class  _cs_insn
 
class  _cs_opt_skipdata
 
class  _cs_opt_mnem
 
class  CsError
 
class  _dummy_cs
 
class  CsInsn
 
class  Cs
 

Functions

def _load_lib (path)
 
def copy_ctypes (src)
 
def copy_ctypes_list (src)
 
def _setup_prototype (lib, fname, restype, *argtypes)
 
def cs_version ()
 
def version_bind ()
 
def cs_support (query)
 
def cs_disasm_quick (arch, mode, code, offset, count=0)
 
def cs_disasm_lite (arch, mode, code, offset, count=0)
 
def _ascii_name_or_default (name, default)
 
def debug ()
 

Variables

int _python2 = sys.version_info[0] < 3
 
 range = xrange
 
list __all__
 
int CS_API_MAJOR = 4
 
int CS_API_MINOR = 0
 
int CS_VERSION_MAJOR = CS_API_MAJOR
 
int CS_VERSION_MINOR = CS_API_MINOR
 
int CS_VERSION_EXTRA = 2
 
string __version__ = "%u.%u.%u" %(CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA)
 
int CS_ARCH_ARM = 0
 
int CS_ARCH_ARM64 = 1
 
int CS_ARCH_MIPS = 2
 
int CS_ARCH_X86 = 3
 
int CS_ARCH_PPC = 4
 
int CS_ARCH_SPARC = 5
 
int CS_ARCH_SYSZ = 6
 
int CS_ARCH_XCORE = 7
 
int CS_ARCH_M68K = 8
 
int CS_ARCH_TMS320C64X = 9
 
int CS_ARCH_M680X = 10
 
int CS_ARCH_EVM = 11
 
int CS_ARCH_MAX = 12
 
int CS_ARCH_ALL = 0xFFFF
 
int CS_MODE_LITTLE_ENDIAN = 0
 
int CS_MODE_ARM = 0
 
tuple CS_MODE_16 = (1 << 1)
 
tuple CS_MODE_32 = (1 << 2)
 
tuple CS_MODE_64 = (1 << 3)
 
tuple CS_MODE_THUMB = (1 << 4)
 
tuple CS_MODE_MCLASS = (1 << 5)
 
tuple CS_MODE_V8 = (1 << 6)
 
tuple CS_MODE_MICRO = (1 << 4)
 
tuple CS_MODE_MIPS3 = (1 << 5)
 
tuple CS_MODE_MIPS32R6 = (1 << 6)
 
tuple CS_MODE_MIPS2 = (1 << 7)
 
tuple CS_MODE_V9 = (1 << 4)
 
tuple CS_MODE_QPX = (1 << 4)
 
tuple CS_MODE_M68K_000 = (1 << 1)
 
tuple CS_MODE_M68K_010 = (1 << 2)
 
tuple CS_MODE_M68K_020 = (1 << 3)
 
tuple CS_MODE_M68K_030 = (1 << 4)
 
tuple CS_MODE_M68K_040 = (1 << 5)
 
tuple CS_MODE_M68K_060 = (1 << 6)
 
tuple CS_MODE_BIG_ENDIAN = (1 << 31)
 
tuple CS_MODE_MIPS32 = CS_MODE_32
 
tuple CS_MODE_MIPS64 = CS_MODE_64
 
tuple CS_MODE_M680X_6301 = (1 << 1)
 
tuple CS_MODE_M680X_6309 = (1 << 2)
 
tuple CS_MODE_M680X_6800 = (1 << 3)
 
tuple CS_MODE_M680X_6801 = (1 << 4)
 
tuple CS_MODE_M680X_6805 = (1 << 5)
 
tuple CS_MODE_M680X_6808 = (1 << 6)
 
tuple CS_MODE_M680X_6809 = (1 << 7)
 
tuple CS_MODE_M680X_6811 = (1 << 8)
 
tuple CS_MODE_M680X_CPU12 = (1 << 9)
 
tuple CS_MODE_M680X_HCS08 = (1 << 10)
 
int CS_OPT_SYNTAX = 1
 
int CS_OPT_DETAIL = 2
 
int CS_OPT_MODE = 3
 
int CS_OPT_MEM = 4
 
int CS_OPT_SKIPDATA = 5
 
int CS_OPT_SKIPDATA_SETUP = 6
 
int CS_OPT_MNEMONIC = 7
 
int CS_OPT_UNSIGNED = 8
 
int CS_OPT_OFF = 0
 
int CS_OPT_ON = 3
 
int CS_OP_INVALID = 0
 
int CS_OP_REG = 1
 
int CS_OP_IMM = 2
 
int CS_OP_MEM = 3
 
int CS_OP_FP = 4
 
int CS_GRP_INVALID = 0
 
int CS_GRP_JUMP = 1
 
int CS_GRP_CALL = 2
 
int CS_GRP_RET = 3
 
int CS_GRP_INT = 4
 
int CS_GRP_IRET = 5
 
int CS_GRP_PRIVILEGE = 6
 
int CS_AC_INVALID = 0
 
tuple CS_AC_READ = (1 << 0)
 
tuple CS_AC_WRITE = (1 << 1)
 
int CS_OPT_SYNTAX_DEFAULT = 0
 
int CS_OPT_SYNTAX_INTEL = 1
 
int CS_OPT_SYNTAX_ATT = 2
 
int CS_OPT_SYNTAX_NOREGNAME = 3
 
int CS_OPT_SYNTAX_MASM = 4
 
int CS_ERR_OK = 0
 
int CS_ERR_MEM = 1
 
int CS_ERR_ARCH = 2
 
int CS_ERR_HANDLE = 3
 
int CS_ERR_CSH = 4
 
int CS_ERR_MODE = 5
 
int CS_ERR_OPTION = 6
 
int CS_ERR_DETAIL = 7
 
int CS_ERR_MEMSETUP = 8
 
int CS_ERR_VERSION = 9
 
int CS_ERR_DIET = 10
 
int CS_ERR_SKIPDATA = 11
 
int CS_ERR_X86_ATT = 12
 
int CS_ERR_X86_INTEL = 13
 
int CS_ERR_X86_MASM = 14
 
int CS_SUPPORT_DIET = CS_ARCH_ALL + 1
 
int CS_SUPPORT_X86_REDUCE = CS_ARCH_ALL+2
 
dictionary CS_AC = {v:k for k,v in locals().items() if k.startswith('CS_AC_')}
 
dictionary CS_ARCH = {v:k for k,v in locals().items() if k.startswith('CS_ARCH_')}
 
dictionary CS_ERR = {v:k for k,v in locals().items() if k.startswith('CS_ERR_')}
 
dictionary CS_GRP = {v:k for k,v in locals().items() if k.startswith('CS_GRP_')}
 
dictionary CS_MODE = {v:k for k,v in locals().items() if k.startswith('CS_MODE_')}
 
dictionary CS_OP = {v:k for k,v in locals().items() if k.startswith('CS_OP_')}
 
dictionary CS_OPT = {v:k for k,v in locals().items() if k.startswith('CS_OPT_')}
 
 __file__ = inspect.getfile(inspect.currentframe())
 
string _lib = "libcapstone.dylib"
 
bool _found = False
 
 _cs = None
 
list _path_list
 
 CS_SKIPDATA_CALLBACK = ctypes.CFUNCTYPE(ctypes.c_size_t, ctypes.POINTER(ctypes.c_char), ctypes.c_size_t, ctypes.c_size_t, ctypes.c_void_p)
 

Function Documentation

◆ _ascii_name_or_default()

def capstone._ascii_name_or_default (   name,
  default 
)
private

Definition at line 525 of file __init__.py.

525 def _ascii_name_or_default(name, default):
526  return default if name is None else name.decode('ascii')
527 
528 
529 # Python-style class to disasm code
def _ascii_name_or_default(name, default)
Definition: __init__.py:525

Referenced by capstone.CsInsn.group_name(), capstone.Cs.group_name(), capstone.CsInsn.insn_name(), capstone.Cs.insn_name(), capstone.CsInsn.reg_name(), and capstone.Cs.reg_name().

◆ _load_lib()

def capstone._load_lib (   path)
private

Definition at line 282 of file __init__.py.

282 def _load_lib(path):
283  lib_file = join(path, _lib)
284  if os.path.exists(lib_file):
285  return ctypes.cdll.LoadLibrary(lib_file)
286  else:
287  # if we're on linux, try again with .so.4 extension
288  if lib_file.endswith('.so'):
289  if os.path.exists(lib_file + '.4'):
290  return ctypes.cdll.LoadLibrary(lib_file + '.4')
291  return None
292 
def _load_lib(path)
Definition: __init__.py:282

◆ _setup_prototype()

def capstone._setup_prototype (   lib,
  fname,
  restype,
argtypes 
)
private

Definition at line 387 of file __init__.py.

387 def _setup_prototype(lib, fname, restype, *argtypes):
388  getattr(lib, fname).restype = restype
389  getattr(lib, fname).argtypes = argtypes
390 
391 _setup_prototype(_cs, "cs_open", ctypes.c_int, ctypes.c_uint, ctypes.c_uint, ctypes.POINTER(ctypes.c_size_t))
392 _setup_prototype(_cs, "cs_disasm", ctypes.c_size_t, ctypes.c_size_t, ctypes.POINTER(ctypes.c_char), ctypes.c_size_t, \
393  ctypes.c_uint64, ctypes.c_size_t, ctypes.POINTER(ctypes.POINTER(_cs_insn)))
394 _setup_prototype(_cs, "cs_free", None, ctypes.c_void_p, ctypes.c_size_t)
395 _setup_prototype(_cs, "cs_close", ctypes.c_int, ctypes.POINTER(ctypes.c_size_t))
396 _setup_prototype(_cs, "cs_reg_name", ctypes.c_char_p, ctypes.c_size_t, ctypes.c_uint)
397 _setup_prototype(_cs, "cs_insn_name", ctypes.c_char_p, ctypes.c_size_t, ctypes.c_uint)
398 _setup_prototype(_cs, "cs_group_name", ctypes.c_char_p, ctypes.c_size_t, ctypes.c_uint)
399 _setup_prototype(_cs, "cs_op_count", ctypes.c_int, ctypes.c_size_t, ctypes.POINTER(_cs_insn), ctypes.c_uint)
400 _setup_prototype(_cs, "cs_op_index", ctypes.c_int, ctypes.c_size_t, ctypes.POINTER(_cs_insn), ctypes.c_uint, ctypes.c_uint)
401 _setup_prototype(_cs, "cs_errno", ctypes.c_int, ctypes.c_size_t)
402 _setup_prototype(_cs, "cs_option", ctypes.c_int, ctypes.c_size_t, ctypes.c_int, ctypes.c_void_p)
403 _setup_prototype(_cs, "cs_version", ctypes.c_int, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int))
404 _setup_prototype(_cs, "cs_support", ctypes.c_bool, ctypes.c_int)
405 _setup_prototype(_cs, "cs_strerror", ctypes.c_char_p, ctypes.c_int)
406 _setup_prototype(_cs, "cs_regs_access", ctypes.c_int, ctypes.c_size_t, ctypes.POINTER(_cs_insn), ctypes.POINTER(ctypes.c_uint16*64), ctypes.POINTER(ctypes.c_uint8), ctypes.POINTER(ctypes.c_uint16*64), ctypes.POINTER(ctypes.c_uint8))
407 
408 
409 # access to error code via @errno of CsError
def _setup_prototype(lib, fname, restype, *argtypes)
Definition: __init__.py:387

◆ copy_ctypes()

def capstone.copy_ctypes (   src)
Returns a new ctypes object which is a bitwise copy of an existing one

Definition at line 320 of file __init__.py.

320 def copy_ctypes(src):
321  """Returns a new ctypes object which is a bitwise copy of an existing one"""
322  dst = type(src)()
323  ctypes.memmove(ctypes.byref(dst), ctypes.byref(src), ctypes.sizeof(type(src)))
324  return dst
325 
int type
Definition: mipsasm.c:17
def copy_ctypes(src)
Definition: __init__.py:320

References type.

Referenced by copy_ctypes_list().

◆ copy_ctypes_list()

def capstone.copy_ctypes_list (   src)

Definition at line 326 of file __init__.py.

326 def copy_ctypes_list(src):
327  return [copy_ctypes(n) for n in src]
328 
329 # Weird import placement because these modules are needed by the below code but need the above functions
def copy_ctypes_list(src)
Definition: __init__.py:326

References copy_ctypes().

Referenced by capstone.m68k.M68KOpSize.get(), capstone.arm.get_arch_info(), capstone.arm64.get_arch_info(), capstone.m680x.get_arch_info(), capstone.m68k.get_arch_info(), capstone.mips.get_arch_info(), capstone.ppc.get_arch_info(), capstone.sparc.get_arch_info(), capstone.systemz.get_arch_info(), capstone.x86.get_arch_info(), and capstone.xcore.get_arch_info().

◆ cs_disasm_lite()

def capstone.cs_disasm_lite (   arch,
  mode,
  code,
  offset,
  count = 0 
)

Definition at line 489 of file __init__.py.

489 def cs_disasm_lite(arch, mode, code, offset, count=0):
490  # verify version compatibility with the core before doing anything
491  (major, minor, _combined) = cs_version()
492  if major != CS_API_MAJOR or minor != CS_API_MINOR:
493  # our binding version is different from the core's API version
494  raise CsError(CS_ERR_VERSION)
495 
496  if cs_support(CS_SUPPORT_DIET):
497  # Diet engine cannot provide @mnemonic & @op_str
498  raise CsError(CS_ERR_DIET)
499 
500  csh = ctypes.c_size_t()
501  status = _cs.cs_open(arch, mode, ctypes.byref(csh))
502  if status != CS_ERR_OK:
503  raise CsError(status)
504 
505  all_insn = ctypes.POINTER(_cs_insn)()
506  res = _cs.cs_disasm(csh, code, len(code), offset, count, ctypes.byref(all_insn))
507  if res > 0:
508  try:
509  for i in range(res):
510  insn = all_insn[i]
511  yield (insn.address, insn.size, insn.mnemonic.decode('ascii'), insn.op_str.decode('ascii'))
512  finally:
513  _cs.cs_free(all_insn, res)
514  else:
515  status = _cs.cs_errno(csh)
516  if status != CS_ERR_OK:
517  raise CsError(status)
518  return
519  yield
520 
521  status = _cs.cs_close(ctypes.byref(csh))
522  if status != CS_ERR_OK:
523  raise CsError(status)
524 
size_t len
Definition: 6502dis.c:15
CAPSTONE_EXPORT unsigned int CAPSTONE_API cs_version(int *major, int *minor)
Definition: cs.c:357
CAPSTONE_EXPORT bool CAPSTONE_API cs_support(int query)
Definition: cs.c:368
def cs_disasm_lite(arch, mode, code, offset, count=0)
Definition: __init__.py:489

References cs_support(), cs_version(), len, and range.

Referenced by test_lite.test_cs_disasm_quick(), and ppcbranch.test_cs_disasm_quick().

◆ cs_disasm_quick()

def capstone.cs_disasm_quick (   arch,
  mode,
  code,
  offset,
  count = 0 
)

Definition at line 452 of file __init__.py.

452 def cs_disasm_quick(arch, mode, code, offset, count=0):
453  # verify version compatibility with the core before doing anything
454  (major, minor, _combined) = cs_version()
455  if major != CS_API_MAJOR or minor != CS_API_MINOR:
456  # our binding version is different from the core's API version
457  raise CsError(CS_ERR_VERSION)
458 
459  csh = ctypes.c_size_t()
460  status = _cs.cs_open(arch, mode, ctypes.byref(csh))
461  if status != CS_ERR_OK:
462  raise CsError(status)
463 
464  all_insn = ctypes.POINTER(_cs_insn)()
465  res = _cs.cs_disasm(csh, code, len(code), offset, count, ctypes.byref(all_insn))
466  if res > 0:
467  try:
468  for i in range(res):
469  yield CsInsn(_dummy_cs(csh, arch), all_insn[i])
470  finally:
471  _cs.cs_free(all_insn, res)
472  else:
473  status = _cs.cs_errno(csh)
474  if status != CS_ERR_OK:
475  raise CsError(status)
476  return
477  yield
478 
479  status = _cs.cs_close(ctypes.byref(csh))
480  if status != CS_ERR_OK:
481  raise CsError(status)
482 
483 
484 # Another quick, but lighter function to disasm raw binary code.
485 # This function is faster than cs_disasm_quick() around 20% because
486 # cs_disasm_lite() only return tuples of (address, size, mnemonic, op_str),
487 # rather than CsInsn objects.
488 # NOTE: you might want to use more efficient Cs class & its methods.
def cs_disasm_quick(arch, mode, code, offset, count=0)
Definition: __init__.py:452

References cs_version(), len, and range.

Referenced by test_basic.test_cs_disasm_quick().

◆ cs_support()

def capstone.cs_support (   query)

Definition at line 436 of file __init__.py.

436 def cs_support(query):
437  return _cs.cs_support(query)
438 
439 
440 # dummy class resembling Cs class, just for cs_disasm_quick()
441 # this class only need to be referenced to via 2 fields: @csh & @arch

Referenced by cs_disasm_lite(), debug(), and capstone.Cs.support().

◆ cs_version()

def capstone.cs_version ( )

Definition at line 424 of file __init__.py.

424 def cs_version():
425  major = ctypes.c_int()
426  minor = ctypes.c_int()
427  combined = _cs.cs_version(ctypes.byref(major), ctypes.byref(minor))
428  return (major.value, minor.value, combined)
429 
430 
431 # return the binding's version

Referenced by capstone.Cs.__init__(), cs_disasm_lite(), cs_disasm_quick(), and debug().

◆ debug()

def capstone.debug ( )

Definition at line 1103 of file __init__.py.

1103 def debug():
1104  # is Cython there?
1105  try:
1106  from . import ccapstone
1107  return ccapstone.debug()
1108  except:
1109  # no Cython, fallback to Python code below
1110  pass
1111 
1112  if cs_support(CS_SUPPORT_DIET):
1113  diet = "diet"
1114  else:
1115  diet = "standard"
1116 
1117  archs = { "arm": CS_ARCH_ARM, "arm64": CS_ARCH_ARM64, "m68k": CS_ARCH_M68K, \
1118  "mips": CS_ARCH_MIPS, "ppc": CS_ARCH_PPC, "sparc": CS_ARCH_SPARC, \
1119  "sysz": CS_ARCH_SYSZ, 'xcore': CS_ARCH_XCORE, "tms320c64x": CS_ARCH_TMS320C64X, \
1120  "m680x": CS_ARCH_M680X, 'evm': CS_ARCH_EVM }
1121 
1122  all_archs = ""
1123  keys = archs.keys()
1124  for k in sorted(keys):
1125  if cs_support(archs[k]):
1126  all_archs += "-%s" % k
1127 
1128  if cs_support(CS_ARCH_X86):
1129  all_archs += "-x86"
1130  if cs_support(CS_SUPPORT_X86_REDUCE):
1131  all_archs += "_reduce"
1132 
1133  (major, minor, _combined) = cs_version()
1134 
1135  return "python-%s%s-c%u.%u-b%u.%u" % (diet, all_archs, major, minor, CS_API_MAJOR, CS_API_MINOR)
static int debug
Definition: visual.c:21

References cs_support(), and cs_version().

◆ version_bind()

def capstone.version_bind ( )

Definition at line 432 of file __init__.py.

432 def version_bind():
433  return (CS_API_MAJOR, CS_API_MINOR, (CS_API_MAJOR << 8) + CS_API_MINOR)
434 
435 
def version_bind()
Definition: __init__.py:432

Variable Documentation

◆ __all__

list capstone.__all__
private

Definition at line 8 of file __init__.py.

◆ __file__

capstone.__file__ = inspect.getfile(inspect.currentframe())
private

Definition at line 271 of file __init__.py.

◆ __version__

string capstone.__version__ = "%u.%u.%u" %(CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA)
private

Definition at line 139 of file __init__.py.

◆ _cs

def capstone._cs = None
private

Definition at line 293 of file __init__.py.

◆ _found

bool capstone._found = False
private

Definition at line 280 of file __init__.py.

◆ _lib

string capstone._lib = "libcapstone.dylib"
private

Definition at line 274 of file __init__.py.

◆ _path_list

list capstone._path_list
private
Initial value:
1 = [os.getenv('LIBCAPSTONE_PATH', None),
2  pkg_resources.resource_filename(__name__, 'lib'),
3  join(split(__file__)[0], 'lib'),
4  '',
5  distutils.sysconfig.get_python_lib(),
6  "/usr/local/lib/" if sys.platform == 'darwin' else '/usr/lib64']

Definition at line 303 of file __init__.py.

◆ _python2

int capstone._python2 = sys.version_info[0] < 3
private

Definition at line 4 of file __init__.py.

◆ CS_AC

dictionary capstone.CS_AC = {v:k for k,v in locals().items() if k.startswith('CS_AC_')}

Definition at line 256 of file __init__.py.

◆ CS_AC_INVALID

int capstone.CS_AC_INVALID = 0

Definition at line 223 of file __init__.py.

◆ CS_AC_READ

tuple capstone.CS_AC_READ = (1 << 0)

Definition at line 224 of file __init__.py.

◆ CS_AC_WRITE

tuple capstone.CS_AC_WRITE = (1 << 1)

Definition at line 225 of file __init__.py.

◆ CS_API_MAJOR

int capstone.CS_API_MAJOR = 4

Definition at line 131 of file __init__.py.

◆ CS_API_MINOR

int capstone.CS_API_MINOR = 0

Definition at line 132 of file __init__.py.

◆ CS_ARCH

dictionary capstone.CS_ARCH = {v:k for k,v in locals().items() if k.startswith('CS_ARCH_')}

Definition at line 257 of file __init__.py.

◆ CS_ARCH_ALL

int capstone.CS_ARCH_ALL = 0xFFFF

Definition at line 155 of file __init__.py.

◆ CS_ARCH_ARM

int capstone.CS_ARCH_ARM = 0

Definition at line 142 of file __init__.py.

◆ CS_ARCH_ARM64

int capstone.CS_ARCH_ARM64 = 1

Definition at line 143 of file __init__.py.

◆ CS_ARCH_EVM

int capstone.CS_ARCH_EVM = 11

Definition at line 153 of file __init__.py.

◆ CS_ARCH_M680X

int capstone.CS_ARCH_M680X = 10

Definition at line 152 of file __init__.py.

◆ CS_ARCH_M68K

int capstone.CS_ARCH_M68K = 8

Definition at line 150 of file __init__.py.

◆ CS_ARCH_MAX

int capstone.CS_ARCH_MAX = 12

Definition at line 154 of file __init__.py.

◆ CS_ARCH_MIPS

int capstone.CS_ARCH_MIPS = 2

Definition at line 144 of file __init__.py.

◆ CS_ARCH_PPC

int capstone.CS_ARCH_PPC = 4

Definition at line 146 of file __init__.py.

◆ CS_ARCH_SPARC

int capstone.CS_ARCH_SPARC = 5

Definition at line 147 of file __init__.py.

◆ CS_ARCH_SYSZ

int capstone.CS_ARCH_SYSZ = 6

Definition at line 148 of file __init__.py.

◆ CS_ARCH_TMS320C64X

int capstone.CS_ARCH_TMS320C64X = 9

Definition at line 151 of file __init__.py.

◆ CS_ARCH_X86

int capstone.CS_ARCH_X86 = 3

Definition at line 145 of file __init__.py.

◆ CS_ARCH_XCORE

int capstone.CS_ARCH_XCORE = 7

Definition at line 149 of file __init__.py.

◆ CS_ERR

dictionary capstone.CS_ERR = {v:k for k,v in locals().items() if k.startswith('CS_ERR_')}

Definition at line 258 of file __init__.py.

◆ CS_ERR_ARCH

int capstone.CS_ERR_ARCH = 2

Definition at line 237 of file __init__.py.

Referenced by cs_open(), cs_regs_access(), and cs_strerror().

◆ CS_ERR_CSH

int capstone.CS_ERR_CSH = 4

Definition at line 239 of file __init__.py.

Referenced by cs_close(), cs_errno(), cs_option(), and cs_strerror().

◆ CS_ERR_DETAIL

int capstone.CS_ERR_DETAIL = 7

◆ CS_ERR_DIET

int capstone.CS_ERR_DIET = 10

Definition at line 245 of file __init__.py.

Referenced by cs_regs_access(), and cs_strerror().

◆ CS_ERR_HANDLE

int capstone.CS_ERR_HANDLE = 3

Definition at line 238 of file __init__.py.

Referenced by cs_op_count(), cs_op_index(), and cs_strerror().

◆ CS_ERR_MEM

int capstone.CS_ERR_MEM = 1

Definition at line 236 of file __init__.py.

Referenced by cs_disasm(), cs_malloc(), cs_open(), and cs_strerror().

◆ CS_ERR_MEMSETUP

int capstone.CS_ERR_MEMSETUP = 8

Definition at line 243 of file __init__.py.

Referenced by cs_open(), and cs_strerror().

◆ CS_ERR_MODE

int capstone.CS_ERR_MODE = 5

Definition at line 240 of file __init__.py.

Referenced by cs_open(), and cs_strerror().

◆ CS_ERR_OK

◆ CS_ERR_OPTION

int capstone.CS_ERR_OPTION = 6

Definition at line 241 of file __init__.py.

Referenced by cs_option(), cs_strerror(), and ocaml_option().

◆ CS_ERR_SKIPDATA

int capstone.CS_ERR_SKIPDATA = 11

◆ CS_ERR_VERSION

int capstone.CS_ERR_VERSION = 9

Definition at line 244 of file __init__.py.

Referenced by cs_strerror().

◆ CS_ERR_X86_ATT

int capstone.CS_ERR_X86_ATT = 12

Definition at line 247 of file __init__.py.

Referenced by cs_strerror().

◆ CS_ERR_X86_INTEL

int capstone.CS_ERR_X86_INTEL = 13

Definition at line 248 of file __init__.py.

Referenced by cs_strerror().

◆ CS_ERR_X86_MASM

int capstone.CS_ERR_X86_MASM = 14

Definition at line 249 of file __init__.py.

Referenced by cs_strerror().

◆ CS_GRP

dictionary capstone.CS_GRP = {v:k for k,v in locals().items() if k.startswith('CS_GRP_')}

Definition at line 259 of file __init__.py.

◆ CS_GRP_CALL

int capstone.CS_GRP_CALL = 2

Definition at line 216 of file __init__.py.

◆ CS_GRP_INT

int capstone.CS_GRP_INT = 4

Definition at line 218 of file __init__.py.

◆ CS_GRP_INVALID

int capstone.CS_GRP_INVALID = 0

Definition at line 214 of file __init__.py.

◆ CS_GRP_IRET

int capstone.CS_GRP_IRET = 5

Definition at line 219 of file __init__.py.

◆ CS_GRP_JUMP

int capstone.CS_GRP_JUMP = 1

Definition at line 215 of file __init__.py.

◆ CS_GRP_PRIVILEGE

int capstone.CS_GRP_PRIVILEGE = 6

Definition at line 220 of file __init__.py.

◆ CS_GRP_RET

int capstone.CS_GRP_RET = 3

Definition at line 217 of file __init__.py.

◆ CS_MODE

dictionary capstone.CS_MODE = {v:k for k,v in locals().items() if k.startswith('CS_MODE_')}

Definition at line 260 of file __init__.py.

◆ CS_MODE_16

tuple capstone.CS_MODE_16 = (1 << 1)

Definition at line 160 of file __init__.py.

◆ CS_MODE_32

tuple capstone.CS_MODE_32 = (1 << 2)

Definition at line 161 of file __init__.py.

◆ CS_MODE_64

tuple capstone.CS_MODE_64 = (1 << 3)

Definition at line 162 of file __init__.py.

◆ CS_MODE_ARM

int capstone.CS_MODE_ARM = 0

Definition at line 159 of file __init__.py.

◆ CS_MODE_BIG_ENDIAN

tuple capstone.CS_MODE_BIG_ENDIAN = (1 << 31)

Definition at line 178 of file __init__.py.

◆ CS_MODE_LITTLE_ENDIAN

int capstone.CS_MODE_LITTLE_ENDIAN = 0

Definition at line 158 of file __init__.py.

◆ CS_MODE_M680X_6301

tuple capstone.CS_MODE_M680X_6301 = (1 << 1)

Definition at line 181 of file __init__.py.

◆ CS_MODE_M680X_6309

tuple capstone.CS_MODE_M680X_6309 = (1 << 2)

Definition at line 182 of file __init__.py.

◆ CS_MODE_M680X_6800

tuple capstone.CS_MODE_M680X_6800 = (1 << 3)

Definition at line 183 of file __init__.py.

◆ CS_MODE_M680X_6801

tuple capstone.CS_MODE_M680X_6801 = (1 << 4)

Definition at line 184 of file __init__.py.

◆ CS_MODE_M680X_6805

tuple capstone.CS_MODE_M680X_6805 = (1 << 5)

Definition at line 185 of file __init__.py.

◆ CS_MODE_M680X_6808

tuple capstone.CS_MODE_M680X_6808 = (1 << 6)

Definition at line 186 of file __init__.py.

◆ CS_MODE_M680X_6809

tuple capstone.CS_MODE_M680X_6809 = (1 << 7)

Definition at line 187 of file __init__.py.

◆ CS_MODE_M680X_6811

tuple capstone.CS_MODE_M680X_6811 = (1 << 8)

Definition at line 188 of file __init__.py.

◆ CS_MODE_M680X_CPU12

tuple capstone.CS_MODE_M680X_CPU12 = (1 << 9)

Definition at line 189 of file __init__.py.

◆ CS_MODE_M680X_HCS08

tuple capstone.CS_MODE_M680X_HCS08 = (1 << 10)

Definition at line 190 of file __init__.py.

◆ CS_MODE_M68K_000

tuple capstone.CS_MODE_M68K_000 = (1 << 1)

Definition at line 172 of file __init__.py.

◆ CS_MODE_M68K_010

tuple capstone.CS_MODE_M68K_010 = (1 << 2)

Definition at line 173 of file __init__.py.

◆ CS_MODE_M68K_020

tuple capstone.CS_MODE_M68K_020 = (1 << 3)

Definition at line 174 of file __init__.py.

◆ CS_MODE_M68K_030

tuple capstone.CS_MODE_M68K_030 = (1 << 4)

Definition at line 175 of file __init__.py.

◆ CS_MODE_M68K_040

tuple capstone.CS_MODE_M68K_040 = (1 << 5)

Definition at line 176 of file __init__.py.

◆ CS_MODE_M68K_060

tuple capstone.CS_MODE_M68K_060 = (1 << 6)

Definition at line 177 of file __init__.py.

◆ CS_MODE_MCLASS

tuple capstone.CS_MODE_MCLASS = (1 << 5)

Definition at line 164 of file __init__.py.

◆ CS_MODE_MICRO

tuple capstone.CS_MODE_MICRO = (1 << 4)

Definition at line 166 of file __init__.py.

◆ CS_MODE_MIPS2

tuple capstone.CS_MODE_MIPS2 = (1 << 7)

Definition at line 169 of file __init__.py.

◆ CS_MODE_MIPS3

tuple capstone.CS_MODE_MIPS3 = (1 << 5)

Definition at line 167 of file __init__.py.

◆ CS_MODE_MIPS32

tuple capstone.CS_MODE_MIPS32 = CS_MODE_32

Definition at line 179 of file __init__.py.

◆ CS_MODE_MIPS32R6

tuple capstone.CS_MODE_MIPS32R6 = (1 << 6)

Definition at line 168 of file __init__.py.

◆ CS_MODE_MIPS64

tuple capstone.CS_MODE_MIPS64 = CS_MODE_64

Definition at line 180 of file __init__.py.

◆ CS_MODE_QPX

tuple capstone.CS_MODE_QPX = (1 << 4)

Definition at line 171 of file __init__.py.

◆ CS_MODE_THUMB

tuple capstone.CS_MODE_THUMB = (1 << 4)

Definition at line 163 of file __init__.py.

◆ CS_MODE_V8

tuple capstone.CS_MODE_V8 = (1 << 6)

Definition at line 165 of file __init__.py.

◆ CS_MODE_V9

tuple capstone.CS_MODE_V9 = (1 << 4)

Definition at line 170 of file __init__.py.

◆ CS_OP

dictionary capstone.CS_OP = {v:k for k,v in locals().items() if k.startswith('CS_OP_')}

Definition at line 261 of file __init__.py.

◆ CS_OP_FP

int capstone.CS_OP_FP = 4

Definition at line 211 of file __init__.py.

◆ CS_OP_IMM

int capstone.CS_OP_IMM = 2

Definition at line 209 of file __init__.py.

◆ CS_OP_INVALID

int capstone.CS_OP_INVALID = 0

Definition at line 207 of file __init__.py.

◆ CS_OP_MEM

int capstone.CS_OP_MEM = 3

Definition at line 210 of file __init__.py.

◆ CS_OP_REG

int capstone.CS_OP_REG = 1

Definition at line 208 of file __init__.py.

◆ CS_OPT

dictionary capstone.CS_OPT = {v:k for k,v in locals().items() if k.startswith('CS_OPT_')}

Definition at line 262 of file __init__.py.

◆ CS_OPT_DETAIL

int capstone.CS_OPT_DETAIL = 2

Definition at line 194 of file __init__.py.

◆ CS_OPT_MEM

int capstone.CS_OPT_MEM = 4

Definition at line 196 of file __init__.py.

◆ CS_OPT_MNEMONIC

int capstone.CS_OPT_MNEMONIC = 7

Definition at line 199 of file __init__.py.

◆ CS_OPT_MODE

int capstone.CS_OPT_MODE = 3

Definition at line 195 of file __init__.py.

◆ CS_OPT_OFF

int capstone.CS_OPT_OFF = 0

Definition at line 203 of file __init__.py.

◆ CS_OPT_ON

int capstone.CS_OPT_ON = 3

Definition at line 204 of file __init__.py.

◆ CS_OPT_SKIPDATA

int capstone.CS_OPT_SKIPDATA = 5

Definition at line 197 of file __init__.py.

◆ CS_OPT_SKIPDATA_SETUP

int capstone.CS_OPT_SKIPDATA_SETUP = 6

Definition at line 198 of file __init__.py.

◆ CS_OPT_SYNTAX

int capstone.CS_OPT_SYNTAX = 1

Definition at line 193 of file __init__.py.

◆ CS_OPT_SYNTAX_ATT

int capstone.CS_OPT_SYNTAX_ATT = 2

Definition at line 230 of file __init__.py.

◆ CS_OPT_SYNTAX_DEFAULT

int capstone.CS_OPT_SYNTAX_DEFAULT = 0

Definition at line 228 of file __init__.py.

◆ CS_OPT_SYNTAX_INTEL

int capstone.CS_OPT_SYNTAX_INTEL = 1

Definition at line 229 of file __init__.py.

◆ CS_OPT_SYNTAX_MASM

int capstone.CS_OPT_SYNTAX_MASM = 4

Definition at line 232 of file __init__.py.

◆ CS_OPT_SYNTAX_NOREGNAME

int capstone.CS_OPT_SYNTAX_NOREGNAME = 3

Definition at line 231 of file __init__.py.

◆ CS_OPT_UNSIGNED

int capstone.CS_OPT_UNSIGNED = 8

Definition at line 200 of file __init__.py.

◆ CS_SKIPDATA_CALLBACK

capstone.CS_SKIPDATA_CALLBACK = ctypes.CFUNCTYPE(ctypes.c_size_t, ctypes.POINTER(ctypes.c_char), ctypes.c_size_t, ctypes.c_size_t, ctypes.c_void_p)

Definition at line 371 of file __init__.py.

Referenced by capstone.Cs.skipdata_setup().

◆ CS_SUPPORT_DIET

int capstone.CS_SUPPORT_DIET = CS_ARCH_ALL + 1

Definition at line 252 of file __init__.py.

◆ CS_SUPPORT_X86_REDUCE

int capstone.CS_SUPPORT_X86_REDUCE = CS_ARCH_ALL+2

Definition at line 253 of file __init__.py.

◆ CS_VERSION_EXTRA

int capstone.CS_VERSION_EXTRA = 2

Definition at line 137 of file __init__.py.

◆ CS_VERSION_MAJOR

int capstone.CS_VERSION_MAJOR = CS_API_MAJOR

Definition at line 135 of file __init__.py.

◆ CS_VERSION_MINOR

int capstone.CS_VERSION_MINOR = CS_API_MINOR

Definition at line 136 of file __init__.py.

◆ range