19 #ifndef __PE_IMAGE_H__ 20 #define __PE_IMAGE_H__ 27 #define EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION 10 28 #define EFI_IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 29 #define EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 30 #define EFI_IMAGE_SUBSYSTEM_SAL_RUNTIME_DRIVER 13 35 #define IMAGE_FILE_MACHINE_I386 0x014c 36 #define IMAGE_FILE_MACHINE_IA64 0x0200 37 #define IMAGE_FILE_MACHINE_EBC 0x0EBC 38 #define IMAGE_FILE_MACHINE_X64 0x8664 39 #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2 40 #define IMAGE_FILE_MACHINE_ARM64 0xAA64 41 #define IMAGE_FILE_MACHINE_RISCV32 0x5032 42 #define IMAGE_FILE_MACHINE_RISCV64 0x5064 43 #define IMAGE_FILE_MACHINE_RISCV128 0x5128 44 #define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232 45 #define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264 50 #define EFI_IMAGE_DOS_SIGNATURE SIGNATURE_16('M', 'Z') 51 #define EFI_IMAGE_OS2_SIGNATURE SIGNATURE_16('N', 'E') 52 #define EFI_IMAGE_OS2_SIGNATURE_LE SIGNATURE_16('L', 'E') 53 #define EFI_IMAGE_NT_SIGNATURE SIGNATURE_32('P', 'E', '\0', '\0') 97 #define EFI_IMAGE_SIZEOF_FILE_HEADER 20 102 #define EFI_IMAGE_FILE_RELOCS_STRIPPED BIT0 103 #define EFI_IMAGE_FILE_EXECUTABLE_IMAGE BIT1
104 #define EFI_IMAGE_FILE_LINE_NUMS_STRIPPED BIT2
105 #define EFI_IMAGE_FILE_LOCAL_SYMS_STRIPPED BIT3
106 #define EFI_IMAGE_FILE_LARGE_ADDRESS_AWARE BIT5
107 #define EFI_IMAGE_FILE_BYTES_REVERSED_LO BIT7
108 #define EFI_IMAGE_FILE_32BIT_MACHINE BIT8
109 #define EFI_IMAGE_FILE_DEBUG_STRIPPED BIT9
110 #define EFI_IMAGE_FILE_SYSTEM BIT12
111 #define EFI_IMAGE_FILE_DLL BIT13
112 #define EFI_IMAGE_FILE_BYTES_REVERSED_HI BIT15
125 #define EFI_IMAGE_DIRECTORY_ENTRY_EXPORT 0 126 #define EFI_IMAGE_DIRECTORY_ENTRY_IMPORT 1 127 #define EFI_IMAGE_DIRECTORY_ENTRY_RESOURCE 2 128 #define EFI_IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 129 #define EFI_IMAGE_DIRECTORY_ENTRY_SECURITY 4 130 #define EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC 5 131 #define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG 6 132 #define EFI_IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 133 #define EFI_IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 134 #define EFI_IMAGE_DIRECTORY_ENTRY_TLS 9 135 #define EFI_IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 137 #define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES 16 145 #define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b 196 #define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b 250 #define EFI_IMAGE_SIZEOF_NT_OPTIONAL32_HEADER sizeof (EFI_IMAGE_NT_HEADERS32) 262 #define EFI_IMAGE_SIZEOF_NT_OPTIONAL64_HEADER sizeof (EFI_IMAGE_NT_HEADERS64) 267 #define EFI_IMAGE_SUBSYSTEM_UNKNOWN 0 268 #define EFI_IMAGE_SUBSYSTEM_NATIVE 1 269 #define EFI_IMAGE_SUBSYSTEM_WINDOWS_GUI 2 270 #define EFI_IMAGE_SUBSYSTEM_WINDOWS_CUI 3 271 #define EFI_IMAGE_SUBSYSTEM_OS2_CUI 5 272 #define EFI_IMAGE_SUBSYSTEM_POSIX_CUI 7 277 #define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA 0x0020 278 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040 279 #define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080 280 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100 281 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 282 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 283 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 284 #define IMAGE_DLLCHARACTERISTICS_APPCONTAINER 0x1000 285 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 286 #define IMAGE_DLLCHARACTERISTICS_GUARD_CF 0x4000 287 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 292 #define EFI_IMAGE_SIZEOF_SHORT_NAME 8 316 #define EFI_IMAGE_SIZEOF_SECTION_HEADER 40 321 #define EFI_IMAGE_SCN_TYPE_NO_PAD BIT3 322 #define EFI_IMAGE_SCN_CNT_CODE BIT5
323 #define EFI_IMAGE_SCN_CNT_INITIALIZED_DATA BIT6
324 #define EFI_IMAGE_SCN_CNT_UNINITIALIZED_DATA BIT7
326 #define EFI_IMAGE_SCN_LNK_OTHER BIT8 327 #define EFI_IMAGE_SCN_LNK_INFO BIT9
328 #define EFI_IMAGE_SCN_LNK_REMOVE BIT11
329 #define EFI_IMAGE_SCN_LNK_COMDAT BIT12
331 #define EFI_IMAGE_SCN_ALIGN_1BYTES BIT20 332 #define EFI_IMAGE_SCN_ALIGN_2BYTES BIT21
333 #define EFI_IMAGE_SCN_ALIGN_4BYTES (BIT20|BIT21)
334 #define EFI_IMAGE_SCN_ALIGN_8BYTES BIT22
335 #define EFI_IMAGE_SCN_ALIGN_16BYTES (BIT20|BIT22)
336 #define EFI_IMAGE_SCN_ALIGN_32BYTES (BIT21|BIT22)
337 #define EFI_IMAGE_SCN_ALIGN_64BYTES (BIT20|BIT21|BIT22)
339 #define EFI_IMAGE_SCN_MEM_DISCARDABLE BIT25 340 #define EFI_IMAGE_SCN_MEM_NOT_CACHED BIT26
341 #define EFI_IMAGE_SCN_MEM_NOT_PAGED BIT27
342 #define EFI_IMAGE_SCN_MEM_SHARED BIT28
343 #define EFI_IMAGE_SCN_MEM_EXECUTE BIT29
344 #define EFI_IMAGE_SCN_MEM_READ BIT30
345 #define EFI_IMAGE_SCN_MEM_WRITE BIT31
350 #define EFI_IMAGE_SIZEOF_SYMBOL 18 356 #define EFI_IMAGE_SYM_UNDEFINED (UINT16) 0 357 #define EFI_IMAGE_SYM_ABSOLUTE (UINT16) -1
358 #define EFI_IMAGE_SYM_DEBUG (UINT16) -2
363 #define EFI_IMAGE_SYM_TYPE_NULL 0 364 #define EFI_IMAGE_SYM_TYPE_VOID 1
365 #define EFI_IMAGE_SYM_TYPE_CHAR 2
366 #define EFI_IMAGE_SYM_TYPE_SHORT 3
367 #define EFI_IMAGE_SYM_TYPE_INT 4
368 #define EFI_IMAGE_SYM_TYPE_LONG 5 369 #define EFI_IMAGE_SYM_TYPE_FLOAT 6 370 #define EFI_IMAGE_SYM_TYPE_DOUBLE 7 371 #define EFI_IMAGE_SYM_TYPE_STRUCT 8 372 #define EFI_IMAGE_SYM_TYPE_UNION 9 373 #define EFI_IMAGE_SYM_TYPE_ENUM 10 374 #define EFI_IMAGE_SYM_TYPE_MOE 11
375 #define EFI_IMAGE_SYM_TYPE_BYTE 12
376 #define EFI_IMAGE_SYM_TYPE_WORD 13 377 #define EFI_IMAGE_SYM_TYPE_UINT 14 378 #define EFI_IMAGE_SYM_TYPE_DWORD 15 383 #define EFI_IMAGE_SYM_DTYPE_NULL 0 384 #define EFI_IMAGE_SYM_DTYPE_POINTER 1
385 #define EFI_IMAGE_SYM_DTYPE_FUNCTION 2 386 #define EFI_IMAGE_SYM_DTYPE_ARRAY 3 391 #define EFI_IMAGE_SYM_CLASS_END_OF_FUNCTION ((UINT8) -1) 392 #define EFI_IMAGE_SYM_CLASS_NULL 0 393 #define EFI_IMAGE_SYM_CLASS_AUTOMATIC 1 394 #define EFI_IMAGE_SYM_CLASS_EXTERNAL 2 395 #define EFI_IMAGE_SYM_CLASS_STATIC 3 396 #define EFI_IMAGE_SYM_CLASS_REGISTER 4 397 #define EFI_IMAGE_SYM_CLASS_EXTERNAL_DEF 5 398 #define EFI_IMAGE_SYM_CLASS_LABEL 6 399 #define EFI_IMAGE_SYM_CLASS_UNDEFINED_LABEL 7 400 #define EFI_IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8 401 #define EFI_IMAGE_SYM_CLASS_ARGUMENT 9 402 #define EFI_IMAGE_SYM_CLASS_STRUCT_TAG 10 403 #define EFI_IMAGE_SYM_CLASS_MEMBER_OF_UNION 11 404 #define EFI_IMAGE_SYM_CLASS_UNION_TAG 12 405 #define EFI_IMAGE_SYM_CLASS_TYPE_DEFINITION 13 406 #define EFI_IMAGE_SYM_CLASS_UNDEFINED_STATIC 14 407 #define EFI_IMAGE_SYM_CLASS_ENUM_TAG 15 408 #define EFI_IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16 409 #define EFI_IMAGE_SYM_CLASS_REGISTER_PARAM 17 410 #define EFI_IMAGE_SYM_CLASS_BIT_FIELD 18 411 #define EFI_IMAGE_SYM_CLASS_BLOCK 100 412 #define EFI_IMAGE_SYM_CLASS_FUNCTION 101 413 #define EFI_IMAGE_SYM_CLASS_END_OF_STRUCT 102 414 #define EFI_IMAGE_SYM_CLASS_FILE 103 415 #define EFI_IMAGE_SYM_CLASS_SECTION 104 416 #define EFI_IMAGE_SYM_CLASS_WEAK_EXTERNAL 105 421 #define EFI_IMAGE_N_BTMASK 017 422 #define EFI_IMAGE_N_TMASK 060 423 #define EFI_IMAGE_N_TMASK1 0300 424 #define EFI_IMAGE_N_TMASK2 0360 425 #define EFI_IMAGE_N_BTSHFT 4 426 #define EFI_IMAGE_N_TSHIFT 2 431 #define EFI_IMAGE_COMDAT_SELECT_NODUPLICATES 1 432 #define EFI_IMAGE_COMDAT_SELECT_ANY 2 433 #define EFI_IMAGE_COMDAT_SELECT_SAME_SIZE 3 434 #define EFI_IMAGE_COMDAT_SELECT_EXACT_MATCH 4 435 #define EFI_IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 440 #define EFI_IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 441 #define EFI_IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 442 #define EFI_IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 456 #define EFI_IMAGE_SIZEOF_RELOCATION 10 461 #define EFI_IMAGE_REL_I386_ABSOLUTE 0x0000 462 #define EFI_IMAGE_REL_I386_DIR16 0x0001
463 #define EFI_IMAGE_REL_I386_REL16 0x0002
464 #define EFI_IMAGE_REL_I386_DIR32 0x0006
465 #define EFI_IMAGE_REL_I386_DIR32NB 0x0007
466 #define EFI_IMAGE_REL_I386_SEG12 0x0009
467 #define EFI_IMAGE_REL_I386_SECTION 0x000A
468 #define EFI_IMAGE_REL_I386_SECREL 0x000B 469 #define EFI_IMAGE_REL_I386_REL32 0x0014 474 #define IMAGE_REL_AMD64_ABSOLUTE 0x0000 475 #define IMAGE_REL_AMD64_ADDR64 0x0001 476 #define IMAGE_REL_AMD64_ADDR32 0x0002 477 #define IMAGE_REL_AMD64_ADDR32NB 0x0003 478 #define IMAGE_REL_AMD64_REL32 0x0004 479 #define IMAGE_REL_AMD64_REL32_1 0x0005 480 #define IMAGE_REL_AMD64_REL32_2 0x0006 481 #define IMAGE_REL_AMD64_REL32_3 0x0007 482 #define IMAGE_REL_AMD64_REL32_4 0x0008 483 #define IMAGE_REL_AMD64_REL32_5 0x0009 484 #define IMAGE_REL_AMD64_SECTION 0x000A 485 #define IMAGE_REL_AMD64_SECREL 0x000B 486 #define IMAGE_REL_AMD64_SECREL7 0x000C 487 #define IMAGE_REL_AMD64_TOKEN 0x000D 488 #define IMAGE_REL_AMD64_SREL32 0x000E 489 #define IMAGE_REL_AMD64_PAIR 0x000F 490 #define IMAGE_REL_AMD64_SSPAN32 0x0010 503 #define EFI_IMAGE_SIZEOF_BASE_RELOCATION 8 508 #define EFI_IMAGE_REL_BASED_ABSOLUTE 0 509 #define EFI_IMAGE_REL_BASED_HIGH 1 510 #define EFI_IMAGE_REL_BASED_LOW 2 511 #define EFI_IMAGE_REL_BASED_HIGHLOW 3 512 #define EFI_IMAGE_REL_BASED_HIGHADJ 4 513 #define EFI_IMAGE_REL_BASED_MIPS_JMPADDR 5 514 #define EFI_IMAGE_REL_BASED_ARM_MOV32A 5 515 #define EFI_IMAGE_REL_BASED_ARM_MOV32T 7 516 #define EFI_IMAGE_REL_BASED_IA64_IMM64 9 517 #define EFI_IMAGE_REL_BASED_MIPS_JMPADDR16 9 518 #define EFI_IMAGE_REL_BASED_DIR64 10 523 #define EFI_IMAGE_REL_BASED_RISCV_HI20 5 524 #define EFI_IMAGE_REL_BASED_RISCV_LOW12I 7 525 #define EFI_IMAGE_REL_BASED_RISCV_LOW12S 8 530 #define EFI_IMAGE_REL_BASED_LOONGARCH32_MARK_LA 8 531 #define EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA 8 547 #define EFI_IMAGE_SIZEOF_LINENUMBER 6 552 #define EFI_IMAGE_ARCHIVE_START_SIZE 8 553 #define EFI_IMAGE_ARCHIVE_START "!<arch>\n" 554 #define EFI_IMAGE_ARCHIVE_END "`\n" 555 #define EFI_IMAGE_ARCHIVE_PAD "\n" 556 #define EFI_IMAGE_ARCHIVE_LINKER_MEMBER "/ " 557 #define EFI_IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " 575 #define EFI_IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 601 #define EFI_IMAGE_EXPORT_ORDINAL_BASE 1 602 #define EFI_IMAGE_EXPORT_ADDR_SIZE 4 603 #define EFI_IMAGE_EXPORT_ORDINAL_SIZE 2 624 #define EFI_IMAGE_ORDINAL_FLAG BIT31 625 #define EFI_IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & EFI_IMAGE_ORDINAL_FLAG) != 0)
626 #define EFI_IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff) 653 #define EFI_IMAGE_DEBUG_TYPE_CODEVIEW 2 654 #define EFI_IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS 20
659 #define CODEVIEW_SIGNATURE_NB10 SIGNATURE_32('N', 'B', '1', '0') 673 #define CODEVIEW_SIGNATURE_RSDS SIGNATURE_32('R', 'S', 'D', 'S') 689 #define CODEVIEW_SIGNATURE_MTOC SIGNATURE_32('M', 'T', 'O', 'C') 719 #define EFI_IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT 0x0001 720 #define EFI_IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT 0x0040 794 #define EFI_TE_IMAGE_HEADER_SIGNATURE SIGNATURE_16('V', 'Z') 799 #define EFI_TE_IMAGE_DIRECTORY_ENTRY_BASERELOC 0 800 #define EFI_TE_IMAGE_DIRECTORY_ENTRY_DEBUG 1
EFI_IMAGE_IMPORT_BY_NAME * AddressOfData
UINT32 DllCharacteristicsEx
UINT16 NumberOfNamedEntries
UINT32 AddressOfNameOrdinals
FILE_LICENCE(BSD2_PATENT)
128 bit buffer containing a unique identifier value.
UINT16 Linenumber
Line number.
Import Address Table RVA (Thunk Table).
UINT8 FrameRegisterOffset
Resource directory entry format.
UINT16_t Size
Size of structure.
Resource directory entry for string.
UINT32 FunctionEndAddress
#define EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES
UINT32 FileOffset
The file pointer to the debug data.
UINT32 AddressOfFunctions
EFI_IMAGE_THUNK_DATA * FirstThunk
unsigned long long UINT64
#define EFI_IMAGE_SIZEOF_SHORT_NAME
Length of ShortName.
Resource directory entry for data array.
UINT32 FunctionStartAddress
UINT32 SymbolTableIndex
Symbol table index of function name if Linenumber is 0.
UINT32 RVA
The address of the debug data when loaded, relative to the image base.
UINT32 VirtualAddress
Virtual address of line number.