1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
/* Generated code; do not edit!
generated by tables/gen.js from imaon2 'f0e220720bbfb8f8e00e76af56806a28fc8739a2'
https://github.com/comex/imaon2
arguments: '--gen-hook-disassembler --dis-pattern=P(XXX) out/out-AArch64.json'
(fair warning: at present the main (Rust) code in that repository is barely
started, embarrassingly so; no need to look at it ;p)
In case it's copyrightable in any way, consider the generated code in the
public domain.
*/
/* adrlabel_label_unk_Xd_1_ADR: ADR */
/* adrplabel_label_unk_Xd_1_ADRP: ADRP */
/* am_b_target_addr_B_1_B: B */
/* am_bl_target_addr_1_BL: BL */
/* GPR64_Rn_2_BLR: BLR, RET */
/* ccode_cond_am_brcond_target_B_1_Bcc: Bcc */
/* am_brcond_target_B_4_CBNZW: CBNZW, CBNZX, CBZW, CBZX */
/* am_ldrlit_label_unk_Rt_6_LDRDl: LDRDl, LDRQl, LDRSWl, LDRSl, LDRWl, LDRXl */
/* am_tbrcond_target_B_4_TBNZW: TBNZW, TBNZX, TBZW, TBZX */
switch ((op >> 29) & 0x7) {
case 0: {
switch ((op >> 26) & 0x3) {
case 0: {
if ((op & 0x9f000000) == 0x10000000) {
insn_adrlabel_label_unk_Xd_1_ADR:;
struct bitslice Xd = {.nruns = 1, .runs = (struct bitslice_run[]) {{0,0,5}}};
struct bitslice label = {.nruns = 2, .runs = (struct bitslice_run[]) {{5,2,19}, {29,0,2}}};
return P(adrlabel_label_unk_Xd_1_ADR)(ctx, Xd, label); /* 0x10000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 1: {
if ((op & 0xfc000000) == 0x14000000) {
struct bitslice addr = {.nruns = 1, .runs = (struct bitslice_run[]) {{0,0,26}}};
return P(am_b_target_addr_B_1_B)(ctx, addr); /* 0x14000000 | 0x03ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 2:
case 3: {
if ((op & 0xbb000000) == 0x18000000) {
insn_am_ldrlit_label_unk_Rt_6_LDRDl:;
struct bitslice Rt = {.nruns = 1, .runs = (struct bitslice_run[]) {{0,0,5}}};
struct bitslice label = {.nruns = 1, .runs = (struct bitslice_run[]) {{5,0,19}}};
return P(am_ldrlit_label_unk_Rt_6_LDRDl)(ctx, Rt, label); /* 0x18000000 | 0x44ffffff */
} else {
return P(unidentified)(ctx);
}
}
}
}
case 1: {
switch ((op >> 25) & 0x3) {
case 0: {
if ((op & 0x9f000000) == 0x10000000) {
goto insn_adrlabel_label_unk_Xd_1_ADR; /* 0x10000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 1:
return P(unidentified)(ctx);
case 2: {
if ((op & 0x7e000000) == 0x34000000) {
insn_am_brcond_target_B_4_CBNZW:;
struct bitslice target = {.nruns = 1, .runs = (struct bitslice_run[]) {{5,0,19}}};
return P(am_brcond_target_B_4_CBNZW)(ctx, target); /* 0x34000000 | 0x81ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 3: {
if ((op & 0x7e000000) == 0x36000000) {
insn_am_tbrcond_target_B_4_TBNZW:;
struct bitslice target = {.nruns = 1, .runs = (struct bitslice_run[]) {{5,0,14}}};
return P(am_tbrcond_target_B_4_TBNZW)(ctx, target); /* 0x36000000 | 0x81ffffff */
} else {
return P(unidentified)(ctx);
}
}
}
}
case 2: {
switch ((op >> 26) & 0x3) {
case 0: {
if ((op & 0x9f000000) == 0x10000000) {
goto insn_adrlabel_label_unk_Xd_1_ADR; /* 0x10000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 1: {
if ((op & 0xff000010) == 0x54000000) {
struct bitslice cond = {.nruns = 1, .runs = (struct bitslice_run[]) {{0,0,4}}};
struct bitslice target = {.nruns = 1, .runs = (struct bitslice_run[]) {{5,0,19}}};
return P(ccode_cond_am_brcond_target_B_1_Bcc)(ctx, cond, target); /* 0x54000000 | 0x00ffffef */
} else {
return P(unidentified)(ctx);
}
}
case 2:
case 3: {
if ((op & 0xbb000000) == 0x18000000) {
goto insn_am_ldrlit_label_unk_Rt_6_LDRDl; /* 0x18000000 | 0x44ffffff */
} else {
return P(unidentified)(ctx);
}
}
}
}
case 3: {
if ((op & 0x9f000000) == 0x10000000) {
goto insn_adrlabel_label_unk_Xd_1_ADR; /* 0x10000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 4: {
switch ((op >> 26) & 0x3) {
case 0: {
if ((op & 0x9f000000) == 0x90000000) {
insn_adrplabel_label_unk_Xd_1_ADRP:;
struct bitslice Xd = {.nruns = 1, .runs = (struct bitslice_run[]) {{0,0,5}}};
struct bitslice label = {.nruns = 2, .runs = (struct bitslice_run[]) {{5,2,19}, {29,0,2}}};
return P(adrplabel_label_unk_Xd_1_ADRP)(ctx, Xd, label); /* 0x90000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 1: {
if ((op & 0xfc000000) == 0x94000000) {
struct bitslice addr = {.nruns = 1, .runs = (struct bitslice_run[]) {{0,0,26}}};
return P(am_bl_target_addr_1_BL)(ctx, addr); /* 0x94000000 | 0x03ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 2:
case 3: {
if ((op & 0xfb000000) == 0x98000000) {
goto insn_am_ldrlit_label_unk_Rt_6_LDRDl; /* 0x98000000 | 0x04ffffff */
} else {
return P(unidentified)(ctx);
}
}
}
}
case 5: {
switch ((op >> 25) & 0x3) {
case 0: {
if ((op & 0x9f000000) == 0x90000000) {
goto insn_adrplabel_label_unk_Xd_1_ADRP; /* 0x90000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 1:
return P(unidentified)(ctx);
case 2: {
if ((op & 0x7e000000) == 0x34000000) {
goto insn_am_brcond_target_B_4_CBNZW; /* 0x34000000 | 0x81ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 3: {
if ((op & 0x7e000000) == 0x36000000) {
goto insn_am_tbrcond_target_B_4_TBNZW; /* 0x36000000 | 0x81ffffff */
} else {
return P(unidentified)(ctx);
}
}
}
}
case 6: {
switch ((op >> 22) & 0xf) {
case 0:
case 1:
case 2:
case 3: {
if ((op & 0x9f000000) == 0x90000000) {
goto insn_adrplabel_label_unk_Xd_1_ADRP; /* 0x90000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
case 4:
case 5:
case 6:
case 7:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
return P(unidentified)(ctx);
case 8: {
if ((op & 0xfffffc1f) == 0xd63f0000) {
insn_GPR64_Rn_2_BLR:;
struct bitslice Rn = {.nruns = 1, .runs = (struct bitslice_run[]) {{5,0,5}}};
return P(GPR64_Rn_2_BLR)(ctx, Rn); /* 0xd63f0000 | 0x000003e0 */
} else {
return P(unidentified)(ctx);
}
}
case 9: {
if ((op & 0xfffffc1f) == 0xd65f0000) {
goto insn_GPR64_Rn_2_BLR; /* 0xd65f0000 | 0x000003e0 */
} else {
return P(unidentified)(ctx);
}
}
}
}
case 7: {
if ((op & 0x9f000000) == 0x90000000) {
goto insn_adrplabel_label_unk_Xd_1_ADRP; /* 0x90000000 | 0x60ffffff */
} else {
return P(unidentified)(ctx);
}
}
}
/*
static INLINE tdis_ret P(GPR64_Rn_2_BLR)(struct bitslice ctx, struct bitslice Rn) {}
static INLINE tdis_ret P(adrlabel_label_unk_Xd_1_ADR)(struct bitslice ctx, struct bitslice Xd, struct bitslice label) {}
static INLINE tdis_ret P(adrplabel_label_unk_Xd_1_ADRP)(struct bitslice ctx, struct bitslice Xd, struct bitslice label) {}
static INLINE tdis_ret P(am_b_target_addr_B_1_B)(struct bitslice ctx, struct bitslice addr) {}
static INLINE tdis_ret P(am_bl_target_addr_1_BL)(struct bitslice ctx, struct bitslice addr) {}
static INLINE tdis_ret P(am_brcond_target_B_4_CBNZW)(struct bitslice ctx, struct bitslice target) {}
static INLINE tdis_ret P(am_ldrlit_label_unk_Rt_6_LDRDl)(struct bitslice ctx, struct bitslice Rt, struct bitslice label) {}
static INLINE tdis_ret P(am_tbrcond_target_B_4_TBNZW)(struct bitslice ctx, struct bitslice target) {}
static INLINE tdis_ret P(ccode_cond_am_brcond_target_B_1_Bcc)(struct bitslice ctx, struct bitslice cond, struct bitslice target) {}
*/
|