Rizin
unix-like reverse engineering framework and cli tools
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
p
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
b
d
e
h
i
k
n
p
r
s
w
Properties
Events
Related Functions
Files
File List
File Members
All
$
.
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
.
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Events
Friends
Macros
Modules
Pages
sparc.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
.sparc_const
import
*
6
7
# define the API
8
class
SparcOpMem
(ctypes.Structure):
9
_fields_ = (
10
(
'base'
, ctypes.c_uint8),
11
(
'index'
, ctypes.c_uint8),
12
(
'disp'
, ctypes.c_int32),
13
)
14
15
class
SparcOpValue
(ctypes.Union):
16
_fields_ = (
17
(
'reg'
, ctypes.c_uint),
18
(
'imm'
, ctypes.c_int64),
19
(
'mem'
, SparcOpMem),
20
)
21
22
class
SparcOp
(ctypes.Structure):
23
_fields_ = (
24
(
'type'
, ctypes.c_uint),
25
(
'value'
, SparcOpValue),
26
)
27
28
@property
29
def
imm
(self):
30
return
self.value.imm
31
32
@property
33
def
reg
(self):
34
return
self.value.reg
35
36
@property
37
def
mem
(self):
38
return
self.value.mem
39
40
41
class
CsSparc
(ctypes.Structure):
42
_fields_ = (
43
(
'cc'
, ctypes.c_uint),
44
(
'hint'
, ctypes.c_uint),
45
(
'op_count'
, ctypes.c_uint8),
46
(
'operands'
, SparcOp * 4),
47
)
48
49
def
get_arch_info
(a):
50
return
(a.cc, a.hint,
copy_ctypes_list
(a.operands[:a.op_count]))
51
capstone.sparc.CsSparc
Definition:
sparc.py:41
capstone.sparc.SparcOpMem
Definition:
sparc.py:8
capstone.sparc.SparcOpValue
Definition:
sparc.py:15
capstone.sparc.SparcOp
Definition:
sparc.py:22
capstone.sparc.SparcOp.mem
def mem(self)
Definition:
sparc.py:37
capstone.sparc.SparcOp.imm
def imm(self)
Definition:
sparc.py:29
capstone.sparc.SparcOp.reg
def reg(self)
Definition:
sparc.py:33
capstone.sparc.get_arch_info
def get_arch_info(a)
Definition:
sparc.py:49
capstone.copy_ctypes_list
def copy_ctypes_list(src)
Definition:
__init__.py:326
subprojects
capstone-bundled
bindings
python
capstone
sparc.py
Generated by
1.9.1