LLVM 20.0.0git
COFF.h
Go to the documentation of this file.
1//===-- llvm/BinaryFormat/COFF.h --------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains an definitions used in Windows COFF Files.
10//
11// Structures and enums defined within this file where created using
12// information from Microsoft's publicly available PE/COFF format document:
13//
14// Microsoft Portable Executable and Common Object File Format Specification
15// Revision 8.1 - February 15, 2008
16//
17// As of 5/2/2010, hosted by Microsoft at:
18// http://www.microsoft.com/whdc/system/platform/firmware/pecoff.mspx
19//
20//===----------------------------------------------------------------------===//
21
22#ifndef LLVM_BINARYFORMAT_COFF_H
23#define LLVM_BINARYFORMAT_COFF_H
24
26#include <cassert>
27
28namespace llvm {
29namespace COFF {
30
31// The maximum number of sections that a COFF object can have (inclusive).
32const int32_t MaxNumberOfSections16 = 65279;
33
34// The PE signature bytes that follows the DOS stub header.
35static const char PEMagic[] = {'P', 'E', '\0', '\0'};
36
37static const char BigObjMagic[] = {
38 '\xc7', '\xa1', '\xba', '\xd1', '\xee', '\xba', '\xa9', '\x4b',
39 '\xaf', '\x20', '\xfa', '\xf6', '\x6a', '\xa4', '\xdc', '\xb8',
40};
41
42static const char ClGlObjMagic[] = {
43 '\x38', '\xfe', '\xb3', '\x0c', '\xa5', '\xd9', '\xab', '\x4d',
44 '\xac', '\x9b', '\xd6', '\xb6', '\x22', '\x26', '\x53', '\xc2',
45};
46
47// The signature bytes that start a .res file.
48static const char WinResMagic[] = {
49 '\x00', '\x00', '\x00', '\x00', '\x20', '\x00', '\x00', '\x00',
50 '\xff', '\xff', '\x00', '\x00', '\xff', '\xff', '\x00', '\x00',
51};
52
53// Sizes in bytes of various things in the COFF format.
54enum {
62};
63
64struct header {
72};
73
76
77 uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
78 uint16_t Sig2; ///< Must be 0xFFFF.
90};
91
92enum MachineTypes : unsigned {
93 MT_Invalid = 0xffff,
94
123
124template <typename T> bool isArm64EC(T Machine) {
127}
128
129template <typename T> bool isAnyArm64(T Machine) {
131}
132
133template <typename T> bool is64Bit(T Machine) {
135}
136
137enum Characteristics : unsigned {
139
140 /// The file does not contain base relocations and must be loaded at its
141 /// preferred base. If this cannot be done, the loader will error.
143 /// The file is valid and can be run.
145 /// COFF line numbers have been stripped. This is deprecated and should be
146 /// 0.
148 /// COFF symbol table entries for local symbols have been removed. This is
149 /// deprecated and should be 0.
151 /// Aggressively trim working set. This is deprecated and must be 0.
153 /// Image can handle > 2GiB addresses.
155 /// Little endian: the LSB precedes the MSB in memory. This is deprecated
156 /// and should be 0.
158 /// Machine is based on a 32bit word architecture.
160 /// Debugging info has been removed.
162 /// If the image is on removable media, fully load it and copy it to swap.
164 /// If the image is on network media, fully load it and copy it to swap.
166 /// The image file is a system file, not a user program.
168 /// The image file is a DLL.
170 /// This file should only be run on a uniprocessor machine.
172 /// Big endian: the MSB precedes the LSB in memory. This is deprecated
173 /// and should be 0.
176
177enum ResourceTypeID : unsigned {
199};
200
201struct symbol {
208};
209
210enum SymbolSectionNumber : int32_t {
215
216/// Storage class tells where and what the symbol represents
219
220 IMAGE_SYM_CLASS_END_OF_FUNCTION = -1, ///< Physical end of function
221 IMAGE_SYM_CLASS_NULL = 0, ///< No symbol
222 IMAGE_SYM_CLASS_AUTOMATIC = 1, ///< Stack variable
223 IMAGE_SYM_CLASS_EXTERNAL = 2, ///< External symbol
224 IMAGE_SYM_CLASS_STATIC = 3, ///< Static
225 IMAGE_SYM_CLASS_REGISTER = 4, ///< Register variable
226 IMAGE_SYM_CLASS_EXTERNAL_DEF = 5, ///< External definition
227 IMAGE_SYM_CLASS_LABEL = 6, ///< Label
228 IMAGE_SYM_CLASS_UNDEFINED_LABEL = 7, ///< Undefined label
229 IMAGE_SYM_CLASS_MEMBER_OF_STRUCT = 8, ///< Member of structure
230 IMAGE_SYM_CLASS_ARGUMENT = 9, ///< Function argument
231 IMAGE_SYM_CLASS_STRUCT_TAG = 10, ///< Structure tag
232 IMAGE_SYM_CLASS_MEMBER_OF_UNION = 11, ///< Member of union
233 IMAGE_SYM_CLASS_UNION_TAG = 12, ///< Union tag
234 IMAGE_SYM_CLASS_TYPE_DEFINITION = 13, ///< Type definition
235 IMAGE_SYM_CLASS_UNDEFINED_STATIC = 14, ///< Undefined static
236 IMAGE_SYM_CLASS_ENUM_TAG = 15, ///< Enumeration tag
237 IMAGE_SYM_CLASS_MEMBER_OF_ENUM = 16, ///< Member of enumeration
238 IMAGE_SYM_CLASS_REGISTER_PARAM = 17, ///< Register parameter
239 IMAGE_SYM_CLASS_BIT_FIELD = 18, ///< Bit field
240 /// ".bb" or ".eb" - beginning or end of block
242 /// ".bf" or ".ef" - beginning or end of function
244 IMAGE_SYM_CLASS_END_OF_STRUCT = 102, ///< End of structure
245 IMAGE_SYM_CLASS_FILE = 103, ///< File name
246 /// Line number, reformatted as symbol
248 IMAGE_SYM_CLASS_WEAK_EXTERNAL = 105, ///< Duplicate tag
249 /// External symbol in dmert public lib
252
253enum SymbolBaseType : unsigned {
254 IMAGE_SYM_TYPE_NULL = 0, ///< No type information or unknown base type.
255 IMAGE_SYM_TYPE_VOID = 1, ///< Used with void pointers and functions.
256 IMAGE_SYM_TYPE_CHAR = 2, ///< A character (signed byte).
257 IMAGE_SYM_TYPE_SHORT = 3, ///< A 2-byte signed integer.
258 IMAGE_SYM_TYPE_INT = 4, ///< A natural integer type on the target.
259 IMAGE_SYM_TYPE_LONG = 5, ///< A 4-byte signed integer.
260 IMAGE_SYM_TYPE_FLOAT = 6, ///< A 4-byte floating-point number.
261 IMAGE_SYM_TYPE_DOUBLE = 7, ///< An 8-byte floating-point number.
262 IMAGE_SYM_TYPE_STRUCT = 8, ///< A structure.
263 IMAGE_SYM_TYPE_UNION = 9, ///< An union.
264 IMAGE_SYM_TYPE_ENUM = 10, ///< An enumerated type.
265 IMAGE_SYM_TYPE_MOE = 11, ///< A member of enumeration (a specific value).
266 IMAGE_SYM_TYPE_BYTE = 12, ///< A byte; unsigned 1-byte integer.
267 IMAGE_SYM_TYPE_WORD = 13, ///< A word; unsigned 2-byte integer.
268 IMAGE_SYM_TYPE_UINT = 14, ///< An unsigned integer of natural size.
269 IMAGE_SYM_TYPE_DWORD = 15 ///< An unsigned 4-byte integer.
271
272enum SymbolComplexType : unsigned {
273 IMAGE_SYM_DTYPE_NULL = 0, ///< No complex type; simple scalar variable.
274 IMAGE_SYM_DTYPE_POINTER = 1, ///< A pointer to base type.
275 IMAGE_SYM_DTYPE_FUNCTION = 2, ///< A function that returns a base type.
276 IMAGE_SYM_DTYPE_ARRAY = 3, ///< An array of base type.
277
278 /// Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
281
283
284struct section {
295};
296
298 SC_Invalid = 0xffffffff,
299
302 IMAGE_SCN_CNT_CODE = 0x00000020,
306 IMAGE_SCN_LNK_INFO = 0x00000200,
309 IMAGE_SCN_GPREL = 0x00008000,
335 IMAGE_SCN_MEM_READ = 0x40000000,
336 IMAGE_SCN_MEM_WRITE = 0x80000000
338
343};
344
345enum RelocationTypeI386 : unsigned {
356 IMAGE_REL_I386_REL32 = 0x0014
358
359enum RelocationTypeAMD64 : unsigned {
378
379enum RelocationTypesARM : unsigned {
397};
398
399enum RelocationTypesARM64 : unsigned {
418};
419
420enum RelocationTypesMips : unsigned {
436};
437
438enum DynamicRelocationType : unsigned {
445};
446
451};
452
462
463// Auxiliary Symbol Formats
469 char unused[2];
470};
471
478};
479
484};
485
492
500 char unused;
501};
502
507 char unused2[12];
508};
509
515};
516
517/// The Import Directory Table.
518///
519/// There is a single array of these and one entry per imported DLL.
526};
527
528/// The PE32 Import Lookup Table.
529///
530/// There is an array of these for each imported DLL. It represents either
531/// the ordinal to import from the target DLL, or a name to lookup and import
532/// from the target DLL.
533///
534/// This also happens to be the same format used by the Import Address Table
535/// when it is initially written out to the image.
538
539 /// Is this entry specified by ordinal, or name?
540 bool isOrdinal() const { return data & 0x80000000; }
541
542 /// Get the ordinal value of this entry. isOrdinal must be true.
544 assert(isOrdinal() && "ILT entry is not an ordinal!");
545 return data & 0xFFFF;
546 }
547
548 /// Set the ordinal value and set isOrdinal to true.
550 data = o;
551 data |= 0x80000000;
552 }
553
554 /// Get the Hint/Name entry RVA. isOrdinal must be false.
556 assert(!isOrdinal() && "ILT entry is not a Hint/Name RVA!");
557 return data;
558 }
559
560 /// Set the Hint/Name entry RVA and set isOrdinal to false.
561 void setHintNameRVA(uint32_t rva) { data = rva; }
562};
563
564/// The DOS compatible header at the front of all PEs.
565struct DOSHeader {
585};
586
588 enum { PE32 = 0x10b, PE32_PLUS = 0x20b };
589
613 // FIXME: This should be DllCharacteristics to match the COFF spec.
620 // FIXME: This should be NumberOfRvaAndSizes to match the COFF spec.
622};
623
627};
628
629enum DataDirectoryIndex : unsigned {
645
648
649enum WindowsSubsystem : unsigned {
650 IMAGE_SUBSYSTEM_UNKNOWN = 0, ///< An unknown subsystem.
651 IMAGE_SUBSYSTEM_NATIVE = 1, ///< Device drivers and native Windows processes
652 IMAGE_SUBSYSTEM_WINDOWS_GUI = 2, ///< The Windows GUI subsystem.
653 IMAGE_SUBSYSTEM_WINDOWS_CUI = 3, ///< The Windows character subsystem.
654 IMAGE_SUBSYSTEM_OS2_CUI = 5, ///< The OS/2 character subsystem.
655 IMAGE_SUBSYSTEM_POSIX_CUI = 7, ///< The POSIX character subsystem.
656 IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8, ///< Native Windows 9x driver.
657 IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9, ///< Windows CE.
658 IMAGE_SUBSYSTEM_EFI_APPLICATION = 10, ///< An EFI application.
659 IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, ///< An EFI driver with boot
660 /// services.
661 IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, ///< An EFI driver with run-time
662 /// services.
663 IMAGE_SUBSYSTEM_EFI_ROM = 13, ///< An EFI ROM image.
664 IMAGE_SUBSYSTEM_XBOX = 14, ///< XBOX.
665 IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16 ///< A BCD application.
667
668enum DLLCharacteristics : unsigned {
669 /// ASLR with 64 bit address space.
671 /// DLL can be relocated at load time.
673 /// Code integrity checks are enforced.
675 ///< Image is NX compatible.
677 /// Isolation aware, but do not isolate the image.
679 /// Does not use structured exception handling (SEH). No SEH handler may be
680 /// called in this image.
682 /// Do not bind the image.
684 ///< Image should execute in an AppContainer.
686 ///< A WDM driver.
688 ///< Image supports Control Flow Guard.
690 /// Terminal Server aware.
693
695 /// Image is CET compatible
698
699enum DebugType : unsigned {
718};
719
720enum BaseRelocationType : unsigned {
732
733enum ImportType : unsigned {
736 IMPORT_CONST = 2
738
739enum ImportNameType : unsigned {
740 /// Import is by ordinal. This indicates that the value in the Ordinal/Hint
741 /// field of the import header is the import's ordinal. If this constant is
742 /// not specified, then the Ordinal/Hint field should always be interpreted
743 /// as the import's hint.
745 /// The import name is identical to the public symbol name
747 /// The import name is the public symbol name, but skipping the leading ?,
748 /// @, or optionally _.
750 /// The import name is the public symbol name, but skipping the leading ?,
751 /// @, or optionally _, and truncating at the first @.
753 /// The import name is specified as a separate string in the import library
754 /// object file.
757
758enum class GuardFlags : uint32_t {
759 /// Module performs control flow integrity checks using system-supplied
760 /// support.
761 CF_INSTRUMENTED = 0x100,
762 /// Module performs control flow and write integrity checks.
763 CFW_INSTRUMENTED = 0x200,
764 /// Module contains valid control flow target metadata.
766 /// Module does not make use of the /GS security cookie.
768 /// Module supports read only delay load IAT.
769 PROTECT_DELAYLOAD_IAT = 0x1000,
770 /// Delayload import table in its own .didat section (with nothing else in it)
771 /// that can be freely reprotected.
773 /// Module contains suppressed export information. This also infers that the
774 /// address taken IAT table is also present in the load config.
776 /// Module enables suppression of exports.
778 /// Module contains longjmp target information.
780 /// Module contains EH continuation target information.
782 /// Mask for the subfield that contains the stride of Control Flow Guard
783 /// function table entries (that is, the additional count of bytes per table
784 /// entry).
785 CF_FUNCTION_TABLE_SIZE_MASK = 0xF0000000,
801};
802
804 uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
805 uint16_t Sig2; ///< Must be 0xFFFF.
812
813 ImportType getType() const { return static_cast<ImportType>(TypeInfo & 0x3); }
814
816 return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
817 }
818};
819
824
825// These flags show up in the @feat.00 symbol. They appear to be some kind of
826// compiler features bitfield read by link.exe.
828 // Object is compatible with /safeseh.
829 SafeSEH = 0x1,
830 // Object was compiled with /GS.
831 GuardStack = 0x100,
832 // Object was compiled with /sdl.
833 SDL = 0x200,
834 // Object was compiled with /guard:cf.
835 GuardCF = 0x800,
836 // Object was compiled with /guard:ehcont.
837 GuardEHCont = 0x4000,
838 // Object was compiled with /kernel.
839 Kernel = 0x40000000,
840};
841
844 Entry = 1,
845 Exit = 4,
846};
847
848inline bool isReservedSectionNumber(int32_t SectionNumber) {
849 return SectionNumber <= 0;
850}
851
852/// Encode section name based on string table offset.
853/// The size of Out must be at least COFF::NameSize.
854bool encodeSectionName(char *Out, uint64_t Offset);
855
856} // End namespace COFF.
857} // End namespace llvm.
858
859#endif
COFF::MachineTypes Machine
Definition: COFFYAML.cpp:390
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
std::pair< llvm::MachO::Target, std::string > UUID
static const char ClGlObjMagic[]
Definition: COFF.h:42
DLLCharacteristics
Definition: COFF.h:668
@ IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE
Terminal Server aware.
Definition: COFF.h:691
@ IMAGE_DLL_CHARACTERISTICS_GUARD_CF
Definition: COFF.h:689
@ IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
Isolation aware, but do not isolate the image.
Definition: COFF.h:678
@ IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
Definition: COFF.h:676
@ IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER
Image supports Control Flow Guard.
Definition: COFF.h:687
@ IMAGE_DLL_CHARACTERISTICS_NO_BIND
Do not bind the image.
Definition: COFF.h:683
@ IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
Code integrity checks are enforced.
Definition: COFF.h:674
@ IMAGE_DLL_CHARACTERISTICS_APPCONTAINER
A WDM driver.
Definition: COFF.h:685
@ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
DLL can be relocated at load time.
Definition: COFF.h:672
@ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
ASLR with 64 bit address space.
Definition: COFF.h:670
@ IMAGE_DLL_CHARACTERISTICS_NO_SEH
Does not use structured exception handling (SEH).
Definition: COFF.h:681
AuxSymbolType
Definition: COFF.h:282
@ IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF
Definition: COFF.h:282
BaseRelocationType
Definition: COFF.h:720
@ IMAGE_REL_BASED_MIPS_JMPADDR16
Definition: COFF.h:729
@ IMAGE_REL_BASED_ARM_MOV32T
Definition: COFF.h:728
@ IMAGE_REL_BASED_ABSOLUTE
Definition: COFF.h:721
@ IMAGE_REL_BASED_MIPS_JMPADDR
Definition: COFF.h:726
@ IMAGE_REL_BASED_DIR64
Definition: COFF.h:730
@ IMAGE_REL_BASED_HIGH
Definition: COFF.h:722
@ IMAGE_REL_BASED_HIGHLOW
Definition: COFF.h:724
@ IMAGE_REL_BASED_HIGHADJ
Definition: COFF.h:725
@ IMAGE_REL_BASED_ARM_MOV32A
Definition: COFF.h:727
@ IMAGE_REL_BASED_LOW
Definition: COFF.h:723
RelocationTypesMips
Definition: COFF.h:420
@ IMAGE_REL_MIPS_PAIR
Definition: COFF.h:435
@ IMAGE_REL_MIPS_JMPADDR
Definition: COFF.h:424
@ IMAGE_REL_MIPS_REFHI
Definition: COFF.h:425
@ IMAGE_REL_MIPS_REFLO
Definition: COFF.h:426
@ IMAGE_REL_MIPS_LITERAL
Definition: COFF.h:428
@ IMAGE_REL_MIPS_REFHALF
Definition: COFF.h:422
@ IMAGE_REL_MIPS_SECRELHI
Definition: COFF.h:432
@ IMAGE_REL_MIPS_JMPADDR16
Definition: COFF.h:433
@ IMAGE_REL_MIPS_ABSOLUTE
Definition: COFF.h:421
@ IMAGE_REL_MIPS_SECRELLO
Definition: COFF.h:431
@ IMAGE_REL_MIPS_GPREL
Definition: COFF.h:427
@ IMAGE_REL_MIPS_REFWORDNB
Definition: COFF.h:434
@ IMAGE_REL_MIPS_REFWORD
Definition: COFF.h:423
@ IMAGE_REL_MIPS_SECREL
Definition: COFF.h:430
@ IMAGE_REL_MIPS_SECTION
Definition: COFF.h:429
DynamicRelocationType
Definition: COFF.h:438
@ IMAGE_DYNAMIC_RELOCATION_ARM64X
Definition: COFF.h:444
@ IMAGE_DYNAMIC_RELOCATION_GUARD_SWITCHTABLE_BRANCH
Definition: COFF.h:443
@ IMAGE_DYNAMIC_RELOCATION_GUARD_RF_EPILOGUE
Definition: COFF.h:440
@ IMAGE_DYNAMIC_RELOCATION_GUARD_INDIR_CONTROL_TRANSFER
Definition: COFF.h:442
@ IMAGE_DYNAMIC_RELOCATION_GUARD_IMPORT_CONTROL_TRANSFER
Definition: COFF.h:441
@ IMAGE_DYNAMIC_RELOCATION_GUARD_RF_PROLOGUE
Definition: COFF.h:439
MachineTypes
Definition: COFF.h:92
@ IMAGE_FILE_MACHINE_WCEMIPSV2
Definition: COFF.h:121
@ IMAGE_FILE_MACHINE_ARM64
Definition: COFF.h:100
@ IMAGE_FILE_MACHINE_IA64
Definition: COFF.h:105
@ IMAGE_FILE_MACHINE_POWERPCFP
Definition: COFF.h:111
@ IMAGE_FILE_MACHINE_POWERPC
Definition: COFF.h:110
@ IMAGE_FILE_MACHINE_SH5
Definition: COFF.h:119
@ IMAGE_FILE_MACHINE_UNKNOWN
Definition: COFF.h:95
@ IMAGE_FILE_MACHINE_MIPS16
Definition: COFF.h:107
@ IMAGE_FILE_MACHINE_THUMB
Definition: COFF.h:120
@ IMAGE_FILE_MACHINE_AMD64
Definition: COFF.h:97
@ IMAGE_FILE_MACHINE_ARM64EC
Definition: COFF.h:101
@ IMAGE_FILE_MACHINE_MIPSFPU16
Definition: COFF.h:109
@ IMAGE_FILE_MACHINE_AM33
Definition: COFF.h:96
@ IMAGE_FILE_MACHINE_R4000
Definition: COFF.h:112
@ IMAGE_FILE_MACHINE_M32R
Definition: COFF.h:106
@ IMAGE_FILE_MACHINE_MIPSFPU
Definition: COFF.h:108
@ IMAGE_FILE_MACHINE_RISCV64
Definition: COFF.h:114
@ IMAGE_FILE_MACHINE_RISCV32
Definition: COFF.h:113
@ IMAGE_FILE_MACHINE_SH3DSP
Definition: COFF.h:117
@ IMAGE_FILE_MACHINE_I386
Definition: COFF.h:104
@ MT_Invalid
Definition: COFF.h:93
@ IMAGE_FILE_MACHINE_RISCV128
Definition: COFF.h:115
@ IMAGE_FILE_MACHINE_ARM64X
Definition: COFF.h:102
@ IMAGE_FILE_MACHINE_SH4
Definition: COFF.h:118
@ IMAGE_FILE_MACHINE_EBC
Definition: COFF.h:103
@ IMAGE_FILE_MACHINE_ARM
Definition: COFF.h:98
@ IMAGE_FILE_MACHINE_ARMNT
Definition: COFF.h:99
@ IMAGE_FILE_MACHINE_SH3
Definition: COFF.h:116
SectionCharacteristics
Definition: COFF.h:297
@ IMAGE_SCN_ALIGN_64BYTES
Definition: COFF.h:320
@ IMAGE_SCN_ALIGN_128BYTES
Definition: COFF.h:321
@ IMAGE_SCN_MEM_NOT_PAGED
Definition: COFF.h:332
@ IMAGE_SCN_LNK_OTHER
Definition: COFF.h:305
@ IMAGE_SCN_MEM_SHARED
Definition: COFF.h:333
@ IMAGE_SCN_ALIGN_256BYTES
Definition: COFF.h:322
@ IMAGE_SCN_GPREL
Definition: COFF.h:309
@ IMAGE_SCN_ALIGN_1024BYTES
Definition: COFF.h:324
@ IMAGE_SCN_ALIGN_1BYTES
Definition: COFF.h:314
@ IMAGE_SCN_LNK_REMOVE
Definition: COFF.h:307
@ IMAGE_SCN_CNT_CODE
Definition: COFF.h:302
@ IMAGE_SCN_MEM_NOT_CACHED
Definition: COFF.h:331
@ IMAGE_SCN_MEM_READ
Definition: COFF.h:335
@ IMAGE_SCN_MEM_EXECUTE
Definition: COFF.h:334
@ IMAGE_SCN_ALIGN_512BYTES
Definition: COFF.h:323
@ IMAGE_SCN_CNT_UNINITIALIZED_DATA
Definition: COFF.h:304
@ IMAGE_SCN_MEM_DISCARDABLE
Definition: COFF.h:330
@ IMAGE_SCN_LNK_INFO
Definition: COFF.h:306
@ IMAGE_SCN_ALIGN_4096BYTES
Definition: COFF.h:326
@ IMAGE_SCN_MEM_16BIT
Definition: COFF.h:311
@ IMAGE_SCN_CNT_INITIALIZED_DATA
Definition: COFF.h:303
@ IMAGE_SCN_ALIGN_MASK
Definition: COFF.h:328
@ IMAGE_SCN_ALIGN_8192BYTES
Definition: COFF.h:327
@ IMAGE_SCN_MEM_PRELOAD
Definition: COFF.h:313
@ IMAGE_SCN_LNK_NRELOC_OVFL
Definition: COFF.h:329
@ IMAGE_SCN_ALIGN_16BYTES
Definition: COFF.h:318
@ IMAGE_SCN_TYPE_NO_PAD
Definition: COFF.h:301
@ IMAGE_SCN_MEM_PURGEABLE
Definition: COFF.h:310
@ IMAGE_SCN_LNK_COMDAT
Definition: COFF.h:308
@ IMAGE_SCN_ALIGN_8BYTES
Definition: COFF.h:317
@ IMAGE_SCN_ALIGN_4BYTES
Definition: COFF.h:316
@ IMAGE_SCN_ALIGN_32BYTES
Definition: COFF.h:319
@ IMAGE_SCN_ALIGN_2BYTES
Definition: COFF.h:315
@ SC_Invalid
Definition: COFF.h:298
@ IMAGE_SCN_ALIGN_2048BYTES
Definition: COFF.h:325
@ IMAGE_SCN_MEM_WRITE
Definition: COFF.h:336
@ IMAGE_SCN_MEM_LOCKED
Definition: COFF.h:312
@ IMAGE_SCN_TYPE_NOLOAD
Definition: COFF.h:300
bool isAnyArm64(T Machine)
Definition: COFF.h:129
ImportType
Definition: COFF.h:733
@ IMPORT_CONST
Definition: COFF.h:736
@ IMPORT_CODE
Definition: COFF.h:734
@ IMPORT_DATA
Definition: COFF.h:735
DebugType
Definition: COFF.h:699
@ IMAGE_DEBUG_TYPE_OMAP_FROM_SRC
Definition: COFF.h:708
@ IMAGE_DEBUG_TYPE_FIXUP
Definition: COFF.h:706
@ IMAGE_DEBUG_TYPE_REPRO
Definition: COFF.h:716
@ IMAGE_DEBUG_TYPE_ILTCG
Definition: COFF.h:714
@ IMAGE_DEBUG_TYPE_BORLAND
Definition: COFF.h:709
@ IMAGE_DEBUG_TYPE_COFF
Definition: COFF.h:701
@ IMAGE_DEBUG_TYPE_POGO
Definition: COFF.h:713
@ IMAGE_DEBUG_TYPE_VC_FEATURE
Definition: COFF.h:712
@ IMAGE_DEBUG_TYPE_CODEVIEW
Definition: COFF.h:702
@ IMAGE_DEBUG_TYPE_OMAP_TO_SRC
Definition: COFF.h:707
@ IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS
Definition: COFF.h:717
@ IMAGE_DEBUG_TYPE_MPX
Definition: COFF.h:715
@ IMAGE_DEBUG_TYPE_UNKNOWN
Definition: COFF.h:700
@ IMAGE_DEBUG_TYPE_FPO
Definition: COFF.h:703
@ IMAGE_DEBUG_TYPE_MISC
Definition: COFF.h:704
@ IMAGE_DEBUG_TYPE_EXCEPTION
Definition: COFF.h:705
@ IMAGE_DEBUG_TYPE_CLSID
Definition: COFF.h:711
@ IMAGE_DEBUG_TYPE_RESERVED10
Definition: COFF.h:710
RelocationTypesARM64
Definition: COFF.h:399
@ IMAGE_REL_ARM64_SECREL
Definition: COFF.h:408
@ IMAGE_REL_ARM64_BRANCH19
Definition: COFF.h:415
@ IMAGE_REL_ARM64_REL32
Definition: COFF.h:417
@ IMAGE_REL_ARM64_TOKEN
Definition: COFF.h:412
@ IMAGE_REL_ARM64_SECREL_LOW12A
Definition: COFF.h:409
@ IMAGE_REL_ARM64_ADDR32
Definition: COFF.h:401
@ IMAGE_REL_ARM64_SECTION
Definition: COFF.h:413
@ IMAGE_REL_ARM64_SECREL_HIGH12A
Definition: COFF.h:410
@ IMAGE_REL_ARM64_ABSOLUTE
Definition: COFF.h:400
@ IMAGE_REL_ARM64_PAGEOFFSET_12A
Definition: COFF.h:406
@ IMAGE_REL_ARM64_BRANCH14
Definition: COFF.h:416
@ IMAGE_REL_ARM64_BRANCH26
Definition: COFF.h:403
@ IMAGE_REL_ARM64_PAGEOFFSET_12L
Definition: COFF.h:407
@ IMAGE_REL_ARM64_SECREL_LOW12L
Definition: COFF.h:411
@ IMAGE_REL_ARM64_ADDR32NB
Definition: COFF.h:402
@ IMAGE_REL_ARM64_PAGEBASE_REL21
Definition: COFF.h:404
@ IMAGE_REL_ARM64_REL21
Definition: COFF.h:405
@ IMAGE_REL_ARM64_ADDR64
Definition: COFF.h:414
@ NameSize
Definition: COFF.h:57
@ Header16Size
Definition: COFF.h:55
@ Symbol16Size
Definition: COFF.h:58
@ Header32Size
Definition: COFF.h:56
@ SectionSize
Definition: COFF.h:60
@ Symbol32Size
Definition: COFF.h:59
@ RelocationSize
Definition: COFF.h:61
GuardFlags
Definition: COFF.h:758
@ PROTECT_DELAYLOAD_IAT
Module supports read only delay load IAT.
@ DELAYLOAD_IAT_IN_ITS_OWN_SECTION
Delayload import table in its own .didat section (with nothing else in it) that can be freely reprote...
@ CF_EXPORT_SUPPRESSION_INFO_PRESENT
Module contains suppressed export information.
@ CF_INSTRUMENTED
Module performs control flow integrity checks using system-supplied support.
@ EH_CONTINUATION_TABLE_PRESENT
Module contains EH continuation target information.
@ CF_FUNCTION_TABLE_SIZE_MASK
Mask for the subfield that contains the stride of Control Flow Guard function table entries (that is,...
@ CF_LONGJUMP_TABLE_PRESENT
Module contains longjmp target information.
@ CF_FUNCTION_TABLE_PRESENT
Module contains valid control flow target metadata.
@ SECURITY_COOKIE_UNUSED
Module does not make use of the /GS security cookie.
@ CFW_INSTRUMENTED
Module performs control flow and write integrity checks.
@ CF_ENABLE_EXPORT_SUPPRESSION
Module enables suppression of exports.
RelocationTypeAMD64
Definition: COFF.h:359
@ IMAGE_REL_AMD64_REL32
Definition: COFF.h:364
@ IMAGE_REL_AMD64_TOKEN
Definition: COFF.h:373
@ IMAGE_REL_AMD64_REL32_5
Definition: COFF.h:369
@ IMAGE_REL_AMD64_ADDR64
Definition: COFF.h:361
@ IMAGE_REL_AMD64_REL32_3
Definition: COFF.h:367
@ IMAGE_REL_AMD64_ADDR32NB
Definition: COFF.h:363
@ IMAGE_REL_AMD64_SREL32
Definition: COFF.h:374
@ IMAGE_REL_AMD64_ADDR32
Definition: COFF.h:362
@ IMAGE_REL_AMD64_ABSOLUTE
Definition: COFF.h:360
@ IMAGE_REL_AMD64_PAIR
Definition: COFF.h:375
@ IMAGE_REL_AMD64_SECTION
Definition: COFF.h:370
@ IMAGE_REL_AMD64_REL32_2
Definition: COFF.h:366
@ IMAGE_REL_AMD64_REL32_1
Definition: COFF.h:365
@ IMAGE_REL_AMD64_SECREL
Definition: COFF.h:371
@ IMAGE_REL_AMD64_SECREL7
Definition: COFF.h:372
@ IMAGE_REL_AMD64_REL32_4
Definition: COFF.h:368
@ IMAGE_REL_AMD64_SSPAN32
Definition: COFF.h:376
DataDirectoryIndex
Definition: COFF.h:629
@ ARCHITECTURE
Definition: COFF.h:637
@ IAT
Definition: COFF.h:642
@ CERTIFICATE_TABLE
Definition: COFF.h:634
@ TLS_TABLE
Definition: COFF.h:639
@ EXCEPTION_TABLE
Definition: COFF.h:633
@ GLOBAL_PTR
Definition: COFF.h:638
@ EXPORT_TABLE
Definition: COFF.h:630
@ LOAD_CONFIG_TABLE
Definition: COFF.h:640
@ IMPORT_TABLE
Definition: COFF.h:631
@ DELAY_IMPORT_DESCRIPTOR
Definition: COFF.h:643
@ CLR_RUNTIME_HEADER
Definition: COFF.h:644
@ RESOURCE_TABLE
Definition: COFF.h:632
@ DEBUG_DIRECTORY
Definition: COFF.h:636
@ BASE_RELOCATION_TABLE
Definition: COFF.h:635
@ NUM_DATA_DIRECTORIES
Definition: COFF.h:646
@ BOUND_IMPORT
Definition: COFF.h:641
SymbolStorageClass
Storage class tells where and what the symbol represents.
Definition: COFF.h:217
@ IMAGE_SYM_CLASS_MEMBER_OF_UNION
Member of union.
Definition: COFF.h:232
@ IMAGE_SYM_CLASS_AUTOMATIC
Stack variable.
Definition: COFF.h:222
@ SSC_Invalid
Definition: COFF.h:218
@ IMAGE_SYM_CLASS_BIT_FIELD
Bit field.
Definition: COFF.h:239
@ IMAGE_SYM_CLASS_REGISTER
Register variable.
Definition: COFF.h:225
@ IMAGE_SYM_CLASS_SECTION
Line number, reformatted as symbol.
Definition: COFF.h:247
@ IMAGE_SYM_CLASS_REGISTER_PARAM
Register parameter.
Definition: COFF.h:238
@ IMAGE_SYM_CLASS_END_OF_STRUCT
End of structure.
Definition: COFF.h:244
@ IMAGE_SYM_CLASS_MEMBER_OF_ENUM
Member of enumeration.
Definition: COFF.h:237
@ IMAGE_SYM_CLASS_EXTERNAL_DEF
External definition.
Definition: COFF.h:226
@ IMAGE_SYM_CLASS_TYPE_DEFINITION
Type definition.
Definition: COFF.h:234
@ IMAGE_SYM_CLASS_MEMBER_OF_STRUCT
Member of structure.
Definition: COFF.h:229
@ IMAGE_SYM_CLASS_BLOCK
".bb" or ".eb" - beginning or end of block
Definition: COFF.h:241
@ IMAGE_SYM_CLASS_ENUM_TAG
Enumeration tag.
Definition: COFF.h:236
@ IMAGE_SYM_CLASS_UNION_TAG
Union tag.
Definition: COFF.h:233
@ IMAGE_SYM_CLASS_FUNCTION
".bf" or ".ef" - beginning or end of function
Definition: COFF.h:243
@ IMAGE_SYM_CLASS_STRUCT_TAG
Structure tag.
Definition: COFF.h:231
@ IMAGE_SYM_CLASS_EXTERNAL
External symbol.
Definition: COFF.h:223
@ IMAGE_SYM_CLASS_LABEL
Label.
Definition: COFF.h:227
@ IMAGE_SYM_CLASS_ARGUMENT
Function argument.
Definition: COFF.h:230
@ IMAGE_SYM_CLASS_END_OF_FUNCTION
Physical end of function.
Definition: COFF.h:220
@ IMAGE_SYM_CLASS_FILE
File name.
Definition: COFF.h:245
@ IMAGE_SYM_CLASS_UNDEFINED_STATIC
Undefined static.
Definition: COFF.h:235
@ IMAGE_SYM_CLASS_CLR_TOKEN
External symbol in dmert public lib.
Definition: COFF.h:250
@ IMAGE_SYM_CLASS_NULL
No symbol.
Definition: COFF.h:221
@ IMAGE_SYM_CLASS_UNDEFINED_LABEL
Undefined label.
Definition: COFF.h:228
@ IMAGE_SYM_CLASS_WEAK_EXTERNAL
Duplicate tag.
Definition: COFF.h:248
@ IMAGE_SYM_CLASS_STATIC
Static.
Definition: COFF.h:224
bool encodeSectionName(char *Out, uint64_t Offset)
Encode section name based on string table offset.
Definition: COFF.cpp:39
Arm64XFixupType
Definition: COFF.h:447
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_VALUE
Definition: COFF.h:449
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_DELTA
Definition: COFF.h:450
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_ZEROFILL
Definition: COFF.h:448
ExtendedDLLCharacteristics
Definition: COFF.h:694
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
Image is CET compatible.
Definition: COFF.h:696
ResourceTypeID
Definition: COFF.h:177
@ RID_Menu
Definition: COFF.h:181
@ RID_AniCursor
Definition: COFF.h:195
@ RID_MessageTable
Definition: COFF.h:188
@ RID_RCData
Definition: COFF.h:187
@ RID_Accelerator
Definition: COFF.h:186
@ RID_FontDir
Definition: COFF.h:184
@ RID_VXD
Definition: COFF.h:194
@ RID_Bitmap
Definition: COFF.h:179
@ RID_HTML
Definition: COFF.h:197
@ RID_Manifest
Definition: COFF.h:198
@ RID_Version
Definition: COFF.h:191
@ RID_AniIcon
Definition: COFF.h:196
@ RID_DLGInclude
Definition: COFF.h:192
@ RID_Group_Cursor
Definition: COFF.h:189
@ RID_Group_Icon
Definition: COFF.h:190
@ RID_Icon
Definition: COFF.h:180
@ RID_Font
Definition: COFF.h:185
@ RID_Cursor
Definition: COFF.h:178
@ RID_Dialog
Definition: COFF.h:182
@ RID_PlugPlay
Definition: COFF.h:193
@ RID_String
Definition: COFF.h:183
WindowsSubsystem
Definition: COFF.h:649
@ IMAGE_SUBSYSTEM_EFI_APPLICATION
An EFI application.
Definition: COFF.h:658
@ IMAGE_SUBSYSTEM_WINDOWS_CUI
The Windows character subsystem.
Definition: COFF.h:653
@ IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
Windows CE.
Definition: COFF.h:657
@ IMAGE_SUBSYSTEM_XBOX
XBOX.
Definition: COFF.h:664
@ IMAGE_SUBSYSTEM_UNKNOWN
An unknown subsystem.
Definition: COFF.h:650
@ IMAGE_SUBSYSTEM_OS2_CUI
The OS/2 character subsystem.
Definition: COFF.h:654
@ IMAGE_SUBSYSTEM_NATIVE_WINDOWS
Native Windows 9x driver.
Definition: COFF.h:656
@ IMAGE_SUBSYSTEM_EFI_ROM
An EFI ROM image.
Definition: COFF.h:663
@ IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
An EFI driver with run-time services.
Definition: COFF.h:661
@ IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
An EFI driver with boot services.
Definition: COFF.h:659
@ IMAGE_SUBSYSTEM_POSIX_CUI
The POSIX character subsystem.
Definition: COFF.h:655
@ IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION
A BCD application.
Definition: COFF.h:665
@ IMAGE_SUBSYSTEM_WINDOWS_GUI
The Windows GUI subsystem.
Definition: COFF.h:652
@ IMAGE_SUBSYSTEM_NATIVE
Device drivers and native Windows processes.
Definition: COFF.h:651
static const char WinResMagic[]
Definition: COFF.h:48
COMDATType
Definition: COFF.h:453
@ IMAGE_COMDAT_SELECT_NODUPLICATES
Definition: COFF.h:454
@ IMAGE_COMDAT_SELECT_LARGEST
Definition: COFF.h:459
@ IMAGE_COMDAT_SELECT_NEWEST
Definition: COFF.h:460
@ IMAGE_COMDAT_SELECT_SAME_SIZE
Definition: COFF.h:456
@ IMAGE_COMDAT_SELECT_ASSOCIATIVE
Definition: COFF.h:458
@ IMAGE_COMDAT_SELECT_EXACT_MATCH
Definition: COFF.h:457
@ IMAGE_COMDAT_SELECT_ANY
Definition: COFF.h:455
WeakExternalCharacteristics
Definition: COFF.h:486
@ IMAGE_WEAK_EXTERN_SEARCH_ALIAS
Definition: COFF.h:489
@ IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY
Definition: COFF.h:490
@ IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY
Definition: COFF.h:487
@ IMAGE_WEAK_EXTERN_SEARCH_LIBRARY
Definition: COFF.h:488
CodeViewIdentifiers
Definition: COFF.h:820
@ DEBUG_HASHES_SECTION_MAGIC
Definition: COFF.h:822
@ DEBUG_SECTION_MAGIC
Definition: COFF.h:821
bool is64Bit(T Machine)
Definition: COFF.h:133
RelocationTypesARM
Definition: COFF.h:379
@ IMAGE_REL_ARM_MOV32A
Definition: COFF.h:391
@ IMAGE_REL_ARM_BRANCH20T
Definition: COFF.h:393
@ IMAGE_REL_ARM_BRANCH24
Definition: COFF.h:383
@ IMAGE_REL_ARM_ADDR32NB
Definition: COFF.h:382
@ IMAGE_REL_ARM_BRANCH11
Definition: COFF.h:384
@ IMAGE_REL_ARM_BLX24
Definition: COFF.h:386
@ IMAGE_REL_ARM_ADDR32
Definition: COFF.h:381
@ IMAGE_REL_ARM_MOV32T
Definition: COFF.h:392
@ IMAGE_REL_ARM_BRANCH24T
Definition: COFF.h:394
@ IMAGE_REL_ARM_PAIR
Definition: COFF.h:396
@ IMAGE_REL_ARM_ABSOLUTE
Definition: COFF.h:380
@ IMAGE_REL_ARM_REL32
Definition: COFF.h:388
@ IMAGE_REL_ARM_BLX23T
Definition: COFF.h:395
@ IMAGE_REL_ARM_SECREL
Definition: COFF.h:390
@ IMAGE_REL_ARM_SECTION
Definition: COFF.h:389
@ IMAGE_REL_ARM_BLX11
Definition: COFF.h:387
@ IMAGE_REL_ARM_TOKEN
Definition: COFF.h:385
bool isArm64EC(T Machine)
Definition: COFF.h:124
const int32_t MaxNumberOfSections16
Definition: COFF.h:32
ImportNameType
Definition: COFF.h:739
@ IMPORT_ORDINAL
Import is by ordinal.
Definition: COFF.h:744
@ IMPORT_NAME_EXPORTAS
The import name is specified as a separate string in the import library object file.
Definition: COFF.h:755
@ IMPORT_NAME
The import name is identical to the public symbol name.
Definition: COFF.h:746
@ IMPORT_NAME_UNDECORATE
The import name is the public symbol name, but skipping the leading ?, @, or optionally _,...
Definition: COFF.h:752
@ IMPORT_NAME_NOPREFIX
The import name is the public symbol name, but skipping the leading ?, @, or optionally _.
Definition: COFF.h:749
bool isReservedSectionNumber(int32_t SectionNumber)
Definition: COFF.h:848
RelocationTypeI386
Definition: COFF.h:345
@ IMAGE_REL_I386_TOKEN
Definition: COFF.h:354
@ IMAGE_REL_I386_SECTION
Definition: COFF.h:352
@ IMAGE_REL_I386_SECREL7
Definition: COFF.h:355
@ IMAGE_REL_I386_REL32
Definition: COFF.h:356
@ IMAGE_REL_I386_REL16
Definition: COFF.h:348
@ IMAGE_REL_I386_DIR16
Definition: COFF.h:347
@ IMAGE_REL_I386_SECREL
Definition: COFF.h:353
@ IMAGE_REL_I386_DIR32
Definition: COFF.h:349
@ IMAGE_REL_I386_ABSOLUTE
Definition: COFF.h:346
@ IMAGE_REL_I386_SEG12
Definition: COFF.h:351
@ IMAGE_REL_I386_DIR32NB
Definition: COFF.h:350
SymbolBaseType
Definition: COFF.h:253
@ IMAGE_SYM_TYPE_DOUBLE
An 8-byte floating-point number.
Definition: COFF.h:261
@ IMAGE_SYM_TYPE_DWORD
An unsigned 4-byte integer.
Definition: COFF.h:269
@ IMAGE_SYM_TYPE_STRUCT
A structure.
Definition: COFF.h:262
@ IMAGE_SYM_TYPE_SHORT
A 2-byte signed integer.
Definition: COFF.h:257
@ IMAGE_SYM_TYPE_UINT
An unsigned integer of natural size.
Definition: COFF.h:268
@ IMAGE_SYM_TYPE_NULL
No type information or unknown base type.
Definition: COFF.h:254
@ IMAGE_SYM_TYPE_CHAR
A character (signed byte).
Definition: COFF.h:256
@ IMAGE_SYM_TYPE_ENUM
An enumerated type.
Definition: COFF.h:264
@ IMAGE_SYM_TYPE_FLOAT
A 4-byte floating-point number.
Definition: COFF.h:260
@ IMAGE_SYM_TYPE_INT
A natural integer type on the target.
Definition: COFF.h:258
@ IMAGE_SYM_TYPE_LONG
A 4-byte signed integer.
Definition: COFF.h:259
@ IMAGE_SYM_TYPE_UNION
An union.
Definition: COFF.h:263
@ IMAGE_SYM_TYPE_MOE
A member of enumeration (a specific value).
Definition: COFF.h:265
@ IMAGE_SYM_TYPE_BYTE
A byte; unsigned 1-byte integer.
Definition: COFF.h:266
@ IMAGE_SYM_TYPE_WORD
A word; unsigned 2-byte integer.
Definition: COFF.h:267
@ IMAGE_SYM_TYPE_VOID
Used with void pointers and functions.
Definition: COFF.h:255
Arm64ECThunkType
Definition: COFF.h:842
@ GuestExit
Definition: COFF.h:843
@ Entry
Definition: COFF.h:844
@ Exit
Definition: COFF.h:845
static const char BigObjMagic[]
Definition: COFF.h:37
Characteristics
Definition: COFF.h:137
@ IMAGE_FILE_LINE_NUMS_STRIPPED
COFF line numbers have been stripped.
Definition: COFF.h:147
@ C_Invalid
Definition: COFF.h:138
@ IMAGE_FILE_DEBUG_STRIPPED
Debugging info has been removed.
Definition: COFF.h:161
@ IMAGE_FILE_DLL
The image file is a DLL.
Definition: COFF.h:169
@ IMAGE_FILE_AGGRESSIVE_WS_TRIM
Aggressively trim working set. This is deprecated and must be 0.
Definition: COFF.h:152
@ IMAGE_FILE_BYTES_REVERSED_LO
Little endian: the LSB precedes the MSB in memory.
Definition: COFF.h:157
@ IMAGE_FILE_UP_SYSTEM_ONLY
This file should only be run on a uniprocessor machine.
Definition: COFF.h:171
@ IMAGE_FILE_LARGE_ADDRESS_AWARE
Image can handle > 2GiB addresses.
Definition: COFF.h:154
@ IMAGE_FILE_BYTES_REVERSED_HI
Big endian: the MSB precedes the LSB in memory.
Definition: COFF.h:174
@ IMAGE_FILE_SYSTEM
The image file is a system file, not a user program.
Definition: COFF.h:167
@ IMAGE_FILE_32BIT_MACHINE
Machine is based on a 32bit word architecture.
Definition: COFF.h:159
@ IMAGE_FILE_LOCAL_SYMS_STRIPPED
COFF symbol table entries for local symbols have been removed.
Definition: COFF.h:150
@ IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
If the image is on removable media, fully load it and copy it to swap.
Definition: COFF.h:163
@ IMAGE_FILE_EXECUTABLE_IMAGE
The file is valid and can be run.
Definition: COFF.h:144
@ IMAGE_FILE_NET_RUN_FROM_SWAP
If the image is on network media, fully load it and copy it to swap.
Definition: COFF.h:165
@ IMAGE_FILE_RELOCS_STRIPPED
The file does not contain base relocations and must be loaded at its preferred base.
Definition: COFF.h:142
static const char PEMagic[]
Definition: COFF.h:35
Feat00Flags
Definition: COFF.h:827
@ SafeSEH
Definition: COFF.h:829
@ GuardEHCont
Definition: COFF.h:837
@ SDL
Definition: COFF.h:833
@ GuardStack
Definition: COFF.h:831
@ GuardCF
Definition: COFF.h:835
@ Kernel
Definition: COFF.h:839
SymbolSectionNumber
Definition: COFF.h:210
@ IMAGE_SYM_DEBUG
Definition: COFF.h:211
@ IMAGE_SYM_UNDEFINED
Definition: COFF.h:213
@ IMAGE_SYM_ABSOLUTE
Definition: COFF.h:212
SymbolComplexType
Definition: COFF.h:272
@ IMAGE_SYM_DTYPE_ARRAY
An array of base type.
Definition: COFF.h:276
@ IMAGE_SYM_DTYPE_NULL
No complex type; simple scalar variable.
Definition: COFF.h:273
@ IMAGE_SYM_DTYPE_POINTER
A pointer to base type.
Definition: COFF.h:274
@ IMAGE_SYM_DTYPE_FUNCTION
A function that returns a base type.
Definition: COFF.h:275
@ SCT_COMPLEX_TYPE_SHIFT
Type is formed as (base + (derived << SCT_COMPLEX_TYPE_SHIFT))
Definition: COFF.h:279
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:480
uint16_t Machine
Definition: COFF.h:80
uint32_t NumberOfSymbols
Definition: COFF.h:89
uint32_t unused4
Definition: COFF.h:86
uint32_t PointerToSymbolTable
Definition: COFF.h:88
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:77
uint32_t unused1
Definition: COFF.h:83
uint32_t unused3
Definition: COFF.h:85
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:78
uint32_t TimeDateStamp
Definition: COFF.h:81
uint16_t Version
Definition: COFF.h:79
uint32_t unused2
Definition: COFF.h:84
uint32_t NumberOfSections
Definition: COFF.h:87
The DOS compatible header at the front of all PEs.
Definition: COFF.h:565
uint16_t UsedBytesInTheLastPage
Definition: COFF.h:567
uint16_t Reserved[4]
Definition: COFF.h:580
uint16_t InitialRelativeCS
Definition: COFF.h:577
uint16_t NumberOfRelocationItems
Definition: COFF.h:569
uint16_t MinimumExtraParagraphs
Definition: COFF.h:571
uint16_t Reserved2[10]
Definition: COFF.h:583
uint16_t FileSizeInPages
Definition: COFF.h:568
uint16_t Checksum
Definition: COFF.h:575
uint16_t MaximumExtraParagraphs
Definition: COFF.h:572
uint16_t InitialRelativeSS
Definition: COFF.h:573
uint32_t AddressOfNewExeHeader
Definition: COFF.h:584
uint16_t InitialSP
Definition: COFF.h:574
uint16_t OEMinfo
Definition: COFF.h:582
uint16_t Magic
Definition: COFF.h:566
uint16_t InitialIP
Definition: COFF.h:576
uint16_t HeaderSizeInParagraphs
Definition: COFF.h:570
uint16_t OverlayNumber
Definition: COFF.h:579
uint16_t AddressOfRelocationTable
Definition: COFF.h:578
uint16_t OEMid
Definition: COFF.h:581
uint32_t RelativeVirtualAddress
Definition: COFF.h:625
The Import Directory Table.
Definition: COFF.h:520
ImportNameType getNameType() const
Definition: COFF.h:815
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:804
ImportType getType() const
Definition: COFF.h:813
uint16_t OrdinalHint
Definition: COFF.h:810
uint32_t TimeDateStamp
Definition: COFF.h:808
uint32_t SizeOfData
Definition: COFF.h:809
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:805
The PE32 Import Lookup Table.
Definition: COFF.h:536
uint32_t getHintNameRVA() const
Get the Hint/Name entry RVA. isOrdinal must be false.
Definition: COFF.h:555
void setHintNameRVA(uint32_t rva)
Set the Hint/Name entry RVA and set isOrdinal to false.
Definition: COFF.h:561
void setOrdinal(uint16_t o)
Set the ordinal value and set isOrdinal to true.
Definition: COFF.h:549
uint16_t getOrdinal() const
Get the ordinal value of this entry. isOrdinal must be true.
Definition: COFF.h:543
bool isOrdinal() const
Is this entry specified by ordinal, or name?
Definition: COFF.h:540
uint32_t SizeOfImage
Definition: COFF.h:609
uint32_t SizeOfCode
Definition: COFF.h:593
uint32_t AddressOfEntryPoint
Definition: COFF.h:596
uint32_t SizeOfUninitializedData
Definition: COFF.h:595
uint32_t SizeOfInitializedData
Definition: COFF.h:594
uint32_t FileAlignment
Definition: COFF.h:601
uint16_t Magic
Definition: COFF.h:590
uint64_t SizeOfStackCommit
Definition: COFF.h:616
uint32_t LoaderFlags
Definition: COFF.h:619
uint32_t CheckSum
Definition: COFF.h:611
uint8_t MajorLinkerVersion
Definition: COFF.h:591
uint64_t SizeOfHeapReserve
Definition: COFF.h:617
uint16_t MinorOperatingSystemVersion
Definition: COFF.h:603
uint64_t ImageBase
Definition: COFF.h:599
uint32_t Win32VersionValue
Definition: COFF.h:608
uint16_t MajorSubsystemVersion
Definition: COFF.h:606
uint16_t MinorImageVersion
Definition: COFF.h:605
uint16_t MajorOperatingSystemVersion
Definition: COFF.h:602
uint16_t DLLCharacteristics
Definition: COFF.h:614
uint64_t SizeOfStackReserve
Definition: COFF.h:615
uint16_t MinorSubsystemVersion
Definition: COFF.h:607
uint32_t SectionAlignment
Definition: COFF.h:600
uint16_t MajorImageVersion
Definition: COFF.h:604
uint32_t NumberOfRvaAndSize
Definition: COFF.h:621
uint8_t MinorLinkerVersion
Definition: COFF.h:592
uint16_t Subsystem
Definition: COFF.h:612
uint32_t SizeOfHeaders
Definition: COFF.h:610
uint64_t SizeOfHeapCommit
Definition: COFF.h:618
uint32_t BaseOfData
Definition: COFF.h:598
uint32_t BaseOfCode
Definition: COFF.h:597
uint16_t Machine
Definition: COFF.h:65
uint32_t TimeDateStamp
Definition: COFF.h:67
uint16_t SizeOfOptionalHeader
Definition: COFF.h:70
uint32_t NumberOfSymbols
Definition: COFF.h:69
int32_t NumberOfSections
Definition: COFF.h:66
uint16_t Characteristics
Definition: COFF.h:71
uint32_t PointerToSymbolTable
Definition: COFF.h:68
uint32_t VirtualAddress
Definition: COFF.h:340
uint32_t SymbolTableIndex
Definition: COFF.h:341
uint32_t VirtualSize
Definition: COFF.h:286
uint32_t PointerToRelocations
Definition: COFF.h:290
uint16_t NumberOfLineNumbers
Definition: COFF.h:293
uint32_t PointerToRawData
Definition: COFF.h:289
uint32_t SizeOfRawData
Definition: COFF.h:288
uint32_t Characteristics
Definition: COFF.h:294
uint16_t NumberOfRelocations
Definition: COFF.h:292
char Name[NameSize]
Definition: COFF.h:285
uint32_t VirtualAddress
Definition: COFF.h:287
uint32_t PointerToLineNumbers
Definition: COFF.h:291
uint8_t StorageClass
Definition: COFF.h:206
int32_t SectionNumber
Definition: COFF.h:204
uint8_t NumberOfAuxSymbols
Definition: COFF.h:207
uint16_t Type
Definition: COFF.h:205
uint32_t Value
Definition: COFF.h:203
char Name[NameSize]
Definition: COFF.h:202
AuxiliarybfAndefSymbol bfAndefSymbol
Definition: COFF.h:512
AuxiliaryFunctionDefinition FunctionDefinition
Definition: COFF.h:511
AuxiliarySectionDefinition SectionDefinition
Definition: COFF.h:514
AuxiliaryWeakExternal WeakExternal
Definition: COFF.h:513