Class OptionalHeaderImpl

java.lang.Object
ghidra.app.util.bin.format.pe.OptionalHeaderImpl
All Implemented Interfaces:
OptionalHeader, StructConverter

public class OptionalHeaderImpl extends Object implements OptionalHeader
 typedef struct _IMAGE_OPTIONAL_HEADER {
     WORD    Magic;                                                                     // MANDATORY
     BYTE    MajorLinkerVersion;
     BYTE    MinorLinkerVersion;
     DWORD   SizeOfCode;
     DWORD   SizeOfInitializedData;
     DWORD   SizeOfUninitializedData;
     DWORD   AddressOfEntryPoint;                                               // MANDATORY
     DWORD   BaseOfCode;
     DWORD   BaseOfData;
     DWORD   ImageBase;                                                         // MANDATORY
     DWORD   SectionAlignment;                                          // MANDATORY
     DWORD   FileAlignment;                                                     // MANDATORY
     WORD    MajorOperatingSystemVersion;                               // MANDATORY
     WORD    MinorOperatingSystemVersion;
     WORD    MajorImageVersion;
     WORD    MinorImageVersion;
     WORD    MajorSubsystemVersion;
     WORD    MinorSubsystemVersion;
     DWORD   Win32VersionValue;
     DWORD   SizeOfImage;                                                               // MANDATORY
     DWORD   SizeOfHeaders;                                                     // MANDATORY
     DWORD   CheckSum;
     WORD    Subsystem;                                                         // MANDATORY
     WORD    DllCharacteristics;
     DWORD   SizeOfStackReserve;
     DWORD   SizeOfStackCommit;
     DWORD   SizeOfHeapReserve;
     DWORD   SizeOfHeapCommit;
     DWORD   LoaderFlags;
     DWORD   NumberOfRvaAndSizes;                                               // USED
     IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
 };
 
 typedef struct _IMAGE_OPTIONAL_HEADER64 {
     WORD        Magic;
     BYTE        MajorLinkerVersion;
     BYTE        MinorLinkerVersion;
     DWORD       SizeOfCode;
     DWORD       SizeOfInitializedData;
     DWORD       SizeOfUninitializedData;
     DWORD       AddressOfEntryPoint;
     DWORD       BaseOfCode;
     ULONGLONG   ImageBase;
     DWORD       SectionAlignment;
     DWORD       FileAlignment;
     WORD        MajorOperatingSystemVersion;
     WORD        MinorOperatingSystemVersion;
     WORD        MajorImageVersion;
     WORD        MinorImageVersion;
     WORD        MajorSubsystemVersion;
     WORD        MinorSubsystemVersion;
     DWORD       Win32VersionValue;
     DWORD       SizeOfImage;
     DWORD       SizeOfHeaders;
     DWORD       CheckSum;
     WORD        Subsystem;
     WORD        DllCharacteristics;
     ULONGLONG   SizeOfStackReserve;
     ULONGLONG   SizeOfStackCommit;
     ULONGLONG   SizeOfHeapReserve;
     ULONGLONG   SizeOfHeapCommit;
     DWORD       LoaderFlags;
     DWORD       NumberOfRvaAndSizes;
     IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
 };
 
  • Field Details

    • magic

      protected short magic
    • majorLinkerVersion

      protected byte majorLinkerVersion
    • minorLinkerVersion

      protected byte minorLinkerVersion
    • sizeOfCode

      protected int sizeOfCode
    • sizeOfInitializedData

      protected int sizeOfInitializedData
    • sizeOfUninitializedData

      protected int sizeOfUninitializedData
    • addressOfEntryPoint

      protected int addressOfEntryPoint
    • baseOfCode

      protected int baseOfCode
    • baseOfData

      protected int baseOfData
    • imageBase

      protected long imageBase
    • sectionAlignment

      protected int sectionAlignment
    • fileAlignment

      protected int fileAlignment
    • majorOperatingSystemVersion

      protected short majorOperatingSystemVersion
    • minorOperatingSystemVersion

      protected short minorOperatingSystemVersion
    • majorImageVersion

      protected short majorImageVersion
    • minorImageVersion

      protected short minorImageVersion
    • majorSubsystemVersion

      protected short majorSubsystemVersion
    • minorSubsystemVersion

      protected short minorSubsystemVersion
    • win32VersionValue

      protected int win32VersionValue
    • sizeOfImage

      protected int sizeOfImage
    • sizeOfHeaders

      protected int sizeOfHeaders
    • checkSum

      protected int checkSum
    • subsystem

      protected short subsystem
    • dllCharacteristics

      protected short dllCharacteristics
    • sizeOfStackReserve

      protected long sizeOfStackReserve
    • sizeOfStackCommit

      protected long sizeOfStackCommit
    • sizeOfHeapReserve

      protected long sizeOfHeapReserve
    • sizeOfHeapCommit

      protected long sizeOfHeapCommit
    • loaderFlags

      protected int loaderFlags
    • numberOfRvaAndSizes

      protected int numberOfRvaAndSizes
    • dataDirectory

      protected DataDirectory[] dataDirectory
    • ntHeader

      protected NTHeader ntHeader
    • reader

      protected BinaryReader reader
    • startIndex

      protected int startIndex
  • Method Details