crabstone 4.0.4 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +6 -0
- data/README.md +24 -8
- data/lib/crabstone/arch/3/constants.rb +86 -0
- data/lib/crabstone/arch/4/constants.rb +116 -0
- data/lib/crabstone/arch/5/arm.rb +111 -0
- data/lib/crabstone/arch/5/arm64.rb +131 -0
- data/lib/crabstone/arch/5/arm64_const.rb +3015 -0
- data/lib/crabstone/arch/5/arm_const.rb +840 -0
- data/lib/crabstone/arch/5/bpf.rb +81 -0
- data/lib/crabstone/arch/5/bpf_const.rb +124 -0
- data/lib/crabstone/arch/5/constants.rb +155 -0
- data/lib/crabstone/arch/5/evm.rb +20 -0
- data/lib/crabstone/arch/5/evm_const.rb +161 -0
- data/lib/crabstone/arch/5/m680x.rb +106 -0
- data/lib/crabstone/arch/5/m680x_const.rb +426 -0
- data/lib/crabstone/arch/5/m68k.rb +129 -0
- data/lib/crabstone/arch/5/m68k_const.rb +496 -0
- data/lib/crabstone/arch/5/mips.rb +57 -0
- data/lib/crabstone/arch/5/mips_const.rb +869 -0
- data/lib/crabstone/arch/5/mos65xx.rb +52 -0
- data/lib/crabstone/arch/5/mos65xx_const.rb +162 -0
- data/lib/crabstone/arch/5/ppc.rb +69 -0
- data/lib/crabstone/arch/5/ppc_const.rb +2024 -0
- data/lib/crabstone/arch/5/riscv.rb +58 -0
- data/lib/crabstone/arch/5/riscv_const.rb +455 -0
- data/lib/crabstone/arch/5/sh.rb +72 -0
- data/lib/crabstone/arch/5/sh_const.rb +376 -0
- data/lib/crabstone/arch/5/sparc.rb +60 -0
- data/lib/crabstone/arch/5/sparc_const.rb +439 -0
- data/lib/crabstone/arch/5/sysz.rb +60 -0
- data/lib/crabstone/arch/5/sysz_const.rb +2532 -0
- data/lib/crabstone/arch/5/tms320c64x.rb +87 -0
- data/lib/crabstone/arch/5/tms320c64x_const.rb +287 -0
- data/lib/crabstone/arch/5/tricore.rb +59 -0
- data/lib/crabstone/arch/5/tricore_const.rb +488 -0
- data/lib/crabstone/arch/5/wasm.rb +81 -0
- data/lib/crabstone/arch/5/wasm_const.rb +201 -0
- data/lib/crabstone/arch/5/x86.rb +98 -0
- data/lib/crabstone/arch/5/x86_const.rb +1999 -0
- data/lib/crabstone/arch/5/xcore.rb +59 -0
- data/lib/crabstone/arch/5/xcore_const.rb +171 -0
- data/lib/crabstone/arch/extension.rb +2 -1
- data/lib/crabstone/arch/register.rb +1 -1
- data/lib/crabstone/arch.rb +6 -0
- data/lib/crabstone/binding/5/detail.rb +47 -0
- data/lib/crabstone/binding/5/instruction.rb +23 -0
- data/lib/crabstone/binding.rb +2 -2
- data/lib/crabstone/constants.rb +2 -107
- data/lib/crabstone/cs_version.rb +2 -3
- data/lib/crabstone/disassembler.rb +2 -3
- data/lib/crabstone/instruction.rb +0 -1
- data/lib/crabstone/version.rb +1 -1
- metadata +45 -4
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
4
|
+
|
5
|
+
require 'ffi'
|
6
|
+
|
7
|
+
require 'crabstone/arch/extension'
|
8
|
+
require_relative 'tms320c64x_const'
|
9
|
+
|
10
|
+
module Crabstone
|
11
|
+
module TMS320C64X
|
12
|
+
class OperandMemory < FFI::Struct
|
13
|
+
layout(
|
14
|
+
:base, :int,
|
15
|
+
:disp, :int,
|
16
|
+
:unit, :int,
|
17
|
+
:scaled, :int,
|
18
|
+
:disptype, :int,
|
19
|
+
:direction, :int,
|
20
|
+
:modify, :int
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
class OperandValue < FFI::Union
|
25
|
+
layout(
|
26
|
+
:reg, :uint,
|
27
|
+
:imm, :int,
|
28
|
+
:mem, OperandMemory
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
class Operand < FFI::Struct
|
33
|
+
layout(
|
34
|
+
:type, :uint,
|
35
|
+
:value, OperandValue
|
36
|
+
)
|
37
|
+
|
38
|
+
include Crabstone::Extension::Operand
|
39
|
+
|
40
|
+
def reg?
|
41
|
+
[
|
42
|
+
OP_REG,
|
43
|
+
OP_REGPAIR
|
44
|
+
].include?(self[:type])
|
45
|
+
end
|
46
|
+
|
47
|
+
def imm?
|
48
|
+
self[:type] == OP_IMM
|
49
|
+
end
|
50
|
+
|
51
|
+
def mem?
|
52
|
+
self[:type] == OP_MEM
|
53
|
+
end
|
54
|
+
|
55
|
+
def regpair?
|
56
|
+
self[:type] == OP_REGPAIR
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class Condition < FFI::Struct
|
61
|
+
layout(
|
62
|
+
:reg, :uint,
|
63
|
+
:zero, :uint
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
class FunctionalUnit < FFI::Struct
|
68
|
+
layout(
|
69
|
+
:unit, :uint,
|
70
|
+
:side, :uint,
|
71
|
+
:crosspath, :uint
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
class Instruction < FFI::Struct
|
76
|
+
layout(
|
77
|
+
:op_count, :uint8,
|
78
|
+
:operands, [Operand, 8],
|
79
|
+
:condition, Condition,
|
80
|
+
:funit, FunctionalUnit,
|
81
|
+
:parallel, :uint
|
82
|
+
)
|
83
|
+
|
84
|
+
include Crabstone::Extension::Instruction
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,287 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
4
|
+
|
5
|
+
require 'crabstone/arch/register'
|
6
|
+
|
7
|
+
module Crabstone
|
8
|
+
module TMS320C64X
|
9
|
+
OP_INVALID = 0
|
10
|
+
OP_REG = 1
|
11
|
+
OP_IMM = 2
|
12
|
+
OP_MEM = 3
|
13
|
+
OP_REGPAIR = 64
|
14
|
+
|
15
|
+
MEM_DISP_INVALID = 0
|
16
|
+
MEM_DISP_CONSTANT = 1
|
17
|
+
MEM_DISP_REGISTER = 2
|
18
|
+
|
19
|
+
MEM_DIR_INVALID = 0
|
20
|
+
MEM_DIR_FW = 1
|
21
|
+
MEM_DIR_BW = 2
|
22
|
+
|
23
|
+
MEM_MOD_INVALID = 0
|
24
|
+
MEM_MOD_NO = 1
|
25
|
+
MEM_MOD_PRE = 2
|
26
|
+
MEM_MOD_POST = 3
|
27
|
+
|
28
|
+
REG_INVALID = 0
|
29
|
+
REG_AMR = 1
|
30
|
+
REG_CSR = 2
|
31
|
+
REG_DIER = 3
|
32
|
+
REG_DNUM = 4
|
33
|
+
REG_ECR = 5
|
34
|
+
REG_GFPGFR = 6
|
35
|
+
REG_GPLYA = 7
|
36
|
+
REG_GPLYB = 8
|
37
|
+
REG_ICR = 9
|
38
|
+
REG_IER = 10
|
39
|
+
REG_IERR = 11
|
40
|
+
REG_ILC = 12
|
41
|
+
REG_IRP = 13
|
42
|
+
REG_ISR = 14
|
43
|
+
REG_ISTP = 15
|
44
|
+
REG_ITSR = 16
|
45
|
+
REG_NRP = 17
|
46
|
+
REG_NTSR = 18
|
47
|
+
REG_REP = 19
|
48
|
+
REG_RILC = 20
|
49
|
+
REG_SSR = 21
|
50
|
+
REG_TSCH = 22
|
51
|
+
REG_TSCL = 23
|
52
|
+
REG_TSR = 24
|
53
|
+
REG_A0 = 25
|
54
|
+
REG_A1 = 26
|
55
|
+
REG_A2 = 27
|
56
|
+
REG_A3 = 28
|
57
|
+
REG_A4 = 29
|
58
|
+
REG_A5 = 30
|
59
|
+
REG_A6 = 31
|
60
|
+
REG_A7 = 32
|
61
|
+
REG_A8 = 33
|
62
|
+
REG_A9 = 34
|
63
|
+
REG_A10 = 35
|
64
|
+
REG_A11 = 36
|
65
|
+
REG_A12 = 37
|
66
|
+
REG_A13 = 38
|
67
|
+
REG_A14 = 39
|
68
|
+
REG_A15 = 40
|
69
|
+
REG_A16 = 41
|
70
|
+
REG_A17 = 42
|
71
|
+
REG_A18 = 43
|
72
|
+
REG_A19 = 44
|
73
|
+
REG_A20 = 45
|
74
|
+
REG_A21 = 46
|
75
|
+
REG_A22 = 47
|
76
|
+
REG_A23 = 48
|
77
|
+
REG_A24 = 49
|
78
|
+
REG_A25 = 50
|
79
|
+
REG_A26 = 51
|
80
|
+
REG_A27 = 52
|
81
|
+
REG_A28 = 53
|
82
|
+
REG_A29 = 54
|
83
|
+
REG_A30 = 55
|
84
|
+
REG_A31 = 56
|
85
|
+
REG_B0 = 57
|
86
|
+
REG_B1 = 58
|
87
|
+
REG_B2 = 59
|
88
|
+
REG_B3 = 60
|
89
|
+
REG_B4 = 61
|
90
|
+
REG_B5 = 62
|
91
|
+
REG_B6 = 63
|
92
|
+
REG_B7 = 64
|
93
|
+
REG_B8 = 65
|
94
|
+
REG_B9 = 66
|
95
|
+
REG_B10 = 67
|
96
|
+
REG_B11 = 68
|
97
|
+
REG_B12 = 69
|
98
|
+
REG_B13 = 70
|
99
|
+
REG_B14 = 71
|
100
|
+
REG_B15 = 72
|
101
|
+
REG_B16 = 73
|
102
|
+
REG_B17 = 74
|
103
|
+
REG_B18 = 75
|
104
|
+
REG_B19 = 76
|
105
|
+
REG_B20 = 77
|
106
|
+
REG_B21 = 78
|
107
|
+
REG_B22 = 79
|
108
|
+
REG_B23 = 80
|
109
|
+
REG_B24 = 81
|
110
|
+
REG_B25 = 82
|
111
|
+
REG_B26 = 83
|
112
|
+
REG_B27 = 84
|
113
|
+
REG_B28 = 85
|
114
|
+
REG_B29 = 86
|
115
|
+
REG_B30 = 87
|
116
|
+
REG_B31 = 88
|
117
|
+
REG_PCE1 = 89
|
118
|
+
REG_ENDING = 90
|
119
|
+
REG_EFR = REG_ECR
|
120
|
+
REG_IFR = REG_ISR
|
121
|
+
|
122
|
+
INS_INVALID = 0
|
123
|
+
INS_ABS = 1
|
124
|
+
INS_ABS2 = 2
|
125
|
+
INS_ADD = 3
|
126
|
+
INS_ADD2 = 4
|
127
|
+
INS_ADD4 = 5
|
128
|
+
INS_ADDAB = 6
|
129
|
+
INS_ADDAD = 7
|
130
|
+
INS_ADDAH = 8
|
131
|
+
INS_ADDAW = 9
|
132
|
+
INS_ADDK = 10
|
133
|
+
INS_ADDKPC = 11
|
134
|
+
INS_ADDU = 12
|
135
|
+
INS_AND = 13
|
136
|
+
INS_ANDN = 14
|
137
|
+
INS_AVG2 = 15
|
138
|
+
INS_AVGU4 = 16
|
139
|
+
INS_B = 17
|
140
|
+
INS_BDEC = 18
|
141
|
+
INS_BITC4 = 19
|
142
|
+
INS_BNOP = 20
|
143
|
+
INS_BPOS = 21
|
144
|
+
INS_CLR = 22
|
145
|
+
INS_CMPEQ = 23
|
146
|
+
INS_CMPEQ2 = 24
|
147
|
+
INS_CMPEQ4 = 25
|
148
|
+
INS_CMPGT = 26
|
149
|
+
INS_CMPGT2 = 27
|
150
|
+
INS_CMPGTU4 = 28
|
151
|
+
INS_CMPLT = 29
|
152
|
+
INS_CMPLTU = 30
|
153
|
+
INS_DEAL = 31
|
154
|
+
INS_DOTP2 = 32
|
155
|
+
INS_DOTPN2 = 33
|
156
|
+
INS_DOTPNRSU2 = 34
|
157
|
+
INS_DOTPRSU2 = 35
|
158
|
+
INS_DOTPSU4 = 36
|
159
|
+
INS_DOTPU4 = 37
|
160
|
+
INS_EXT = 38
|
161
|
+
INS_EXTU = 39
|
162
|
+
INS_GMPGTU = 40
|
163
|
+
INS_GMPY4 = 41
|
164
|
+
INS_LDB = 42
|
165
|
+
INS_LDBU = 43
|
166
|
+
INS_LDDW = 44
|
167
|
+
INS_LDH = 45
|
168
|
+
INS_LDHU = 46
|
169
|
+
INS_LDNDW = 47
|
170
|
+
INS_LDNW = 48
|
171
|
+
INS_LDW = 49
|
172
|
+
INS_LMBD = 50
|
173
|
+
INS_MAX2 = 51
|
174
|
+
INS_MAXU4 = 52
|
175
|
+
INS_MIN2 = 53
|
176
|
+
INS_MINU4 = 54
|
177
|
+
INS_MPY = 55
|
178
|
+
INS_MPY2 = 56
|
179
|
+
INS_MPYH = 57
|
180
|
+
INS_MPYHI = 58
|
181
|
+
INS_MPYHIR = 59
|
182
|
+
INS_MPYHL = 60
|
183
|
+
INS_MPYHLU = 61
|
184
|
+
INS_MPYHSLU = 62
|
185
|
+
INS_MPYHSU = 63
|
186
|
+
INS_MPYHU = 64
|
187
|
+
INS_MPYHULS = 65
|
188
|
+
INS_MPYHUS = 66
|
189
|
+
INS_MPYLH = 67
|
190
|
+
INS_MPYLHU = 68
|
191
|
+
INS_MPYLI = 69
|
192
|
+
INS_MPYLIR = 70
|
193
|
+
INS_MPYLSHU = 71
|
194
|
+
INS_MPYLUHS = 72
|
195
|
+
INS_MPYSU = 73
|
196
|
+
INS_MPYSU4 = 74
|
197
|
+
INS_MPYU = 75
|
198
|
+
INS_MPYU4 = 76
|
199
|
+
INS_MPYUS = 77
|
200
|
+
INS_MVC = 78
|
201
|
+
INS_MVD = 79
|
202
|
+
INS_MVK = 80
|
203
|
+
INS_MVKL = 81
|
204
|
+
INS_MVKLH = 82
|
205
|
+
INS_NOP = 83
|
206
|
+
INS_NORM = 84
|
207
|
+
INS_OR = 85
|
208
|
+
INS_PACK2 = 86
|
209
|
+
INS_PACKH2 = 87
|
210
|
+
INS_PACKH4 = 88
|
211
|
+
INS_PACKHL2 = 89
|
212
|
+
INS_PACKL4 = 90
|
213
|
+
INS_PACKLH2 = 91
|
214
|
+
INS_ROTL = 92
|
215
|
+
INS_SADD = 93
|
216
|
+
INS_SADD2 = 94
|
217
|
+
INS_SADDU4 = 95
|
218
|
+
INS_SADDUS2 = 96
|
219
|
+
INS_SAT = 97
|
220
|
+
INS_SET = 98
|
221
|
+
INS_SHFL = 99
|
222
|
+
INS_SHL = 100
|
223
|
+
INS_SHLMB = 101
|
224
|
+
INS_SHR = 102
|
225
|
+
INS_SHR2 = 103
|
226
|
+
INS_SHRMB = 104
|
227
|
+
INS_SHRU = 105
|
228
|
+
INS_SHRU2 = 106
|
229
|
+
INS_SMPY = 107
|
230
|
+
INS_SMPY2 = 108
|
231
|
+
INS_SMPYH = 109
|
232
|
+
INS_SMPYHL = 110
|
233
|
+
INS_SMPYLH = 111
|
234
|
+
INS_SPACK2 = 112
|
235
|
+
INS_SPACKU4 = 113
|
236
|
+
INS_SSHL = 114
|
237
|
+
INS_SSHVL = 115
|
238
|
+
INS_SSHVR = 116
|
239
|
+
INS_SSUB = 117
|
240
|
+
INS_STB = 118
|
241
|
+
INS_STDW = 119
|
242
|
+
INS_STH = 120
|
243
|
+
INS_STNDW = 121
|
244
|
+
INS_STNW = 122
|
245
|
+
INS_STW = 123
|
246
|
+
INS_SUB = 124
|
247
|
+
INS_SUB2 = 125
|
248
|
+
INS_SUB4 = 126
|
249
|
+
INS_SUBAB = 127
|
250
|
+
INS_SUBABS4 = 128
|
251
|
+
INS_SUBAH = 129
|
252
|
+
INS_SUBAW = 130
|
253
|
+
INS_SUBC = 131
|
254
|
+
INS_SUBU = 132
|
255
|
+
INS_SWAP4 = 133
|
256
|
+
INS_UNPKHU4 = 134
|
257
|
+
INS_UNPKLU4 = 135
|
258
|
+
INS_XOR = 136
|
259
|
+
INS_XPND2 = 137
|
260
|
+
INS_XPND4 = 138
|
261
|
+
INS_IDLE = 139
|
262
|
+
INS_MV = 140
|
263
|
+
INS_NEG = 141
|
264
|
+
INS_NOT = 142
|
265
|
+
INS_SWAP2 = 143
|
266
|
+
INS_ZERO = 144
|
267
|
+
INS_ENDING = 145
|
268
|
+
|
269
|
+
GRP_INVALID = 0
|
270
|
+
GRP_JUMP = 1
|
271
|
+
GRP_FUNIT_D = 128
|
272
|
+
GRP_FUNIT_L = 129
|
273
|
+
GRP_FUNIT_M = 130
|
274
|
+
GRP_FUNIT_S = 131
|
275
|
+
GRP_FUNIT_NO = 132
|
276
|
+
GRP_ENDING = 133
|
277
|
+
|
278
|
+
FUNIT_INVALID = 0
|
279
|
+
FUNIT_D = 1
|
280
|
+
FUNIT_L = 2
|
281
|
+
FUNIT_M = 3
|
282
|
+
FUNIT_S = 4
|
283
|
+
FUNIT_NO = 5
|
284
|
+
|
285
|
+
extend Register
|
286
|
+
end
|
287
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# THIS FILE WAS AUTO-GENERATED -- DO NOT EDIT!
|
4
|
+
|
5
|
+
require 'ffi'
|
6
|
+
|
7
|
+
require 'crabstone/arch/extension'
|
8
|
+
require_relative 'tricore_const'
|
9
|
+
|
10
|
+
module Crabstone
|
11
|
+
module TRICORE
|
12
|
+
class OperandMemory < FFI::Struct
|
13
|
+
layout(
|
14
|
+
:base, :uint8,
|
15
|
+
:disp, :int
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
class OperandValue < FFI::Union
|
20
|
+
layout(
|
21
|
+
:reg, :uint,
|
22
|
+
:imm, :int,
|
23
|
+
:mem, OperandMemory
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
class Operand < FFI::Struct
|
28
|
+
layout(
|
29
|
+
:type, :uint,
|
30
|
+
:value, OperandValue,
|
31
|
+
:access, :uint8
|
32
|
+
)
|
33
|
+
|
34
|
+
include Crabstone::Extension::Operand
|
35
|
+
|
36
|
+
def reg?
|
37
|
+
self[:type] == OP_REG
|
38
|
+
end
|
39
|
+
|
40
|
+
def imm?
|
41
|
+
self[:type] == OP_IMM
|
42
|
+
end
|
43
|
+
|
44
|
+
def mem?
|
45
|
+
self[:type] == OP_MEM
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class Instruction < FFI::Struct
|
50
|
+
layout(
|
51
|
+
:op_count, :uint8,
|
52
|
+
:operands, [Operand, 8],
|
53
|
+
:update_flags, :bool
|
54
|
+
)
|
55
|
+
|
56
|
+
include Crabstone::Extension::Instruction
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|