Tune the page sizes

This commit is contained in:
Justine Tunney 2023-07-24 00:49:06 -07:00
parent ff198e7577
commit 94ea34367a
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
12 changed files with 56 additions and 178 deletions

View file

@ -11,11 +11,43 @@ struct NtImageOptionalHeader {
uint32_t SizeOfCode;
uint32_t SizeOfInitializedData;
uint32_t SizeOfUninitializedData;
/*
* The address of the entry point relative to the image base when the
* executable file is loaded into memory. For program images, this is
* the starting address. For device drivers, this is the address of
* the initialization function. An entry point is optional for DLLs.
* When no entry point is present, this field must be zero.
*/
uint32_t AddressOfEntryPoint;
uint32_t BaseOfCode;
/*
* The preferred address of the first byte of image when loaded into
* memory; must be a multiple of 64 K. The default for DLLs is
* 0x10000000. The default for Windows CE EXEs is 0x00010000. The
* default for Windows NT, Windows 2000, Windows XP, Windows 95,
* Windows 98, and Windows Me is 0x00400000.
*/
uint64_t ImageBase;
/*
* The alignment (in bytes) of sections when they are loaded into
* memory. It must be greater than or equal to FileAlignment. The
* default is the page size for the architecture.
*/
uint32_t SectionAlignment;
/*
* The alignment factor (in bytes) that is used to align the raw data
* of sections in the image file. The value should be a power of 2
* between 512 and 64 K, inclusive. The default is 512. If the
* SectionAlignment is less than the architecture's page size, then
* FileAlignment must match SectionAlignment.
*/
uint32_t FileAlignment;
uint16_t MajorOperatingSystemVersion;
uint16_t MinorOperatingSystemVersion;
uint16_t MajorImageVersion;
@ -34,7 +66,7 @@ struct NtImageOptionalHeader {
uint64_t SizeOfHeapCommit;
uint32_t LoaderFlags;
uint32_t NumberOfRvaAndSizes;
struct NtImageDataDirectory DataDirectory[kNtImageNumberofDirectoryEntries];
struct NtImageDataDirectory DataDirectory[];
};
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */