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