XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Enumerations | Functions | Variables
pe.h File Reference
#include "littleboot.h"
Include dependency graph for pe.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _IMAGE_DOS_HEADER_
 
struct  _IMAGE_FILE_HEADER_
 
struct  _IMAGE_DATA_DIRECTORY_
 
struct  _IMAGE_OPTIONAL_HEADER_PE32_
 
struct  _IMAGE_OPTIONAL_HEADER_PE32PLUS
 
struct  _IMAGE_NT_HEADERS_PE32PLUS
 
struct  _IMAGE_SECTION_HEADER
 

Macros

#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES   16
 
#define IMAGE_SCN_CNT_CODE   0x00000020
 
#define IMAGE_SCN_CNT_INITIALIZED_DATA   0x00000040
 
#define IMAGE_SCN_CNT_UNINITIALIZED_DATA   0x00000080
 
#define IMAGE_SCN_MEM_DISCARDABLE   0x02000000
 
#define IMAGE_SCN_MEM_NOT_CACHED   0x04000000
 
#define IMAGE_SCN_MEM_NOT_PAGED   0x08000000
 
#define IMAGE_SCN_MEM_SHARED   0x10000000
 
#define IMAGE_SCN_MEM_EXECUTE   0x20000000
 
#define IMAGE_SCN_MEM_READ   0x40000000
 
#define IMAGE_SCN_MEM_WRITE   0x80000000
 

Enumerations

enum  PeOptionalMagic { MAGIC_PE32 = 0x10b , MAGIC_PE32P = 0x20b }
 

Functions

struct _IMAGE_DOS_HEADER_ __attribute__ ((packed)) IMAGE_DOS_HEADER
 

Variables

uint16_t e_magic
 
uint16_t e_cblp
 
uint16_t e_cp
 
uint16_t e_crlc
 
uint16_t e_cparhdr
 
uint16_t e_minalloc
 
uint16_t e_maxalloc
 
uint16_t e_ss
 
uint16_t e_sp
 
uint16_t e_csum
 
uint16_t e_ip
 
uint16_t e_cs
 
uint16_t e_lfarlc
 
uint16_t e_ovno
 
uint16_t e_res [4]
 
uint16_t e_oemid
 
uint16_t e_oeminfo
 
uint16_t e_res2 [10]
 
uint16_t e_lfanew
 
uint16_t Machine
 
uint16_t NumberOfSections
 
uint32_t TimeDateStamp
 
uint32_t PointerToSymbolTable
 
uint32_t NumberOfSymbols
 
uint16_t SizeOfOptionaHeader
 
uint16_t Characteristics
 
struct _IMAGE_FILE_HEADER_PIMAGE_FILE_HEADER
 
enum PeOptionalMagic __attribute__
 
uint32_t VirtualAddress
 
uint32_t Size
 
struct _IMAGE_DATA_DIRECTORY_PIMAGE_DATA_DIRECTORY
 
uint16_t Magic
 
uint8_t MajorLinkerVersion
 
uint8_t MinorLinkerVersion
 
uint32_t SizeOfCode
 
uint32_t SizeOfInitializedData
 
uint32_t SizeOfUninitializedData
 
uint32_t AddressOfEntryPoint
 
uint32_t BaseOfCode
 
uint32_t BaseOfData
 
uint32_t ImageBase
 
uint32_t SectionAlighnment
 
uint32_t FileAlignment
 
uint16_t MajorOperatingSystemVersion
 
uint16_t MinorOperatingSystemVersion
 
uint16_t MajorImageVersion
 
uint16_t MinorImageVersion
 
uint16_t MajorSubsystemVersion
 
uint16_t MinorSubsystemVersion
 
uint32_t Reserved1
 
uint32_t SizeOfImage
 
uint32_t SizeOfHeaders
 
uint32_t CheckSum
 
uint16_t Subsystem
 
uint16_t DllCharacteristics
 
uint32_t SizeOfStackReserve
 
uint32_t SizeOfStackCommit
 
uint32_t SizeOfHeapReserve
 
uint32_t SizeOfHeapCommit
 
uint32_t LoaderFlags
 
uint32_t NumberOfRvaAndSizes
 
IMAGE_DATA_DIRECTORY DataDirectory [IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
 
struct _IMAGE_OPTIONAL_HEADER_PE32_PIMAGE_OPTIONAL_HEADER_PE32
 
uint32_t SectionAlignment
 
struct _IMAGE_OPTIONAL_HEADER_PE32PLUSPIMAGE_OPTIONAL_HEADER_PE32PLUS
 
uint32_t Signature
 
IMAGE_FILE_HEADER FileHeader
 
IMAGE_OPTIONAL_HEADER_PE32PLUS OptionalHeader
 
char Name [8]
 
uint32_t VirtualSize
 
uint32_t SizeOfRawData
 
uint32_t PointerToRawData
 
uint32_t PointerToRelocations
 
uint32_t PointerToLinenumbers
 
uint16_t NumberOfRelocations
 
uint16_t NumberOfLinenumbers
 
struct _IMAGE_SECTION_HEADERPSECTION_HEADER
 

Macro Definition Documentation

◆ IMAGE_NUMBEROF_DIRECTORY_ENTRIES

#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES   16

◆ IMAGE_SCN_CNT_CODE

#define IMAGE_SCN_CNT_CODE   0x00000020

◆ IMAGE_SCN_CNT_INITIALIZED_DATA

#define IMAGE_SCN_CNT_INITIALIZED_DATA   0x00000040

◆ IMAGE_SCN_CNT_UNINITIALIZED_DATA

#define IMAGE_SCN_CNT_UNINITIALIZED_DATA   0x00000080

◆ IMAGE_SCN_MEM_DISCARDABLE

#define IMAGE_SCN_MEM_DISCARDABLE   0x02000000

◆ IMAGE_SCN_MEM_EXECUTE

#define IMAGE_SCN_MEM_EXECUTE   0x20000000

◆ IMAGE_SCN_MEM_NOT_CACHED

#define IMAGE_SCN_MEM_NOT_CACHED   0x04000000

◆ IMAGE_SCN_MEM_NOT_PAGED

#define IMAGE_SCN_MEM_NOT_PAGED   0x08000000

◆ IMAGE_SCN_MEM_READ

#define IMAGE_SCN_MEM_READ   0x40000000

◆ IMAGE_SCN_MEM_SHARED

#define IMAGE_SCN_MEM_SHARED   0x10000000

◆ IMAGE_SCN_MEM_WRITE

#define IMAGE_SCN_MEM_WRITE   0x80000000

Enumeration Type Documentation

◆ PeOptionalMagic

Enumerator
MAGIC_PE32 
MAGIC_PE32P 

Function Documentation

◆ __attribute__()

struct _IMAGE_DOS_HEADER_ __attribute__ ( (packed)  )

BSD 2-Clause License

Copyright (c) 2022-2025, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Variable Documentation

◆ __attribute__

struct __attribute__

◆ AddressOfEntryPoint

uint32_t AddressOfEntryPoint

◆ BaseOfCode

uint32_t BaseOfCode

◆ BaseOfData

uint32_t BaseOfData

◆ Characteristics

uint32_t Characteristics

◆ CheckSum

uint32_t CheckSum

◆ DataDirectory

IMAGE_DATA_DIRECTORY DataDirectory

◆ DllCharacteristics

uint16_t DllCharacteristics

◆ e_cblp

uint16_t e_cblp

◆ e_cp

uint16_t e_cp

◆ e_cparhdr

uint16_t e_cparhdr

◆ e_crlc

uint16_t e_crlc

◆ e_cs

uint16_t e_cs

◆ e_csum

uint16_t e_csum

◆ e_ip

uint16_t e_ip

◆ e_lfanew

uint16_t e_lfanew

◆ e_lfarlc

uint16_t e_lfarlc

◆ e_magic

uint16_t e_magic

◆ e_maxalloc

uint16_t e_maxalloc

◆ e_minalloc

uint16_t e_minalloc

◆ e_oemid

uint16_t e_oemid

◆ e_oeminfo

uint16_t e_oeminfo

◆ e_ovno

uint16_t e_ovno

◆ e_res

uint16_t e_res[4]

◆ e_res2

uint16_t e_res2[10]

◆ e_sp

uint16_t e_sp

◆ e_ss

uint16_t e_ss

◆ FileAlignment

uint32_t FileAlignment

◆ FileHeader

IMAGE_FILE_HEADER FileHeader

◆ ImageBase

uint64_t ImageBase

◆ LoaderFlags

uint32_t LoaderFlags

◆ Machine

uint16_t Machine

◆ Magic

uint16_t Magic

◆ MajorImageVersion

uint16_t MajorImageVersion

◆ MajorLinkerVersion

uint8_t MajorLinkerVersion

◆ MajorOperatingSystemVersion

uint16_t MajorOperatingSystemVersion

◆ MajorSubsystemVersion

uint16_t MajorSubsystemVersion

◆ MinorImageVersion

uint16_t MinorImageVersion

◆ MinorLinkerVersion

uint8_t MinorLinkerVersion

◆ MinorOperatingSystemVersion

uint16_t MinorOperatingSystemVersion

◆ MinorSubsystemVersion

uint16_t MinorSubsystemVersion

◆ Name

char Name[8]

◆ NumberOfLinenumbers

uint16_t NumberOfLinenumbers

◆ NumberOfRelocations

uint16_t NumberOfRelocations

◆ NumberOfRvaAndSizes

uint32_t NumberOfRvaAndSizes

◆ NumberOfSections

uint16_t NumberOfSections

◆ NumberOfSymbols

uint32_t NumberOfSymbols

◆ OptionalHeader

◆ PIMAGE_DATA_DIRECTORY

◆ PIMAGE_FILE_HEADER

◆ PIMAGE_OPTIONAL_HEADER_PE32

◆ PIMAGE_OPTIONAL_HEADER_PE32PLUS

◆ PointerToLinenumbers

uint32_t PointerToLinenumbers

◆ PointerToRawData

uint32_t PointerToRawData

◆ PointerToRelocations

uint32_t PointerToRelocations

◆ PointerToSymbolTable

uint32_t PointerToSymbolTable

◆ PSECTION_HEADER

◆ Reserved1

uint32_t Reserved1

◆ SectionAlighnment

uint32_t SectionAlighnment

◆ SectionAlignment

uint32_t SectionAlignment

◆ Signature

uint32_t Signature

◆ Size

uint32_t Size

◆ SizeOfCode

uint32_t SizeOfCode

◆ SizeOfHeaders

uint32_t SizeOfHeaders

◆ SizeOfHeapCommit

uint64_t SizeOfHeapCommit

◆ SizeOfHeapReserve

uint64_t SizeOfHeapReserve

◆ SizeOfImage

uint32_t SizeOfImage

◆ SizeOfInitializedData

uint32_t SizeOfInitializedData

◆ SizeOfOptionaHeader

uint16_t SizeOfOptionaHeader

◆ SizeOfRawData

uint32_t SizeOfRawData

◆ SizeOfStackCommit

uint64_t SizeOfStackCommit

◆ SizeOfStackReserve

uint64_t SizeOfStackReserve

◆ SizeOfUninitializedData

uint32_t SizeOfUninitializedData

◆ Subsystem

uint16_t Subsystem

◆ TimeDateStamp

uint32_t TimeDateStamp

◆ VirtualAddress

uint32_t VirtualAddress

◆ VirtualSize

uint32_t VirtualSize