Rizin
unix-like reverse engineering framework and cli tools
mdmp_windefs.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2016 Davis
2 // SPDX-FileCopyrightText: 2016 Alex Kornitzer <alex.kornitzer@countercept.com>
3 // SPDX-License-Identifier: LGPL-3.0-only
4 
5 #ifndef MDMP_WINDEFS_H
6 #define MDMP_WINDEFS_H
7 
8 #define EXCEPTION_MAXIMUM_PARAMETERS 15
9 
10 #define MAXIMUM_SUPPORTED_EXTENSION 512
11 
12 #define SIZE_OF_80387_REGISTERS 80
13 
14 #define ARM_MAX_BREAKPOINTS 8
15 #define ARM_MAX_WATCHPOINTS 1
16 #define ARM64_MAX_BREAKPOINTS 8
17 #define ARM64_MAX_WATCHPOINTS 2
18 
20  struct windows_floating_save_area {
21  ut32 control_word;
22  ut32 status_word;
23  ut32 tag_word;
24  ut32 error_offset;
25  ut32 error_selector;
26  ut32 data_offset;
27  ut32 data_selector;
28  ut8 register_area[SIZE_OF_80387_REGISTERS];
29  ut32 spare_0;
30  });
31 
33  struct windows_systemtime {
34  ut16 w_year;
35  ut16 w_month;
36  ut16 w_day_of_week;
37  ut16 w_day;
38  ut16 w_hour;
39  ut16 w_minute;
40  ut16 w_second;
41  ut16 w_milliseconds;
42  });
43 
45  struct windows_timezone_information {
46  ut32 bias;
47  ut16 standard_name[32];
48  struct windows_systemtime standard_date;
49  ut32 standard_bias;
50  ut16 daylight_name[32];
51  struct windows_systemtime daylight_date;
52  ut32 daylight_bias;
53  });
54 
56  struct windows_m128a {
57  ut64 low;
58  st64 high;
59  });
60 
62  struct windows_neon128 {
63  ut64 low;
64  st64 high;
65  });
66 
68  struct windows_float128 {
69  ut64 low;
70  st64 high;
71  });
72 
74  struct context_type_i386 {
75  ut32 context_flags;
76 
77  ut32 dr0;
78  ut32 dr1;
79  ut32 dr2;
80  ut32 dr3;
81  ut32 dr6;
82  ut32 dr7;
83 
84  struct windows_floating_save_area float_save;
85 
86  ut32 seg_gs;
87  ut32 seg_fs;
88  ut32 seg_es;
89  ut32 seg_ds;
90 
91  ut32 edi;
92  ut32 esi;
93  ut32 ebx;
94  ut32 edx;
95  ut32 ecx;
96  ut32 eax;
97 
98  ut32 ebp;
99  ut32 eip;
100  ut32 seg_cs;
101  ut32 e_flags;
102  ut32 esp;
103  ut32 seg_ss;
104 
105  ut8 extended_registers[MAXIMUM_SUPPORTED_EXTENSION];
106  });
107 
109  struct context_type_ia64 {
110  ut32 context_flags;
111  ut32 fill_1[3];
112 
113  ut64 db_i0;
114  ut64 db_i1;
115  ut64 db_i2;
116  ut64 db_i3;
117  ut64 db_i4;
118  ut64 db_i5;
119  ut64 db_i6;
120  ut64 db_i7;
121 
122  ut64 db_d0;
123  ut64 db_d1;
124  ut64 db_d2;
125  ut64 db_d3;
126  ut64 db_d4;
127  ut64 db_d5;
128  ut64 db_d6;
129  ut64 db_d7;
130 
131  struct windows_float128 flt_s0;
132  struct windows_float128 flt_s1;
133  struct windows_float128 flt_s2;
134  struct windows_float128 flt_s3;
135  struct windows_float128 flt_t0;
136  struct windows_float128 flt_t1;
137  struct windows_float128 flt_t2;
138  struct windows_float128 flt_t3;
139  struct windows_float128 flt_t4;
140  struct windows_float128 flt_t5;
141  struct windows_float128 flt_t6;
142  struct windows_float128 flt_t7;
143  struct windows_float128 flt_t8;
144  struct windows_float128 flt_t9;
145 
146  struct windows_float128 flt_s4;
147  struct windows_float128 flt_s5;
148  struct windows_float128 flt_s6;
149  struct windows_float128 flt_s7;
150  struct windows_float128 flt_s8;
151  struct windows_float128 flt_s9;
152  struct windows_float128 flt_s10;
153  struct windows_float128 flt_s11;
154  struct windows_float128 flt_s12;
155  struct windows_float128 flt_s13;
156  struct windows_float128 flt_s14;
157  struct windows_float128 flt_s15;
158  struct windows_float128 flt_s16;
159  struct windows_float128 flt_s17;
160  struct windows_float128 flt_s18;
161  struct windows_float128 flt_s19;
162 
163  struct windows_float128 flt_f32;
164  struct windows_float128 flt_f33;
165  struct windows_float128 flt_f34;
166  struct windows_float128 flt_f35;
167  struct windows_float128 flt_f36;
168  struct windows_float128 flt_f37;
169  struct windows_float128 flt_f38;
170  struct windows_float128 flt_f39;
171 
172  struct windows_float128 flt_f40;
173  struct windows_float128 flt_f41;
174  struct windows_float128 flt_f42;
175  struct windows_float128 flt_f43;
176  struct windows_float128 flt_f44;
177  struct windows_float128 flt_f45;
178  struct windows_float128 flt_f46;
179  struct windows_float128 flt_f47;
180  struct windows_float128 flt_f48;
181  struct windows_float128 flt_f49;
182 
183  struct windows_float128 flt_f50;
184  struct windows_float128 flt_f51;
185  struct windows_float128 flt_f52;
186  struct windows_float128 flt_f53;
187  struct windows_float128 flt_f54;
188  struct windows_float128 flt_f55;
189  struct windows_float128 flt_f56;
190  struct windows_float128 flt_f57;
191  struct windows_float128 flt_f58;
192  struct windows_float128 flt_f59;
193 
194  struct windows_float128 flt_f60;
195  struct windows_float128 flt_f61;
196  struct windows_float128 flt_f62;
197  struct windows_float128 flt_f63;
198  struct windows_float128 flt_f64;
199  struct windows_float128 flt_f65;
200  struct windows_float128 flt_f66;
201  struct windows_float128 flt_f67;
202  struct windows_float128 flt_f68;
203  struct windows_float128 flt_f69;
204 
205  struct windows_float128 flt_f70;
206  struct windows_float128 flt_f71;
207  struct windows_float128 flt_f72;
208  struct windows_float128 flt_f73;
209  struct windows_float128 flt_f74;
210  struct windows_float128 flt_f75;
211  struct windows_float128 flt_f76;
212  struct windows_float128 flt_f77;
213  struct windows_float128 flt_f78;
214  struct windows_float128 flt_f79;
215 
216  struct windows_float128 flt_f80;
217  struct windows_float128 flt_f81;
218  struct windows_float128 flt_f82;
219  struct windows_float128 flt_f83;
220  struct windows_float128 flt_f84;
221  struct windows_float128 flt_f85;
222  struct windows_float128 flt_f86;
223  struct windows_float128 flt_f87;
224  struct windows_float128 flt_f88;
225  struct windows_float128 flt_f89;
226 
227  struct windows_float128 flt_f90;
228  struct windows_float128 flt_f91;
229  struct windows_float128 flt_f92;
230  struct windows_float128 flt_f93;
231  struct windows_float128 flt_f94;
232  struct windows_float128 flt_f95;
233  struct windows_float128 flt_f96;
234  struct windows_float128 flt_f97;
235  struct windows_float128 flt_f98;
236  struct windows_float128 flt_f99;
237 
238  struct windows_float128 flt_f100;
239  struct windows_float128 flt_f101;
240  struct windows_float128 flt_f102;
241  struct windows_float128 flt_f103;
242  struct windows_float128 flt_f104;
243  struct windows_float128 flt_f105;
244  struct windows_float128 flt_f106;
245  struct windows_float128 flt_f107;
246  struct windows_float128 flt_f108;
247  struct windows_float128 flt_f109;
248 
249  struct windows_float128 flt_f110;
250  struct windows_float128 flt_f111;
251  struct windows_float128 flt_f112;
252  struct windows_float128 flt_f113;
253  struct windows_float128 flt_f114;
254  struct windows_float128 flt_f115;
255  struct windows_float128 flt_f116;
256  struct windows_float128 flt_f117;
257  struct windows_float128 flt_f118;
258  struct windows_float128 flt_f119;
259 
260  struct windows_float128 flt_f120;
261  struct windows_float128 flt_f121;
262  struct windows_float128 flt_f122;
263  struct windows_float128 flt_f123;
264  struct windows_float128 flt_f124;
265  struct windows_float128 flt_f125;
266  struct windows_float128 flt_f126;
267  struct windows_float128 flt_f127;
268 
269  ut64 st_fpsr;
270 
271  ut64 int_gp;
272  ut64 int_t0;
273  ut64 int_t1;
274  ut64 int_s0;
275  ut64 int_s1;
276  ut64 int_s2;
277  ut64 int_s3;
278  ut64 int_v0;
279  ut64 int_t2;
280  ut64 int_t3;
281  ut64 int_t4;
282  ut64 int_sp;
283  ut64 int_teb;
284  ut64 int_t5;
285  ut64 int_t6;
286  ut64 int_t7;
287  ut64 int_t8;
288  ut64 int_t9;
289  ut64 int_t10;
290  ut64 int_t11;
291  ut64 int_t12;
292  ut64 int_t13;
293  ut64 int_t14;
294  ut64 int_t15;
295  ut64 int_t16;
296  ut64 int_t17;
297  ut64 int_t18;
298  ut64 int_t19;
299  ut64 int_t20;
300  ut64 int_t21;
301  ut64 int_t22;
302 
303  ut64 int_nats;
304 
305  ut64 preds;
306 
307  ut64 br_rp;
308  ut64 br_s0;
309  ut64 br_s1;
310  ut64 br_s2;
311  ut64 br_s3;
312  ut64 br_s4;
313  ut64 br_t0;
314  ut64 br_t1;
315 
316  ut64 ap_unat;
317  ut64 ap_lc;
318  ut64 ap_ec;
319  ut64 ap_ccv;
320  ut64 ap_dcr;
321 
322  ut64 rs_pfs;
323  ut64 rs_bsp;
324  ut64 rs_bspstore;
325  ut64 rs_rsc;
326  ut64 rs_rnat;
327 
328  ut64 st_ipsr;
329  ut64 st_iip;
330  ut64 st_ifs;
331 
332  ut64 st_fcr;
333  ut64 eflag;
334  ut64 seg_csd;
335  ut64 seg_ssd;
336  ut64 cflag;
337  ut64 st_fsr;
338  ut64 st_fir;
339  ut64 st_fdr;
340 
341  ut64 unusedpack;
342  });
343 
345  struct context_type_arm {
346  ut32 context_flags;
347 
348  ut32 r0;
349  ut32 r1;
350  ut32 r2;
351  ut32 r3;
352  ut32 r4;
353  ut32 r5;
354  ut32 r6;
355  ut32 r7;
356  ut32 r8;
357  ut32 r9;
358  ut32 r10;
359  ut32 r11;
360  ut32 r12;
361 
362  ut32 sp;
363  ut32 lr;
364  ut32 pc;
365  ut32 cpsr;
366 
367  ut32 fpscr;
368  ut32 padding;
369  union {
370  struct windows_neon128 q[16];
371  ut64 d[32];
372  ut32 s[32];
373  };
374 
379  ut32 padding_2[2];
380  });
381 
383  struct windows_xsave_format32 {
384  ut16 control_word;
385  ut16 status_word;
386  ut8 tag_word;
387  ut8 reserved_1;
388  ut16 error_opcode;
389  ut32 error_offset;
390  ut16 error_selector;
391  ut16 reserved_2;
392  ut32 data_offset;
393  ut16 data_selector;
394  ut16 reserved3;
395  ut32 mx_csr;
396  ut32 mx_csr_mask;
397  struct windows_m128a float_registers[8];
398  struct windows_m128a xmm_registers[8];
399  ut8 reserved_4[224];
400  });
401 
409 
412 
420 
427 
444 
446 
447  union {
448  struct windows_xsave_format32 flt_save;
449  struct {
450  struct windows_m128a header[2];
451  struct windows_m128a legacy[8];
452  struct windows_m128a xmm_0;
453  struct windows_m128a xmm_1;
454  struct windows_m128a xmm_2;
455  struct windows_m128a xmm_3;
456  struct windows_m128a xmm_4;
457  struct windows_m128a xmm_5;
458  struct windows_m128a xmm_6;
459  struct windows_m128a xmm_7;
460  struct windows_m128a xmm_8;
461  struct windows_m128a xmm_9;
462  struct windows_m128a xmm_10;
463  struct windows_m128a xmm_11;
464  struct windows_m128a xmm_12;
465  struct windows_m128a xmm_13;
466  struct windows_m128a xmm_14;
467  struct windows_m128a xmm_15;
468  };
469  };
470 
471  struct windows_m128a vector_register[26];
473 
479 };
480 
482  struct windows_exception_record32 {
483  ut32 exception_code;
484  ut32 exception_flags;
485  struct windows_exception_record32 *exception_record;
486  ut32 exception_address;
487  ut32 number_parameters;
488  ut32 exception_information[EXCEPTION_MAXIMUM_PARAMETERS];
489  });
490 
492  struct windows_exception_record64 {
493  ut32 exception_code;
494  ut32 exception_flags;
495  ut64 exception_record;
496  ut64 exception_address;
497  ut32 number_parameters;
498  ut32 __unusedAlignment;
499  ut64 exception_information[EXCEPTION_MAXIMUM_PARAMETERS];
500  });
501 
503  struct exception_pointers_i386 {
504  struct windows_exception_record32 *exception_record;
505  void /*struct context*/ *context_record;
506  });
507 
509 
510  //
511  // Control flags.
512  //
513 
514  /* +0x000 */ ut32 ContextFlags;
515 
516  //
517  // Integer registers
518  //
519 
520  /* +0x004 */ ut32 Cpsr; // NZVF + DAIF + CurrentEL + SPSel
521  /* +0x008 */ union {
522  struct {
552  /* +0x0f0 */ ut64 Fp;
553  /* +0x0f8 */ ut64 Lr;
554  };
555  ut64 X[31];
556  };
557  /* +0x100 */ ut64 Sp;
558  /* +0x108 */ ut64 Pc;
559 
560  //
561  // Floating Point/NEON Registers
562  //
563 
564  /* +0x110 */ struct windows_neon128 V[32];
565  /* +0x310 */ ut32 Fpcr;
566  /* +0x314 */ ut32 Fpsr;
567 
568  //
569  // Debug registers
570  //
571 
576  /* +0x390 */
577 };
578 
579 #endif /* MDMP_WINDEFS_H */
esi
r3
Definition: arm-aliases.s.cs:3
r2
Definition: arm-aliases.s.cs:2
uint16_t ut16
uint32_t ut32
uint8_t ut8
Definition: lh5801.h:11
#define ARM_MAX_WATCHPOINTS
Definition: mdmp_windefs.h:15
#define EXCEPTION_MAXIMUM_PARAMETERS
Definition: mdmp_windefs.h:8
#define ARM64_MAX_WATCHPOINTS
Definition: mdmp_windefs.h:17
#define ARM_MAX_BREAKPOINTS
Definition: mdmp_windefs.h:14
#define MAXIMUM_SUPPORTED_EXTENSION
Definition: mdmp_windefs.h:10
#define ARM64_MAX_BREAKPOINTS
Definition: mdmp_windefs.h:16
RZ_PACKED(struct windows_floating_save_area { ut32 control_word;ut32 status_word;ut32 tag_word;ut32 error_offset;ut32 error_selector;ut32 data_offset;ut32 data_selector;ut8 register_area[SIZE_OF_80387_REGISTERS];ut32 spare_0;})
#define SIZE_OF_80387_REGISTERS
Definition: mdmp_windefs.h:12
static RzSocket * s
Definition: rtr.c:28
#define st64
Definition: rz_types_base.h:10
#define d(i)
Definition: sha256.c:44
struct windows_m128a xmm_1
Definition: mdmp_windefs.h:453
struct windows_m128a xmm_11
Definition: mdmp_windefs.h:463
struct windows_m128a vector_register[26]
Definition: mdmp_windefs.h:471
struct windows_m128a xmm_0
Definition: mdmp_windefs.h:452
struct windows_m128a xmm_7
Definition: mdmp_windefs.h:459
struct windows_m128a xmm_9
Definition: mdmp_windefs.h:461
struct windows_m128a xmm_12
Definition: mdmp_windefs.h:464
struct windows_m128a xmm_4
Definition: mdmp_windefs.h:456
struct windows_m128a xmm_2
Definition: mdmp_windefs.h:454
struct windows_m128a xmm_14
Definition: mdmp_windefs.h:466
struct windows_m128a xmm_8
Definition: mdmp_windefs.h:460
struct windows_m128a xmm_10
Definition: mdmp_windefs.h:462
struct windows_m128a xmm_3
Definition: mdmp_windefs.h:455
struct windows_m128a xmm_6
Definition: mdmp_windefs.h:458
struct windows_m128a xmm_13
Definition: mdmp_windefs.h:465
struct windows_m128a xmm_15
Definition: mdmp_windefs.h:467
struct windows_m128a header[2]
Definition: mdmp_windefs.h:450
struct windows_m128a xmm_5
Definition: mdmp_windefs.h:457
struct windows_m128a legacy[8]
Definition: mdmp_windefs.h:451
struct windows_xsave_format32 flt_save
Definition: mdmp_windefs.h:448
ut32 Wcr[ARM64_MAX_WATCHPOINTS]
Definition: mdmp_windefs.h:574
ut64 Bvr[ARM64_MAX_BREAKPOINTS]
Definition: mdmp_windefs.h:573
ut32 Bcr[ARM64_MAX_BREAKPOINTS]
Definition: mdmp_windefs.h:572
ut64 Wvr[ARM64_MAX_WATCHPOINTS]
Definition: mdmp_windefs.h:575
struct windows_neon128 V[32]
Definition: mdmp_windefs.h:564
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
eax
Definition: x86-32-avx.s.cs:79
ecx
Definition: x86-32-avx.s.cs:85
ebx
Definition: x86-32-avx.s.cs:85
static int sp
Definition: z80asm.c:91