Rizin
unix-like reverse engineering framework and cli tools
systemz.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
.sysz_const
import
*
6
7
# define the API
8
class
SyszOpMem
(ctypes.Structure):
9
_fields_ = (
10
(
'base'
, ctypes.c_uint8),
11
(
'index'
, ctypes.c_uint8),
12
(
'length'
, ctypes.c_uint64),
13
(
'disp'
, ctypes.c_int64),
14
)
15
16
class
SyszOpValue
(ctypes.Union):
17
_fields_ = (
18
(
'reg'
, ctypes.c_uint),
19
(
'imm'
, ctypes.c_int64),
20
(
'mem'
, SyszOpMem),
21
)
22
23
class
SyszOp
(ctypes.Structure):
24
_fields_ = (
25
(
'type'
, ctypes.c_uint),
26
(
'value'
, SyszOpValue),
27
)
28
29
@property
30
def
imm
(self):
31
return
self.value.imm
32
33
@property
34
def
reg
(self):
35
return
self.value.reg
36
37
@property
38
def
mem
(self):
39
return
self.value.mem
40
41
42
class
CsSysz
(ctypes.Structure):
43
_fields_ = (
44
(
'cc'
, ctypes.c_uint),
45
(
'op_count'
, ctypes.c_uint8),
46
(
'operands'
, SyszOp * 6),
47
)
48
49
def
get_arch_info
(a):
50
return
(a.cc,
copy_ctypes_list
(a.operands[:a.op_count]))
51
capstone.systemz.CsSysz
Definition:
systemz.py:42
capstone.systemz.SyszOpMem
Definition:
systemz.py:8
capstone.systemz.SyszOpValue
Definition:
systemz.py:16
capstone.systemz.SyszOp
Definition:
systemz.py:23
capstone.systemz.SyszOp.imm
def imm(self)
Definition:
systemz.py:30
capstone.systemz.SyszOp.reg
def reg(self)
Definition:
systemz.py:34
capstone.systemz.SyszOp.mem
def mem(self)
Definition:
systemz.py:38
capstone.systemz.get_arch_info
def get_arch_info(a)
Definition:
systemz.py:49
capstone.copy_ctypes_list
def copy_ctypes_list(src)
Definition:
__init__.py:326
subprojects
capstone-bundled
bindings
python
capstone
systemz.py
Generated by
1.9.1