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,52 @@
|
|
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 'mos65xx_const'
|
9
|
+
|
10
|
+
module Crabstone
|
11
|
+
module MOS65XX
|
12
|
+
class OperandValue < FFI::Union
|
13
|
+
layout(
|
14
|
+
:reg, :uint,
|
15
|
+
:imm, :ushort,
|
16
|
+
:mem, :uint
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
class Operand < FFI::Struct
|
21
|
+
layout(
|
22
|
+
:type, :uint,
|
23
|
+
:value, OperandValue
|
24
|
+
)
|
25
|
+
|
26
|
+
include Crabstone::Extension::Operand
|
27
|
+
|
28
|
+
def reg?
|
29
|
+
self[:type] == OP_REG
|
30
|
+
end
|
31
|
+
|
32
|
+
def imm?
|
33
|
+
self[:type] == OP_IMM
|
34
|
+
end
|
35
|
+
|
36
|
+
def mem?
|
37
|
+
self[:type] == OP_MEM
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
class Instruction < FFI::Struct
|
42
|
+
layout(
|
43
|
+
:am, :uint,
|
44
|
+
:modifies_flags, :uint8,
|
45
|
+
:op_count, :uint8,
|
46
|
+
:operands, [Operand, 3]
|
47
|
+
)
|
48
|
+
|
49
|
+
include Crabstone::Extension::Instruction
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,162 @@
|
|
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 MOS65XX
|
9
|
+
REG_INVALID = 0
|
10
|
+
REG_ACC = 1
|
11
|
+
REG_X = 2
|
12
|
+
REG_Y = 3
|
13
|
+
REG_P = 4
|
14
|
+
REG_SP = 5
|
15
|
+
REG_DP = 6
|
16
|
+
REG_B = 7
|
17
|
+
REG_K = 8
|
18
|
+
REG_ENDING = 9
|
19
|
+
|
20
|
+
AM_NONE = 0
|
21
|
+
AM_IMP = 1
|
22
|
+
AM_ACC = 2
|
23
|
+
AM_IMM = 3
|
24
|
+
AM_REL = 4
|
25
|
+
AM_INT = 5
|
26
|
+
AM_BLOCK = 6
|
27
|
+
AM_ZP = 7
|
28
|
+
AM_ZP_X = 8
|
29
|
+
AM_ZP_Y = 9
|
30
|
+
AM_ZP_REL = 10
|
31
|
+
AM_ZP_IND = 11
|
32
|
+
AM_ZP_X_IND = 12
|
33
|
+
AM_ZP_IND_Y = 13
|
34
|
+
AM_ZP_IND_LONG = 14
|
35
|
+
AM_ZP_IND_LONG_Y = 15
|
36
|
+
AM_ABS = 16
|
37
|
+
AM_ABS_X = 17
|
38
|
+
AM_ABS_Y = 18
|
39
|
+
AM_ABS_IND = 19
|
40
|
+
AM_ABS_X_IND = 20
|
41
|
+
AM_ABS_IND_LONG = 21
|
42
|
+
AM_ABS_LONG = 22
|
43
|
+
AM_ABS_LONG_X = 23
|
44
|
+
AM_SR = 24
|
45
|
+
AM_SR_IND_Y = 25
|
46
|
+
|
47
|
+
INS_INVALID = 0
|
48
|
+
INS_ADC = 1
|
49
|
+
INS_AND = 2
|
50
|
+
INS_ASL = 3
|
51
|
+
INS_BBR = 4
|
52
|
+
INS_BBS = 5
|
53
|
+
INS_BCC = 6
|
54
|
+
INS_BCS = 7
|
55
|
+
INS_BEQ = 8
|
56
|
+
INS_BIT = 9
|
57
|
+
INS_BMI = 10
|
58
|
+
INS_BNE = 11
|
59
|
+
INS_BPL = 12
|
60
|
+
INS_BRA = 13
|
61
|
+
INS_BRK = 14
|
62
|
+
INS_BRL = 15
|
63
|
+
INS_BVC = 16
|
64
|
+
INS_BVS = 17
|
65
|
+
INS_CLC = 18
|
66
|
+
INS_CLD = 19
|
67
|
+
INS_CLI = 20
|
68
|
+
INS_CLV = 21
|
69
|
+
INS_CMP = 22
|
70
|
+
INS_COP = 23
|
71
|
+
INS_CPX = 24
|
72
|
+
INS_CPY = 25
|
73
|
+
INS_DEC = 26
|
74
|
+
INS_DEX = 27
|
75
|
+
INS_DEY = 28
|
76
|
+
INS_EOR = 29
|
77
|
+
INS_INC = 30
|
78
|
+
INS_INX = 31
|
79
|
+
INS_INY = 32
|
80
|
+
INS_JML = 33
|
81
|
+
INS_JMP = 34
|
82
|
+
INS_JSL = 35
|
83
|
+
INS_JSR = 36
|
84
|
+
INS_LDA = 37
|
85
|
+
INS_LDX = 38
|
86
|
+
INS_LDY = 39
|
87
|
+
INS_LSR = 40
|
88
|
+
INS_MVN = 41
|
89
|
+
INS_MVP = 42
|
90
|
+
INS_NOP = 43
|
91
|
+
INS_ORA = 44
|
92
|
+
INS_PEA = 45
|
93
|
+
INS_PEI = 46
|
94
|
+
INS_PER = 47
|
95
|
+
INS_PHA = 48
|
96
|
+
INS_PHB = 49
|
97
|
+
INS_PHD = 50
|
98
|
+
INS_PHK = 51
|
99
|
+
INS_PHP = 52
|
100
|
+
INS_PHX = 53
|
101
|
+
INS_PHY = 54
|
102
|
+
INS_PLA = 55
|
103
|
+
INS_PLB = 56
|
104
|
+
INS_PLD = 57
|
105
|
+
INS_PLP = 58
|
106
|
+
INS_PLX = 59
|
107
|
+
INS_PLY = 60
|
108
|
+
INS_REP = 61
|
109
|
+
INS_RMB = 62
|
110
|
+
INS_ROL = 63
|
111
|
+
INS_ROR = 64
|
112
|
+
INS_RTI = 65
|
113
|
+
INS_RTL = 66
|
114
|
+
INS_RTS = 67
|
115
|
+
INS_SBC = 68
|
116
|
+
INS_SEC = 69
|
117
|
+
INS_SED = 70
|
118
|
+
INS_SEI = 71
|
119
|
+
INS_SEP = 72
|
120
|
+
INS_SMB = 73
|
121
|
+
INS_STA = 74
|
122
|
+
INS_STP = 75
|
123
|
+
INS_STX = 76
|
124
|
+
INS_STY = 77
|
125
|
+
INS_STZ = 78
|
126
|
+
INS_TAX = 79
|
127
|
+
INS_TAY = 80
|
128
|
+
INS_TCD = 81
|
129
|
+
INS_TCS = 82
|
130
|
+
INS_TDC = 83
|
131
|
+
INS_TRB = 84
|
132
|
+
INS_TSB = 85
|
133
|
+
INS_TSC = 86
|
134
|
+
INS_TSX = 87
|
135
|
+
INS_TXA = 88
|
136
|
+
INS_TXS = 89
|
137
|
+
INS_TXY = 90
|
138
|
+
INS_TYA = 91
|
139
|
+
INS_TYX = 92
|
140
|
+
INS_WAI = 93
|
141
|
+
INS_WDM = 94
|
142
|
+
INS_XBA = 95
|
143
|
+
INS_XCE = 96
|
144
|
+
INS_ENDING = 97
|
145
|
+
|
146
|
+
GRP_INVALID = 0
|
147
|
+
GRP_JUMP = 1
|
148
|
+
GRP_CALL = 2
|
149
|
+
GRP_RET = 3
|
150
|
+
GRP_INT = 4
|
151
|
+
GRP_IRET = 5
|
152
|
+
GRP_BRANCH_RELATIVE = 6
|
153
|
+
GRP_ENDING = 7
|
154
|
+
|
155
|
+
OP_INVALID = 0
|
156
|
+
OP_REG = 1
|
157
|
+
OP_IMM = 2
|
158
|
+
OP_MEM = 3
|
159
|
+
|
160
|
+
extend Register
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,69 @@
|
|
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 'ppc_const'
|
9
|
+
|
10
|
+
module Crabstone
|
11
|
+
module PPC
|
12
|
+
class OperandMemory < FFI::Struct
|
13
|
+
layout(
|
14
|
+
:base, :uint,
|
15
|
+
:disp, :int
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
class OperandCrx < FFI::Struct
|
20
|
+
layout(
|
21
|
+
:scale, :uint,
|
22
|
+
:reg, :uint,
|
23
|
+
:cond, :uint
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
class OperandValue < FFI::Union
|
28
|
+
layout(
|
29
|
+
:reg, :uint,
|
30
|
+
:imm, :long,
|
31
|
+
:mem, OperandMemory,
|
32
|
+
:crx, OperandCrx
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
class Operand < FFI::Struct
|
37
|
+
layout(
|
38
|
+
:type, :uint,
|
39
|
+
:value, OperandValue
|
40
|
+
)
|
41
|
+
|
42
|
+
include Crabstone::Extension::Operand
|
43
|
+
|
44
|
+
def reg?
|
45
|
+
self[:type] == OP_REG
|
46
|
+
end
|
47
|
+
|
48
|
+
def imm?
|
49
|
+
self[:type] == OP_IMM
|
50
|
+
end
|
51
|
+
|
52
|
+
def mem?
|
53
|
+
self[:type] == OP_MEM
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class Instruction < FFI::Struct
|
58
|
+
layout(
|
59
|
+
:bc, :uint,
|
60
|
+
:bh, :uint,
|
61
|
+
:update_cr0, :bool,
|
62
|
+
:op_count, :uint8,
|
63
|
+
:operands, [Operand, 8]
|
64
|
+
)
|
65
|
+
|
66
|
+
include Crabstone::Extension::Instruction
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|