2 AcessOS/AcessBasic v1
\r
10 PE_MACHINE_I386 = 0x14c, // Intel 386+
\r
11 PE_MACHINE_IA64 = 0x200 // Intel-64
\r
17 PE_DIR_RESOURCE, // 2
\r
18 PE_DIR_EXCEPTION, // 3
\r
19 PE_DIR_SECRURITY, // 4
\r
22 PE_DIR_COPYRIGHT, // 7
\r
23 PE_DIR_ARCHITECTURE,// 8
\r
24 PE_DIR_GLOBALPTR, // 9
\r
26 PE_DIR_LOAD_CFG, // 11
\r
27 PE_DIR_BOUND_IMPORT,// 12
\r
29 PE_DIR_DELAY_IMPORT,// 14
\r
30 PE_DIR_COM_DESCRIPTOR, //15
\r
40 Uint32 *ImportLookupTable; //0x80000000 is Ordninal Flag
\r
42 Uint32 FowarderChain;
\r
44 Uint32 *ImportAddressTable; // Array of Addresses - To be edited by loader
\r
52 Uint32 NameRVA; // DLL Name
\r
54 Uint32 NumAddresses;
\r
55 Uint32 NumNamePointers;
\r
57 Uint32 NamePointerRVA;
\r
58 Uint32 OrdinalTableRVA;
\r
63 char Name[]; // Zero Terminated String
\r
72 Uint32 RelocationsPtr; //Set to 0 in executables
\r
73 Uint32 LineNumberPtr; //Pointer to Line Numbers
\r
74 Uint16 RelocationCount; // Set to 0 in executables
\r
75 Uint16 LineNumberCount;
\r
77 } tPE_SECTION_HEADER;
\r
79 #define PE_SECTION_FLAG_CODE 0x00000020 // Section contains executable code.
\r
80 #define PE_SECTION_FLAG_IDATA 0x00000040 // Section contains initialized data.
\r
81 #define PE_SECTION_FLAG_UDATA 0x00000080 // Section contains uninitialized data.
\r
82 #define PE_SECTION_FLAG_DISCARDABLE 0x02000000 // Section can be discarded as needed.
\r
83 #define PE_SECTION_FLAG_MEM_NOT_CACHED 0x04000000 // Section cannot be cached.
\r
84 #define PE_SECTION_FLAG_MEM_NOT_PAGED 0x08000000 // Section is not pageable.
\r
85 #define PE_SECTION_FLAG_MEM_SHARED 0x10000000 // Section can be shared in memory.
\r
86 #define PE_SECTION_FLAG_MEM_EXECUTE 0x20000000 // Section can be executed as code.
\r
87 #define PE_SECTION_FLAG_MEM_READ 0x40000000 // Section can be read.
\r
88 #define PE_SECTION_FLAG_MEM_WRITE 0x80000000 // Section can be written to.
\r
99 Uint16 SectionCount;
\r
100 Uint32 CreationTimestamp;
\r
101 Uint32 SymbolTableOffs;
\r
102 Uint32 SymbolCount;
\r
103 Uint16 OptHeaderSize;
\r
108 Uint16 Magic; //0x10b: 32Bit, 0x20b: 64Bit
\r
109 Uint16 LinkerVersion;
\r
110 Uint32 CodeSize; //Sum of all Code Segment Sizes
\r
111 Uint32 DataSize; //Sum of all Intialised Data Segments
\r
112 Uint32 BssSize; //Sum of all Unintialised Data Segments
\r
116 Uint32 ImageBase; //Prefered Base Address
\r
117 Uint32 SectionAlignment;
\r
118 Uint32 FileAlignment;
\r
119 Uint32 WindowsVersion; //Unused/Irrelevent
\r
120 Uint32 ImageVersion; //Unused/Irrelevent
\r
121 Uint32 SubsystemVersion; //Unused, Set to 4
\r
122 Uint32 Win32Version; //Unused
\r
125 Uint32 Checksum; //Unknown Method, Can be set to 0
\r
126 Uint16 Subsystem; //Required Windows Subsystem (None, GUI, Console)
\r
128 Uint32 MaxStackSize; //Reserved Stack Size
\r
129 Uint32 InitialStackSize; //Commited Stack Size
\r
130 Uint32 InitialReservedHeap; // Reserved Heap Size
\r
131 Uint32 InitialCommitedHeap; // Commited Heap Size
\r
132 Uint32 LoaderFlags; // Obselete
\r
133 Uint32 NumberOfDirEntries;
\r
134 tPE_DATA_DIR Directory[16];
\r
140 tPE_FILE_HEADER FileHeader;
\r
141 tPE_OPT_HEADER OptHeader;
\r
142 } tPE_IMAGE_HEADERS;
\r
147 Uint32 PeHdrOffs; // File address of new exe header
\r