-
Notifications
You must be signed in to change notification settings - Fork 9
/
instruction_defs.h
248 lines (225 loc) · 6.28 KB
/
instruction_defs.h
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
238
239
240
241
242
243
244
245
246
247
248
#ifndef INSTRUCTION_DEFS_H_
#define INSTRUCTION_DEFS_H_
#include "emulator.h"
#include "modrm.h"
/* 0x00 */
void add_rm8_r8(Emulator *emu);
void add_rm32_r32(Emulator *emu);
void add_r8_rm8(Emulator *emu);
void add_r32_rm32(Emulator *emu);
void add_al_imm8(Emulator *emu);
void add_eax_imm32(Emulator *emu);
void push_es(Emulator *emu);
void pop_es(Emulator *emu);
void or_rm8_r8(Emulator *emu);
void or_rm32_r32(Emulator *emu);
void or_r8_rm8(Emulator *emu);
void or_r32_rm32(Emulator *emu);
void or_al_imm8(Emulator *emu);
void or_eax_imm32(Emulator *emu);
void push_cs(Emulator *emu);
/* 0x10 */
void adc_rm8_r8(Emulator *emu);
void adc_rm32_r32(Emulator *emu);
void adc_r8_rm8(Emulator *emu);
void adc_r32_rm32(Emulator *emu);
void adc_al_imm8(Emulator *emu);
void adc_eax_imm32(Emulator *emu);
void push_ss(Emulator *emu);
void pop_ss(Emulator *emu);
void sbb_rm8_r8(Emulator *emu);
void sbb_rm32_r32(Emulator *emu);
void sbb_r8_rm8(Emulator *emu);
void sbb_r32_rm32(Emulator *emu);
void sbb_al_imm8(Emulator *emu);
void sbb_eax_imm32(Emulator *emu);
void push_ds(Emulator *emu);
void pop_ds(Emulator *emu);
/* 0x20 */
void and_rm8_r8(Emulator *emu);
void and_rm32_r32(Emulator *emu);
void and_r8_rm8(Emulator *emu);
void and_r32_rm32(Emulator *emu);
void and_al_imm8(Emulator *emu);
void and_eax_imm32(Emulator *emu);
/* 26 ES override prefix */
/* 27 DAA Adjusts two packed BCD values. */
void sub_rm8_r8(Emulator *emu);
void sub_rm32_r32(Emulator *emu);
void sub_r8_rm8(Emulator *emu);
void sub_r32_rm32(Emulator *emu);
void sub_al_imm8(Emulator *emu);
void sub_eax_imm32(Emulator *emu);
/* 2E CS override prefix */
/* 0x30 */
void xor_rm8_r8(Emulator *emu);
void xor_rm32_r32(Emulator *emu);
void xor_r8_rm8(Emulator *emu);
void xor_r32_rm32(Emulator *emu);
void xor_al_imm8(Emulator *emu);
void xor_eax_imm32(Emulator *emu);
void cmp_rm8_r8(Emulator *emu);
void cmp_rm32_r32(Emulator *emu);
void cmp_r8_rm8(Emulator *emu);
void cmp_r32_rm32(Emulator *emu);
void cmp_al_imm8(Emulator *emu);
void cmp_eax_imm32(Emulator *emu);
/* 0x40 */
void inc_r32(Emulator *emu);
void dec_r32(Emulator *emu);
/* 0x50 */
void push_r32(Emulator *emu);
void pop_r32(Emulator *emu);
/* 0x60 */
void pushad(Emulator *emu);
void popad(Emulator *emu);
void push_imm32(Emulator *emu);
void push_imm8(Emulator *emu);
void imul_r32_rm32_imm8(Emulator *emu);
void imul_r32_rm32_imm32(Emulator *emu);
void ins_m32_dx(Emulator *emu);
/* 0x70 */
void jo(Emulator *emu);
void jno(Emulator *emu);
void jc(Emulator *emu);
void jnc(Emulator *emu);
void jz(Emulator *emu);
void jnz(Emulator *emu);
void jna(Emulator *emu);
void ja(Emulator *emu);
void js(Emulator *emu);
void jns(Emulator *emu);
void jl(Emulator *emu);
void jge(Emulator *emu);
void jle(Emulator *emu);
void jg(Emulator *emu);
/* 0x80 */
void code_80(Emulator *emu);
void code_81(Emulator *emu);
void code_83(Emulator *emu);
void code_83_rm16(Emulator *emu);
void test_rm8_r8(Emulator *emu);
void test_rm16_r16(Emulator *emu);
void test_rm32_r32(Emulator *emu);
void xchg_rm8_r8(Emulator *emu);
void xchg_rm32_r32(Emulator *emu);
void mov_rm8_r8(Emulator *emu);
void mov_rm32_r32(Emulator *emu);
void mov_rm16_r16(Emulator *emu);
void mov_r8_rm8(Emulator *emu);
void mov_r32_rm32(Emulator *emu);
void mov_rm32_seg(Emulator *emu);
void lea_r32_m(Emulator *emu);
void mov_seg_rm32(Emulator *emu);
void pop_rm32(Emulator *emu);
/* 0x90 */
void xchg_r32_r32(Emulator *emu);
void xchg_r16_r16(Emulator *emu);
void cwde(Emulator *emu);
void cdq(Emulator *emu);
void ptr_call(Emulator *emu);
void pushfd(Emulator *emu);
void popfd(Emulator *emu);
void sahf(Emulator *emu);
void lahf(Emulator *emu);
/* 0xA0 */
void mov_al_moffs8(Emulator *emu);
void mov_eax_moffs32(Emulator *emu);
void mov_moffs8_al(Emulator *emu);
void mov_moffs16_ax(Emulator *emu);
void mov_moffs32_eax(Emulator *emu);
void movsb(Emulator *emu);
void movsd(Emulator *emu);
void cmpsb(Emulator *emu);
void cmpsd(Emulator *emu);
void test_al_imm8(Emulator *emu);
void test_eax_imm32(Emulator *emu);
void stosb(Emulator *emu);
void stosd(Emulator *emu);
void lodsb(Emulator *emu);
void lodsd(Emulator *emu);
void scasb(Emulator *emu);
void scasd(Emulator *emu);
/* 0xB0 */
void mov_r8_imm8(Emulator *emu);
void mov_r32_imm32(Emulator *emu);
void mov_r16_imm16(Emulator *emu);
/* 0xC0 */
void code_c0(Emulator *emu);
void code_c01(Emulator *emu);
void ret(Emulator *emu);
void les(Emulator *emu);
void lds(Emulator *emu);
void mov_rm8_imm8(Emulator *emu);
void mov_rm16_imm16(Emulator *emu);
void mov_rm32_imm32(Emulator *emu);
void leave(Emulator *emu);
void ret_far(Emulator *emu);
void int_imm8(Emulator *emu);
void iret(Emulator *emu);
/* 0xD0 */
void code_d0(Emulator *emu);
void code_d1(Emulator *emu);
void code_d2(Emulator *emu);
void code_d3(Emulator *emu);
void set_al_on_carry(Emulator *emu);
/* 0xE0 */
void loopnz(Emulator *emu);
void loopz(Emulator *emu);
void loop(Emulator *emu);
void jecxz(Emulator *emu);
void in_al_imm8(Emulator *emu);
void in_eax_imm8(Emulator *emu);
void out_imm8_al(Emulator *emu);
void out_imm8_eax(Emulator *emu);
void call_rel32(Emulator *emu);
void near_jump(Emulator *emu);
void ptr_jump(Emulator *emu);
void short_jump(Emulator *emu);
void in_al_dx(Emulator *emu);
void in_eax_dx(Emulator *emu);
void out_dx_al(Emulator *emu);
void out_dx_eax(Emulator *emu);
/* 0xF0 */
void cmc(Emulator *emu);
void code_f6(Emulator *emu);
void code_f7(Emulator *emu);
void clc(Emulator *emu);
void stc(Emulator *emu);
void cli(Emulator *emu);
void sti(Emulator *emu);
void cld(Emulator *emu);
void std(Emulator *emu);
void code_fe(Emulator *emu);
void code_ff(Emulator *emu);
/* 0x0F00 */
void code_0f_00(Emulator *emu);
void code_0f_01(Emulator *emu);
void push_fs(Emulator *emu);
void pop_fs(Emulator *emu);
void push_gs(Emulator *emu);
void pop_gs(Emulator *emu);
/* 0x0F20 */
void mov_r32_cr(Emulator *emu);
void mov_cr_r32(Emulator *emu);
/* 0x0F80 */
void jc32(Emulator *emu);
void jnc32(Emulator *emu);
void jz32(Emulator *emu);
void jnz32(Emulator *emu);
void jna32(Emulator *emu);
void ja32(Emulator *emu);
void js32(Emulator *emu);
void jns32(Emulator *emu);
void jge32(Emulator *emu);
void jng32(Emulator *emu);
void jg32(Emulator *emu);
/* 0x0F90 */
void sete(Emulator *emu);
void setne(Emulator *emu);
/* 0x0FB0 */
void movzx_r32_rm8(Emulator *emu);
void movzx_r32_rm16(Emulator *emu);
void movsx_r32_rm8(Emulator *emu);
void movsx_r32_rm16(Emulator *emu);
#endif