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.
82 uint8_t UUID[16];
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 DynamicRelocationType : unsigned {
427};
428
429enum Arm64XFixupType : uint8_t {
433};
434
435enum COMDATType : uint8_t {
444
445// Auxiliary Symbol Formats
451 char unused[2];
452};
453
455 uint8_t unused1[4];
457 uint8_t unused2[6];
459 uint8_t unused3[2];
460};
461
465 uint8_t unused[10];
466};
467
474
481 uint8_t Selection;
482 char unused;
483};
484
486 uint8_t AuxType;
487 uint8_t unused1;
489 char unused2[12];
490};
491
497};
498
499/// The Import Directory Table.
500///
501/// There is a single array of these and one entry per imported DLL.
508};
509
510/// The PE32 Import Lookup Table.
511///
512/// There is an array of these for each imported DLL. It represents either
513/// the ordinal to import from the target DLL, or a name to lookup and import
514/// from the target DLL.
515///
516/// This also happens to be the same format used by the Import Address Table
517/// when it is initially written out to the image.
520
521 /// Is this entry specified by ordinal, or name?
522 bool isOrdinal() const { return data & 0x80000000; }
523
524 /// Get the ordinal value of this entry. isOrdinal must be true.
526 assert(isOrdinal() && "ILT entry is not an ordinal!");
527 return data & 0xFFFF;
528 }
529
530 /// Set the ordinal value and set isOrdinal to true.
532 data = o;
533 data |= 0x80000000;
534 }
535
536 /// Get the Hint/Name entry RVA. isOrdinal must be false.
538 assert(!isOrdinal() && "ILT entry is not a Hint/Name RVA!");
539 return data;
540 }
541
542 /// Set the Hint/Name entry RVA and set isOrdinal to false.
543 void setHintNameRVA(uint32_t rva) { data = rva; }
544};
545
546/// The DOS compatible header at the front of all PEs.
547struct DOSHeader {
567};
568
570 enum { PE32 = 0x10b, PE32_PLUS = 0x20b };
571
595 // FIXME: This should be DllCharacteristics to match the COFF spec.
602 // FIXME: This should be NumberOfRvaAndSizes to match the COFF spec.
604};
605
609};
610
611enum DataDirectoryIndex : unsigned {
627
630
631enum WindowsSubsystem : unsigned {
632 IMAGE_SUBSYSTEM_UNKNOWN = 0, ///< An unknown subsystem.
633 IMAGE_SUBSYSTEM_NATIVE = 1, ///< Device drivers and native Windows processes
634 IMAGE_SUBSYSTEM_WINDOWS_GUI = 2, ///< The Windows GUI subsystem.
635 IMAGE_SUBSYSTEM_WINDOWS_CUI = 3, ///< The Windows character subsystem.
636 IMAGE_SUBSYSTEM_OS2_CUI = 5, ///< The OS/2 character subsystem.
637 IMAGE_SUBSYSTEM_POSIX_CUI = 7, ///< The POSIX character subsystem.
638 IMAGE_SUBSYSTEM_NATIVE_WINDOWS = 8, ///< Native Windows 9x driver.
639 IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9, ///< Windows CE.
640 IMAGE_SUBSYSTEM_EFI_APPLICATION = 10, ///< An EFI application.
641 IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, ///< An EFI driver with boot
642 /// services.
643 IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, ///< An EFI driver with run-time
644 /// services.
645 IMAGE_SUBSYSTEM_EFI_ROM = 13, ///< An EFI ROM image.
646 IMAGE_SUBSYSTEM_XBOX = 14, ///< XBOX.
647 IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16 ///< A BCD application.
649
650enum DLLCharacteristics : unsigned {
651 /// ASLR with 64 bit address space.
653 /// DLL can be relocated at load time.
655 /// Code integrity checks are enforced.
657 ///< Image is NX compatible.
659 /// Isolation aware, but do not isolate the image.
661 /// Does not use structured exception handling (SEH). No SEH handler may be
662 /// called in this image.
664 /// Do not bind the image.
666 ///< Image should execute in an AppContainer.
668 ///< A WDM driver.
670 ///< Image supports Control Flow Guard.
672 /// Terminal Server aware.
675
677 /// Image is CET compatible
680
681enum DebugType : unsigned {
700};
701
702enum BaseRelocationType : unsigned {
714
715enum ImportType : unsigned {
718 IMPORT_CONST = 2
720
721enum ImportNameType : unsigned {
722 /// Import is by ordinal. This indicates that the value in the Ordinal/Hint
723 /// field of the import header is the import's ordinal. If this constant is
724 /// not specified, then the Ordinal/Hint field should always be interpreted
725 /// as the import's hint.
727 /// The import name is identical to the public symbol name
729 /// The import name is the public symbol name, but skipping the leading ?,
730 /// @, or optionally _.
732 /// The import name is the public symbol name, but skipping the leading ?,
733 /// @, or optionally _, and truncating at the first @.
735 /// The import name is specified as a separate string in the import library
736 /// object file.
739
740enum class GuardFlags : uint32_t {
741 /// Module performs control flow integrity checks using system-supplied
742 /// support.
743 CF_INSTRUMENTED = 0x100,
744 /// Module performs control flow and write integrity checks.
745 CFW_INSTRUMENTED = 0x200,
746 /// Module contains valid control flow target metadata.
748 /// Module does not make use of the /GS security cookie.
750 /// Module supports read only delay load IAT.
751 PROTECT_DELAYLOAD_IAT = 0x1000,
752 /// Delayload import table in its own .didat section (with nothing else in it)
753 /// that can be freely reprotected.
755 /// Module contains suppressed export information. This also infers that the
756 /// address taken IAT table is also present in the load config.
758 /// Module enables suppression of exports.
760 /// Module contains longjmp target information.
762 /// Module contains EH continuation target information.
764 /// Mask for the subfield that contains the stride of Control Flow Guard
765 /// function table entries (that is, the additional count of bytes per table
766 /// entry).
767 CF_FUNCTION_TABLE_SIZE_MASK = 0xF0000000,
783};
784
786 uint16_t Sig1; ///< Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
787 uint16_t Sig2; ///< Must be 0xFFFF.
794
795 ImportType getType() const { return static_cast<ImportType>(TypeInfo & 0x3); }
796
798 return static_cast<ImportNameType>((TypeInfo & 0x1C) >> 2);
799 }
800};
801
806
807// These flags show up in the @feat.00 symbol. They appear to be some kind of
808// compiler features bitfield read by link.exe.
810 // Object is compatible with /safeseh.
811 SafeSEH = 0x1,
812 // Object was compiled with /GS.
813 GuardStack = 0x100,
814 // Object was compiled with /sdl.
815 SDL = 0x200,
816 // Object was compiled with /guard:cf.
817 GuardCF = 0x800,
818 // Object was compiled with /guard:ehcont.
819 GuardEHCont = 0x4000,
820 // Object was compiled with /kernel.
821 Kernel = 0x40000000,
822};
823
824enum Arm64ECThunkType : uint8_t {
826 Entry = 1,
827 Exit = 4,
828};
829
830inline bool isReservedSectionNumber(int32_t SectionNumber) {
831 return SectionNumber <= 0;
832}
833
834/// Encode section name based on string table offset.
835/// The size of Out must be at least COFF::NameSize.
836bool encodeSectionName(char *Out, uint64_t Offset);
837
838} // End namespace COFF.
839} // End namespace llvm.
840
841#endif
COFF::MachineTypes Machine
Definition: COFFYAML.cpp:371
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:650
@ IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE
Terminal Server aware.
Definition: COFF.h:673
@ IMAGE_DLL_CHARACTERISTICS_GUARD_CF
Definition: COFF.h:671
@ IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
Isolation aware, but do not isolate the image.
Definition: COFF.h:660
@ IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
Definition: COFF.h:658
@ IMAGE_DLL_CHARACTERISTICS_WDM_DRIVER
Image supports Control Flow Guard.
Definition: COFF.h:669
@ IMAGE_DLL_CHARACTERISTICS_NO_BIND
Do not bind the image.
Definition: COFF.h:665
@ IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
Code integrity checks are enforced.
Definition: COFF.h:656
@ IMAGE_DLL_CHARACTERISTICS_APPCONTAINER
A WDM driver.
Definition: COFF.h:667
@ IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE
DLL can be relocated at load time.
Definition: COFF.h:654
@ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
ASLR with 64 bit address space.
Definition: COFF.h:652
@ IMAGE_DLL_CHARACTERISTICS_NO_SEH
Does not use structured exception handling (SEH).
Definition: COFF.h:663
AuxSymbolType
Definition: COFF.h:282
@ IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF
Definition: COFF.h:282
BaseRelocationType
Definition: COFF.h:702
@ IMAGE_REL_BASED_MIPS_JMPADDR16
Definition: COFF.h:711
@ IMAGE_REL_BASED_ARM_MOV32T
Definition: COFF.h:710
@ IMAGE_REL_BASED_ABSOLUTE
Definition: COFF.h:703
@ IMAGE_REL_BASED_MIPS_JMPADDR
Definition: COFF.h:708
@ IMAGE_REL_BASED_DIR64
Definition: COFF.h:712
@ IMAGE_REL_BASED_HIGH
Definition: COFF.h:704
@ IMAGE_REL_BASED_HIGHLOW
Definition: COFF.h:706
@ IMAGE_REL_BASED_HIGHADJ
Definition: COFF.h:707
@ IMAGE_REL_BASED_ARM_MOV32A
Definition: COFF.h:709
@ IMAGE_REL_BASED_LOW
Definition: COFF.h:705
DynamicRelocationType
Definition: COFF.h:420
@ IMAGE_DYNAMIC_RELOCATION_ARM64X
Definition: COFF.h:426
@ IMAGE_DYNAMIC_RELOCATION_GUARD_SWITCHTABLE_BRANCH
Definition: COFF.h:425
@ IMAGE_DYNAMIC_RELOCATION_GUARD_RF_EPILOGUE
Definition: COFF.h:422
@ IMAGE_DYNAMIC_RELOCATION_GUARD_INDIR_CONTROL_TRANSFER
Definition: COFF.h:424
@ IMAGE_DYNAMIC_RELOCATION_GUARD_IMPORT_CONTROL_TRANSFER
Definition: COFF.h:423
@ IMAGE_DYNAMIC_RELOCATION_GUARD_RF_PROLOGUE
Definition: COFF.h:421
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:715
@ IMPORT_CONST
Definition: COFF.h:718
@ IMPORT_CODE
Definition: COFF.h:716
@ IMPORT_DATA
Definition: COFF.h:717
@ 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
DebugType
Definition: COFF.h:681
@ IMAGE_DEBUG_TYPE_OMAP_FROM_SRC
Definition: COFF.h:690
@ IMAGE_DEBUG_TYPE_FIXUP
Definition: COFF.h:688
@ IMAGE_DEBUG_TYPE_REPRO
Definition: COFF.h:698
@ IMAGE_DEBUG_TYPE_ILTCG
Definition: COFF.h:696
@ IMAGE_DEBUG_TYPE_BORLAND
Definition: COFF.h:691
@ IMAGE_DEBUG_TYPE_COFF
Definition: COFF.h:683
@ IMAGE_DEBUG_TYPE_POGO
Definition: COFF.h:695
@ IMAGE_DEBUG_TYPE_VC_FEATURE
Definition: COFF.h:694
@ IMAGE_DEBUG_TYPE_CODEVIEW
Definition: COFF.h:684
@ IMAGE_DEBUG_TYPE_OMAP_TO_SRC
Definition: COFF.h:689
@ IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS
Definition: COFF.h:699
@ IMAGE_DEBUG_TYPE_MPX
Definition: COFF.h:697
@ IMAGE_DEBUG_TYPE_UNKNOWN
Definition: COFF.h:682
@ IMAGE_DEBUG_TYPE_FPO
Definition: COFF.h:685
@ IMAGE_DEBUG_TYPE_MISC
Definition: COFF.h:686
@ IMAGE_DEBUG_TYPE_EXCEPTION
Definition: COFF.h:687
@ IMAGE_DEBUG_TYPE_CLSID
Definition: COFF.h:693
@ IMAGE_DEBUG_TYPE_RESERVED10
Definition: COFF.h:692
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
GuardFlags
Definition: COFF.h:740
@ 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:611
@ ARCHITECTURE
Definition: COFF.h:619
@ IAT
Definition: COFF.h:624
@ CERTIFICATE_TABLE
Definition: COFF.h:616
@ TLS_TABLE
Definition: COFF.h:621
@ EXCEPTION_TABLE
Definition: COFF.h:615
@ GLOBAL_PTR
Definition: COFF.h:620
@ EXPORT_TABLE
Definition: COFF.h:612
@ LOAD_CONFIG_TABLE
Definition: COFF.h:622
@ IMPORT_TABLE
Definition: COFF.h:613
@ DELAY_IMPORT_DESCRIPTOR
Definition: COFF.h:625
@ CLR_RUNTIME_HEADER
Definition: COFF.h:626
@ RESOURCE_TABLE
Definition: COFF.h:614
@ DEBUG_DIRECTORY
Definition: COFF.h:618
@ BASE_RELOCATION_TABLE
Definition: COFF.h:617
@ NUM_DATA_DIRECTORIES
Definition: COFF.h:628
@ BOUND_IMPORT
Definition: COFF.h:623
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:429
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_VALUE
Definition: COFF.h:431
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_DELTA
Definition: COFF.h:432
@ IMAGE_DVRT_ARM64X_FIXUP_TYPE_ZEROFILL
Definition: COFF.h:430
ExtendedDLLCharacteristics
Definition: COFF.h:676
@ IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
Image is CET compatible.
Definition: COFF.h:678
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:631
@ IMAGE_SUBSYSTEM_EFI_APPLICATION
An EFI application.
Definition: COFF.h:640
@ IMAGE_SUBSYSTEM_WINDOWS_CUI
The Windows character subsystem.
Definition: COFF.h:635
@ IMAGE_SUBSYSTEM_WINDOWS_CE_GUI
Windows CE.
Definition: COFF.h:639
@ IMAGE_SUBSYSTEM_XBOX
XBOX.
Definition: COFF.h:646
@ IMAGE_SUBSYSTEM_UNKNOWN
An unknown subsystem.
Definition: COFF.h:632
@ IMAGE_SUBSYSTEM_OS2_CUI
The OS/2 character subsystem.
Definition: COFF.h:636
@ IMAGE_SUBSYSTEM_NATIVE_WINDOWS
Native Windows 9x driver.
Definition: COFF.h:638
@ IMAGE_SUBSYSTEM_EFI_ROM
An EFI ROM image.
Definition: COFF.h:645
@ IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER
An EFI driver with run-time services.
Definition: COFF.h:643
@ IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER
An EFI driver with boot services.
Definition: COFF.h:641
@ IMAGE_SUBSYSTEM_POSIX_CUI
The POSIX character subsystem.
Definition: COFF.h:637
@ IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION
A BCD application.
Definition: COFF.h:647
@ IMAGE_SUBSYSTEM_WINDOWS_GUI
The Windows GUI subsystem.
Definition: COFF.h:634
@ IMAGE_SUBSYSTEM_NATIVE
Device drivers and native Windows processes.
Definition: COFF.h:633
static const char WinResMagic[]
Definition: COFF.h:48
COMDATType
Definition: COFF.h:435
@ IMAGE_COMDAT_SELECT_NODUPLICATES
Definition: COFF.h:436
@ IMAGE_COMDAT_SELECT_LARGEST
Definition: COFF.h:441
@ IMAGE_COMDAT_SELECT_NEWEST
Definition: COFF.h:442
@ IMAGE_COMDAT_SELECT_SAME_SIZE
Definition: COFF.h:438
@ IMAGE_COMDAT_SELECT_ASSOCIATIVE
Definition: COFF.h:440
@ IMAGE_COMDAT_SELECT_EXACT_MATCH
Definition: COFF.h:439
@ IMAGE_COMDAT_SELECT_ANY
Definition: COFF.h:437
WeakExternalCharacteristics
Definition: COFF.h:468
@ IMAGE_WEAK_EXTERN_SEARCH_ALIAS
Definition: COFF.h:471
@ IMAGE_WEAK_EXTERN_ANTI_DEPENDENCY
Definition: COFF.h:472
@ IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY
Definition: COFF.h:469
@ IMAGE_WEAK_EXTERN_SEARCH_LIBRARY
Definition: COFF.h:470
CodeViewIdentifiers
Definition: COFF.h:802
@ DEBUG_HASHES_SECTION_MAGIC
Definition: COFF.h:804
@ DEBUG_SECTION_MAGIC
Definition: COFF.h:803
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:721
@ IMPORT_ORDINAL
Import is by ordinal.
Definition: COFF.h:726
@ IMPORT_NAME_EXPORTAS
The import name is specified as a separate string in the import library object file.
Definition: COFF.h:737
@ IMPORT_NAME
The import name is identical to the public symbol name.
Definition: COFF.h:728
@ IMPORT_NAME_UNDECORATE
The import name is the public symbol name, but skipping the leading ?, @, or optionally _,...
Definition: COFF.h:734
@ IMPORT_NAME_NOPREFIX
The import name is the public symbol name, but skipping the leading ?, @, or optionally _.
Definition: COFF.h:731
bool isReservedSectionNumber(int32_t SectionNumber)
Definition: COFF.h:830
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:824
@ GuestExit
Definition: COFF.h:825
@ Entry
Definition: COFF.h:826
@ Exit
Definition: COFF.h:827
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:809
@ SafeSEH
Definition: COFF.h:811
@ GuardEHCont
Definition: COFF.h:819
@ SDL
Definition: COFF.h:815
@ GuardStack
Definition: COFF.h:813
@ GuardCF
Definition: COFF.h:817
@ Kernel
Definition: COFF.h:821
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:547
uint16_t UsedBytesInTheLastPage
Definition: COFF.h:549
uint16_t Reserved[4]
Definition: COFF.h:562
uint16_t InitialRelativeCS
Definition: COFF.h:559
uint16_t NumberOfRelocationItems
Definition: COFF.h:551
uint16_t MinimumExtraParagraphs
Definition: COFF.h:553
uint16_t Reserved2[10]
Definition: COFF.h:565
uint16_t FileSizeInPages
Definition: COFF.h:550
uint16_t Checksum
Definition: COFF.h:557
uint16_t MaximumExtraParagraphs
Definition: COFF.h:554
uint16_t InitialRelativeSS
Definition: COFF.h:555
uint32_t AddressOfNewExeHeader
Definition: COFF.h:566
uint16_t InitialSP
Definition: COFF.h:556
uint16_t OEMinfo
Definition: COFF.h:564
uint16_t Magic
Definition: COFF.h:548
uint16_t InitialIP
Definition: COFF.h:558
uint16_t HeaderSizeInParagraphs
Definition: COFF.h:552
uint16_t OverlayNumber
Definition: COFF.h:561
uint16_t AddressOfRelocationTable
Definition: COFF.h:560
uint16_t OEMid
Definition: COFF.h:563
uint32_t RelativeVirtualAddress
Definition: COFF.h:607
The Import Directory Table.
Definition: COFF.h:502
ImportNameType getNameType() const
Definition: COFF.h:797
uint16_t Sig1
Must be IMAGE_FILE_MACHINE_UNKNOWN (0).
Definition: COFF.h:786
ImportType getType() const
Definition: COFF.h:795
uint16_t OrdinalHint
Definition: COFF.h:792
uint32_t TimeDateStamp
Definition: COFF.h:790
uint32_t SizeOfData
Definition: COFF.h:791
uint16_t Sig2
Must be 0xFFFF.
Definition: COFF.h:787
The PE32 Import Lookup Table.
Definition: COFF.h:518
uint32_t getHintNameRVA() const
Get the Hint/Name entry RVA. isOrdinal must be false.
Definition: COFF.h:537
void setHintNameRVA(uint32_t rva)
Set the Hint/Name entry RVA and set isOrdinal to false.
Definition: COFF.h:543
void setOrdinal(uint16_t o)
Set the ordinal value and set isOrdinal to true.
Definition: COFF.h:531
uint16_t getOrdinal() const
Get the ordinal value of this entry. isOrdinal must be true.
Definition: COFF.h:525
bool isOrdinal() const
Is this entry specified by ordinal, or name?
Definition: COFF.h:522
uint32_t SizeOfImage
Definition: COFF.h:591
uint32_t SizeOfCode
Definition: COFF.h:575
uint32_t AddressOfEntryPoint
Definition: COFF.h:578
uint32_t SizeOfUninitializedData
Definition: COFF.h:577
uint32_t SizeOfInitializedData
Definition: COFF.h:576
uint32_t FileAlignment
Definition: COFF.h:583
uint16_t Magic
Definition: COFF.h:572
uint64_t SizeOfStackCommit
Definition: COFF.h:598
uint32_t LoaderFlags
Definition: COFF.h:601
uint32_t CheckSum
Definition: COFF.h:593
uint8_t MajorLinkerVersion
Definition: COFF.h:573
uint64_t SizeOfHeapReserve
Definition: COFF.h:599
uint16_t MinorOperatingSystemVersion
Definition: COFF.h:585
uint64_t ImageBase
Definition: COFF.h:581
uint32_t Win32VersionValue
Definition: COFF.h:590
uint16_t MajorSubsystemVersion
Definition: COFF.h:588
uint16_t MinorImageVersion
Definition: COFF.h:587
uint16_t MajorOperatingSystemVersion
Definition: COFF.h:584
uint16_t DLLCharacteristics
Definition: COFF.h:596
uint64_t SizeOfStackReserve
Definition: COFF.h:597
uint16_t MinorSubsystemVersion
Definition: COFF.h:589
uint32_t SectionAlignment
Definition: COFF.h:582
uint16_t MajorImageVersion
Definition: COFF.h:586
uint32_t NumberOfRvaAndSize
Definition: COFF.h:603
uint8_t MinorLinkerVersion
Definition: COFF.h:574
uint16_t Subsystem
Definition: COFF.h:594
uint32_t SizeOfHeaders
Definition: COFF.h:592
uint64_t SizeOfHeapCommit
Definition: COFF.h:600
uint32_t BaseOfData
Definition: COFF.h:580
uint32_t BaseOfCode
Definition: COFF.h:579
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:494
AuxiliaryFunctionDefinition FunctionDefinition
Definition: COFF.h:493
AuxiliarySectionDefinition SectionDefinition
Definition: COFF.h:496
AuxiliaryWeakExternal WeakExternal
Definition: COFF.h:495