Rizin
unix-like reverse engineering framework and cli tools
mips.py
Go to the documentation of this file.
1 # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com>
2 
3 import ctypes
4 from . import copy_ctypes_list
5 from .mips_const import *
6 
7 # define the API
8 class MipsOpMem(ctypes.Structure):
9  _fields_ = (
10  ('base', ctypes.c_uint),
11  ('disp', ctypes.c_int64),
12  )
13 
14 class MipsOpValue(ctypes.Union):
15  _fields_ = (
16  ('reg', ctypes.c_uint),
17  ('imm', ctypes.c_int64),
18  ('mem', MipsOpMem),
19  )
20 
21 class MipsOp(ctypes.Structure):
22  _fields_ = (
23  ('type', ctypes.c_uint),
24  ('value', MipsOpValue),
25  )
26 
27  @property
28  def imm(self):
29  return self.value.imm
30 
31  @property
32  def reg(self):
33  return self.value.reg
34 
35  @property
36  def mem(self):
37  return self.value.mem
38 
39 
40 class CsMips(ctypes.Structure):
41  _fields_ = (
42  ('op_count', ctypes.c_uint8),
43  ('operands', MipsOp * 10),
44  )
45 
47  return copy_ctypes_list(a.operands[:a.op_count])
48 
def mem(self)
Definition: mips.py:36
def reg(self)
Definition: mips.py:32
def imm(self)
Definition: mips.py:28
def get_arch_info(a)
Definition: mips.py:46
def copy_ctypes_list(src)
Definition: __init__.py:326