ekern

ekern.git
git clone git://git.lenczewski.org/ekern.git
Log | Files | Refs | README | LICENSE

pe.h (1563B)


      1 /* PE32+ file format definitions
      2  * --
      3  *  see: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
      4  */
      5 
      6 #ifndef PE_H
      7 #define PE_H
      8 
      9 #define IMAGE_DOS_SIGNATURE				0x5a4d		/* MZ */
     10 #define IMAGE_NT_SIGNATURE				0x00004550	/* PE\0\0 */
     11 
     12 /* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-type */
     13 #define IMAGE_FILE_MACHINE_AMD64			0x8664
     14 #define IMAGE_FILE_MACHINE_ARM64			0xaa64
     15 #define IMAGE_FILE_MACHINE_RISCV64			0x5064
     16 
     17 /* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#characteristics */
     18 #define IMAGE_FILE_RELOCS_STRIPPED			0x0001
     19 #define IMAGE_FILE_EXECUTABLE_IMAGE			0x0002
     20 #define IMAGE_FILE_LARGE_ADDRESS_AWARE			0x0020
     21 #define IMAGE_FILE_DEBUG_STRIPPED			0x0200
     22 
     23 /* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-image-only */
     24 #define PE32_MAGIC					0x20b
     25 
     26 /* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#windows-subsystem */
     27 #define IMAGE_SUBSYSTEM_EFI_APPLICATION			0xa
     28 
     29 /* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#dll-characteristics */
     30 #define IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA	0x0020
     31 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE		0x0040
     32 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT		0x0100
     33 
     34 /* https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#section-flags */
     35 #define IMAGE_SCN_CNT_CODE				0x00000020
     36 #define IMAGE_SCN_CNT_INITIALIZED_DATA			0x00000040
     37 #define IMAGE_SCN_MEM_EXECUTE				0x20000000
     38 #define IMAGE_SCN_MEM_READ				0x40000000
     39 #define IMAGE_SCN_MEM_WRITE				0x80000000
     40 
     41 #endif /* PE_H */