UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
syms_pe.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2/* date = January 13th 2021 4:55 pm */
3
4#ifndef SYMS_PE_H
5#define SYMS_PE_H
6
7/*
8** NOTE(allen): Overview of PE format
9**
10** At the offset 0: DOS Magic Number, DOS Header
11** DOS Header contains a "pointer" to the COFF Header.
12**
13** Starting at the COFF Header the following are packed in order:
14** 1. PE Magic Number
15** 2. COFF Header (fixed size)
16** 3. COFF Optional Header (size determined by 1)
17** 4. Section Table (size determined by 1)
18**
19*/
20
22//~ allen: Generated
23
25
27//~ allen: DOS Header
28
29// this is the "MZ" as a 16-bit short
30#define SYMS_DOS_MAGIC 0x5a4d
31
33//~ allen: PE Magic Numbers
34
35#define SYMS_PE_MAGIC 0x00004550u
36#define SYMS_PE32_MAGIC 0x010bu
37#define SYMS_PE32PLUS_MAGIC 0x020bu
38
40//~ allen: .pdata
41
42// TODO(allen): renaming pass here.
50
51typedef struct SYMS_PeArmPdata{
53 // NOTE(allen):
54 // bits | meaning
55 // [0:7] | prolog length
56 // [8:29] | function length
57 // [30:30] | instructions_are_32bits (otherwise they are 16 bits)
58 // [31:31] | has_exception_handler
61
67
69//~ allen: Codeview Info
70
78
79#define SYMS_CODEVIEW_PDB20_MAGIC 0x3031424e
80#define SYMS_CODEVIEW_PDB70_MAGIC 0x53445352
81
89
90#pragma pack(push)
91typedef struct SYMS_PeCvHeaderPDB70{
95 // file name packed after struct
97#pragma pack(pop)
98
100//~ nick: Imports & Exports
101
109
111 // According to PE/COFF spec this field is unused and should be set zero,
112 // but when I compile mule with MSVC 2019 this is set to 1.
114 SYMS_U32 name_voff; // Name of the DLL
115 SYMS_U32 module_handle_voff; // Place where module handle from LoadLibrary is stored
117 SYMS_U32 name_table_voff; // Array of hint/name or oridnals
118 SYMS_U32 bound_table_voff; // (Optional) Points to an array of SYMS_PeThunkData
119 SYMS_U32 unload_table_voff; // (Optional) Copy of iat_voff
120 // 0 not bound
121 // -1 if bound and real timestamp located in bounded import directory
122 // Otherwise time when dll was bound
125
139
140#endif //SYMS_PE_H
Definition syms_pe.h:51
SYMS_U32 combined
Definition syms_pe.h:59
SYMS_U32 voff_first
Definition syms_pe.h:52
Definition syms_pe.h:82
SYMS_U32 time
Definition syms_pe.h:85
SYMS_U32 offset
Definition syms_pe.h:84
SYMS_U32 magic
Definition syms_pe.h:83
SYMS_U32 age
Definition syms_pe.h:86
Definition syms_pe.h:91
SYMS_U32 age
Definition syms_pe.h:94
SYMS_U32 magic
Definition syms_pe.h:92
SYMS_PeGuid guid
Definition syms_pe.h:93
Definition syms_pe.h:110
SYMS_U32 iat_voff
Definition syms_pe.h:116
SYMS_U32 attributes
Definition syms_pe.h:113
SYMS_U32 timestamp
Definition syms_pe.h:123
SYMS_U32 module_handle_voff
Definition syms_pe.h:115
SYMS_U32 name_voff
Definition syms_pe.h:114
SYMS_U32 bound_table_voff
Definition syms_pe.h:118
SYMS_U32 name_table_voff
Definition syms_pe.h:117
SYMS_U32 unload_table_voff
Definition syms_pe.h:119
Definition syms_pe.h:126
SYMS_U32 export_address_table_voff
Definition syms_pe.h:135
SYMS_U32 name_voff
Definition syms_pe.h:131
SYMS_U16 major_ver
Definition syms_pe.h:129
SYMS_U32 timestamp
Definition syms_pe.h:128
SYMS_U32 ordinal_table_voff
Definition syms_pe.h:137
SYMS_U32 export_address_table_count
Definition syms_pe.h:133
SYMS_U16 minor_ver
Definition syms_pe.h:130
SYMS_U32 ordinal_base
Definition syms_pe.h:132
SYMS_U32 name_pointer_table_voff
Definition syms_pe.h:136
SYMS_U32 flags
Definition syms_pe.h:127
SYMS_U32 name_pointer_table_count
Definition syms_pe.h:134
Definition syms_pe.h:71
SYMS_U32 data1
Definition syms_pe.h:72
SYMS_U16 data2
Definition syms_pe.h:73
SYMS_U8 data4[8]
Definition syms_pe.h:75
SYMS_U16 data3
Definition syms_pe.h:74
Definition syms_pe.h:102
SYMS_U32 import_addr_table_voff
Definition syms_pe.h:107
SYMS_U32 timestamp
Definition syms_pe.h:104
SYMS_U32 forwarder_chain
Definition syms_pe.h:105
SYMS_U32 lookup_table_voff
Definition syms_pe.h:103
SYMS_U32 name_voff
Definition syms_pe.h:106
Definition syms_pe.h:62
SYMS_U32 voff_one_past_last
Definition syms_pe.h:64
SYMS_U32 voff_unwind_info
Definition syms_pe.h:65
SYMS_U32 voff_first
Definition syms_pe.h:63
Definition syms_pe.h:43
SYMS_U32 voff_exception_handler
Definition syms_pe.h:46
SYMS_U32 voff_exception_handler_data
Definition syms_pe.h:47
SYMS_U32 voff_one_past_last
Definition syms_pe.h:45
SYMS_U32 voff_one_past_prolog
Definition syms_pe.h:48
SYMS_U32 voff_first
Definition syms_pe.h:44
#define SYMS_STATIC_ASSERT(c)
Definition syms_base.h:178
uint32_t SYMS_U32
Definition syms_crt_overrides.h:38
uint16_t SYMS_U16
Definition syms_crt_overrides.h:37
uint8_t SYMS_U8
Definition syms_crt_overrides.h:36