1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define DOS_MAGIC 0x5a4d
19 uint16_t reserved1
[4];
22 uint16_t reserved2
[10];
26 #define MACHINE_TYPE_X86 0x014c
27 #define MACHINE_TYPE_X64 0x8664
28 #define MACHINE_TYPE_ARM64 0xAA64
32 uint16_t num_sections
;
36 uint16_t opt_header_size
;
37 uint16_t characteristics
;
40 #define PE_HDR_32_MAGIC 0x10b
43 uint8_t major_linker_version
;
44 uint8_t minor_linker_version
;
52 uint32_t section_alignment
;
53 uint32_t file_alignment
;
54 uint16_t major_os_version
;
55 uint16_t minor_os_version
;
56 uint16_t major_image_version
;
57 uint16_t minor_image_version
;
58 uint16_t major_subsystem_version
;
59 uint16_t minor_subsystem_version
;
65 uint16_t characteristics
;
66 uint32_t stack_reserve_size
;
67 uint32_t stack_commit_size
;
68 uint32_t heap_reserve_size
;
69 uint32_t heap_commit_size
;
70 uint32_t loader_flags
;
71 uint32_t number_of_va_and_sizes
;
72 /* data directory not needed */
75 #define PE_HDR_64_MAGIC 0x20b
78 uint8_t major_linker_version
;
79 uint8_t minor_linker_version
;
86 uint32_t section_alignment
;
87 uint32_t file_alignment
;
88 uint16_t major_os_version
;
89 uint16_t minor_os_version
;
90 uint16_t major_image_version
;
91 uint16_t minor_image_version
;
92 uint16_t major_subsystem_version
;
93 uint16_t minor_subsystem_version
;
99 uint16_t characteristics
;
100 uint64_t stack_reserve_size
;
101 uint64_t stack_commit_size
;
102 uint64_t heap_reserve_size
;
103 uint64_t heap_commit_size
;
104 uint32_t loader_flags
;
105 uint32_t number_of_va_and_sizes
;
106 /* data directory not needed */
107 } pe_opt_header_64_t
;