RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
Microsoft::PEFormat::PEOptionalHeader Class Reference
Inheritance diagram for Microsoft::PEFormat::PEOptionalHeader:
COFF::COFFFormat::AOutHeader COFF::COFFFormat::OptionalHeader

Classes

struct  DataDirectory
 A data directory entry. More...
 
struct  version_type
 Represents a version entry with major and minor versions. More...
 

Public Types

enum  SubsystemType : uint16_t {
  Unknown = 0 , Native = 1 , WindowsGUI = 2 , WindowsCUI = 3 ,
  OS2CUI = 5 , POSIXCUI = 7 , NativeWin95 = 8 , WinCEGUI = 9 ,
  EFIApplication = 10 , EFIBootServiceDriver = 11 , EFIRuntimeDriver = 12 , EFIROM = 13 ,
  Xbox = 14 , WindowsBootApplication = 16
}
 
enum  {
  DirExportTable , DirImportTable , DirResourceTable , DirExceptionTable ,
  DirCertificateTable , DirBaseRelocationTable , DirDebug , DirArchitecture ,
  DirGlobalPointer , DirTLSTable , DirLoadConfigTable , DirBoundImport ,
  DirIAT , DirDelayImportDescriptor , DirCLRRuntimeHeader , DirReserved ,
  DirTotalCount
}
 

Public Member Functions

bool Is64Bit () const
 
uint32_t GetSize () const override
 Returns size of optional header.
 
void ReadFile (Linker::Reader &rd) override
 
void WriteFile (Linker::Writer &wr) const override
 
offset_t CalculateValues (COFFFormat &coff) override
 
- Public Member Functions inherited from COFF::COFFFormat::AOutHeader
 AOutHeader (uint16_t magic=0)
 
offset_t CalculateValues (COFFFormat &coff) override
 Sets up fields to be consistent.
 
void Dump (const COFFFormat &coff, Dumper::Dumper &dump) const override
 
- Public Member Functions inherited from COFF::COFFFormat::OptionalHeader
virtual void PostReadFile (COFFFormat &coff, Linker::Reader &rd)
 Retrieves any additional data from the file corresponding to this type of optional header.
 
virtual void PostWriteFile (const COFFFormat &coff, Linker::Writer &wr) const
 Stores any additional data in the file corresponding to this type of optional header.
 

Public Attributes

offset_t image_base = 0
 Preferred base address of image, all relative virtual addresses are calculate relative to this value.
 
uint32_t section_align = 0
 Section alignment.
 
uint32_t file_align = 0
 File alignment.
 
version_type os_version = { }
 Required operating system version.
 
version_type image_version = { }
 Binary image version.
 
version_type subsystem_version = { }
 Version of the subsystem.
 
uint32_t win32_version = 0
 Reserved value.
 
uint32_t total_image_size = 0
 Size of the entire image, including headers.
 
uint32_t total_headers_size = 0
 Cumulative size of all the headers, including the stub.
 
uint32_t checksum = 0
 Checksum.
 
SubsystemType subsystem = Unknown
 The Windows subsystem this program runs on.
 
uint16_t flags = 0
 DLL flags (in PE terminology, characteristics)
 
offset_t reserved_stack_size = 0
 How much of stack should be reserved at launch.
 
offset_t committed_stack_size = 0
 How many pages of stack are actually available at launch.
 
offset_t reserved_heap_size = 0
 How much of heap should be reserved at launch.
 
offset_t committed_heap_size = 0
 How many pages of heap are actually available at launch.
 
uint32_t loader_flags = 0
 Reserved.
 
std::vector< DataDirectorydata_directories
 PE specific areas in the file, each one has a specific purpose.
 
- Public Attributes inherited from COFF::COFFFormat::AOutHeader
uint16_t magic = 0
 Type of executable, most typically ZMAGIC (COFF name: magic)
 
uint16_t version_stamp = 0
 unused (COFF name: vstamp)
 
uint32_t code_size = 0
 unused (COFF name: tsize)
 
uint32_t data_size = 0
 unused (COFF name: dsize)
 
uint32_t bss_size = 0
 unused (COFF name: bsize)
 
uint32_t entry_address = 0
 Initial value of eip (COFF name: entry)
 
uint32_t code_address = 0
 unused (COFF name: text_start)
 
uint32_t data_address = 0
 unused (COFF name: data_start)
 

Static Public Attributes

static constexpr uint16_t ROM32 = 0x0107
 
static constexpr uint16_t EXE32 = 0x010B
 
static constexpr uint16_t EXE64 = 0x020B
 
static constexpr offset_t Win32Base = 0x00400000
 
static constexpr offset_t Dll32Base = 0x10000000
 
static constexpr offset_t WinCEBase = 0x00010000
 

Protected Member Functions

void DumpFields (const COFFFormat &coff, Dumper::Dumper &dump, Dumper::Region &header_region) const override
 
- Protected Member Functions inherited from COFF::COFFFormat::AOutHeader
virtual void DumpFields (const COFFFormat &coff, Dumper::Dumper &dump, Dumper::Region &header_region) const
 

Member Enumeration Documentation

◆ SubsystemType

Available Windows subsystems

Member Function Documentation

◆ GetSize()

uint32_t PEFormat::PEOptionalHeader::GetSize ( ) const
overridevirtual

Returns size of optional header.

Reimplemented from COFF::COFFFormat::AOutHeader.

◆ ReadFile()

void PEFormat::PEOptionalHeader::ReadFile ( Linker::Reader & rd)
overridevirtual

Reimplemented from COFF::COFFFormat::AOutHeader.

◆ WriteFile()

void PEFormat::PEOptionalHeader::WriteFile ( Linker::Writer & wr) const
overridevirtual

Reimplemented from COFF::COFFFormat::AOutHeader.


The documentation for this class was generated from the following files: