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
49 char Name[]; // Zero Term String
\r
58 Uint32 RelocationsPtr; //Set to 0 in executables
\r
59 Uint32 LineNumberPtr; //Pointer to Line Numbers
\r
60 Uint16 RelocationCount; // Set to 0 in executables
\r
61 Uint16 LineNumberCount;
\r
63 } tPE_SECTION_HEADER;
\r
65 #define PE_SECTION_FLAG_CODE 0x00000020 // Section contains executable code.
\r
66 #define PE_SECTION_FLAG_IDATA 0x00000040 // Section contains initialized data.
\r
67 #define PE_SECTION_FLAG_UDATA 0x00000080 // Section contains uninitialized data.
\r
68 #define PE_SECTION_FLAG_DISCARDABLE 0x02000000 // Section can be discarded as needed.
\r
69 #define PE_SECTION_FLAG_MEM_NOT_CACHED 0x04000000 // Section cannot be cached.
\r
70 #define PE_SECTION_FLAG_MEM_NOT_PAGED 0x08000000 // Section is not pageable.
\r
71 #define PE_SECTION_FLAG_MEM_SHARED 0x10000000 // Section can be shared in memory.
\r
72 #define PE_SECTION_FLAG_MEM_EXECUTE 0x20000000 // Section can be executed as code.
\r
73 #define PE_SECTION_FLAG_MEM_READ 0x40000000 // Section can be read.
\r
74 #define PE_SECTION_FLAG_MEM_WRITE 0x80000000 // Section can be written to.
\r
85 Uint16 SectionCount;
\r
86 Uint32 CreationTimestamp;
\r
87 Uint32 SymbolTableOffs;
\r
89 Uint16 OptHeaderSize;
\r
94 Uint16 Magic; //0x10b: 32Bit, 0x20b: 64Bit
\r
95 Uint16 LinkerVersion;
\r
96 Uint32 CodeSize; //Sum of all Code Segment Sizes
\r
97 Uint32 DataSize; //Sum of all Intialised Data Segments
\r
98 Uint32 BssSize; //Sum of all Unintialised Data Segments
\r
102 Uint32 ImageBase; //Prefered Base Address
\r
103 Uint32 SectionAlignment;
\r
104 Uint32 FileAlignment;
\r
105 Uint32 WindowsVersion; //Unused/Irrelevent
\r
106 Uint32 ImageVersion; //Unused/Irrelevent
\r
107 Uint32 SubsystemVersion; //Unused, Set to 4
\r
108 Uint32 Win32Version; //Unused
\r
111 Uint32 Checksum; //Unknown Method, Can be set to 0
\r
112 Uint16 Subsystem; //Required Windows Subsystem (None, GUI, Console)
\r
114 Uint32 MaxStackSize; //Reserved Stack Size
\r
115 Uint32 InitialStackSize; //Commited Stack Size
\r
116 Uint32 InitialReservedHeap; // Reserved Heap Size
\r
117 Uint32 InitialCommitedHeap; // Commited Heap Size
\r
118 Uint32 LoaderFlags; // Obselete
\r
119 Uint32 NumberOfDirEntries;
\r
120 tPE_DATA_DIR Directory[16];
\r
126 tPE_FILE_HEADER FileHeader;
\r
127 tPE_OPT_HEADER OptHeader;
\r
128 } tPE_IMAGE_HEADERS;
\r
133 Uint32 PeHdrOffs; // File address of new exe header
\r