

# IMAGE_SECTION_HEADER.Characteristics
IMAGE_SCN_TYPE_NO_PAD = 'IMAGE_SCN_TYPE_NO_PAD'
IMAGE_SCN_CNT_CODE = 'IMAGE_SCN_CNT_CODE'
IMAGE_SCN_CNT_INITIALIZED_DATA = 'IMAGE_SCN_CNT_INITIALIZED_DATA'
IMAGE_SCN_CNT_UNINITIALIZED_DATA = 'IMAGE_SCN_CNT_UNINITIALIZED_DATA'
IMAGE_SCN_LNK_OTHER = 'IMAGE_SCN_LNK_OTHER'
IMAGE_SCN_LNK_INFO = 'IMAGE_SCN_LNK_INFO'
IMAGE_SCN_LNK_REMOVE = 'IMAGE_SCN_LNK_REMOVE'
IMAGE_SCN_LNK_COMDAT = 'IMAGE_SCN_LNK_COMDAT'
IMAGE_SCN_NO_DEFER_SPEC_EXC = 'IMAGE_SCN_NO_DEFER_SPEC_EXC'
IMAGE_SCN_GPREL = 'IMAGE_SCN_GPREL'
IMAGE_SCN_MEM_PURGEABLE = 'IMAGE_SCN_MEM_PURGEABLE'
IMAGE_SCN_MEM_LOCKED = 'IMAGE_SCN_MEM_LOCKED'
IMAGE_SCN_MEM_PRELOAD = 'IMAGE_SCN_MEM_PRELOAD'
IMAGE_SCN_ALIGN_1BYTES = 'IMAGE_SCN_ALIGN_1BYTES'
IMAGE_SCN_ALIGN_2BYTES = 'IMAGE_SCN_ALIGN_2BYTES'
IMAGE_SCN_ALIGN_4BYTES = 'IMAGE_SCN_ALIGN_4BYTES'
IMAGE_SCN_ALIGN_8BYTES = 'IMAGE_SCN_ALIGN_8BYTES'
IMAGE_SCN_ALIGN_16BYTES = 'IMAGE_SCN_ALIGN_16BYTES'
IMAGE_SCN_ALIGN_32BYTES = 'IMAGE_SCN_ALIGN_32BYTES'
IMAGE_SCN_ALIGN_64BYTES = 'IMAGE_SCN_ALIGN_64BYTES'
IMAGE_SCN_ALIGN_128BYTES = 'IMAGE_SCN_ALIGN_128BYTES'
IMAGE_SCN_ALIGN_256BYTES = 'IMAGE_SCN_ALIGN_256BYTES'
IMAGE_SCN_ALIGN_512BYTES = 'IMAGE_SCN_ALIGN_512BYTES'
IMAGE_SCN_ALIGN_1024BYTES = 'IMAGE_SCN_ALIGN_1024BYTES'
IMAGE_SCN_ALIGN_2048BYTES = 'IMAGE_SCN_ALIGN_2048BYTES'
IMAGE_SCN_ALIGN_4096BYTES = 'IMAGE_SCN_ALIGN_4096BYTES'
IMAGE_SCN_ALIGN_8192BYTES = 'IMAGE_SCN_ALIGN_8192BYTES'
IMAGE_SCN_LNK_NRELOC_OVFL = 'IMAGE_SCN_LNK_NRELOC_OVFL'
IMAGE_SCN_MEM_DISCARDABLE = 'IMAGE_SCN_MEM_DISCARDABLE'
IMAGE_SCN_MEM_NOT_CACHED = 'IMAGE_SCN_MEM_NOT_CACHED'
IMAGE_SCN_MEM_NOT_PAGED = 'IMAGE_SCN_MEM_NOT_PAGED'
IMAGE_SCN_MEM_SHARED = 'IMAGE_SCN_MEM_SHARED'
IMAGE_SCN_MEM_EXECUTE = 'IMAGE_SCN_MEM_EXECUTE'
IMAGE_SCN_MEM_READ = 'IMAGE_SCN_MEM_READ'
IMAGE_SCN_MEM_WRITE = 'IMAGE_SCN_MEM_WRITE'

# IMAGE_OPTIONAL_HEADER.Magic
IMAGE_NT_OPTIONAL_HDR32_MAGIC = 0x10b
IMAGE_NT_OPTIONAL_HDR64_MAGIC = 0x20b
IMAGE_ROM_OPTIONAL_HDR_MAGIC = 0x107

# IMAGE_OPTIONAL_HEADER.Subsystem
IMAGE_SUBSYSTEM_UNKNOWN = 0
IMAGE_SUBSYSTEM_NATIVE = 1
IMAGE_SUBSYSTEM_WINDOWS_GUI = 2
IMAGE_SUBSYSTEM_WINDOWS_CUI = 3
IMAGE_SUBSYSTEM_OS2_CUI = 5
IMAGE_SUBSYSTEM_POSIX_CUI = 7
IMAGE_SUBSYSTEM_WINDOWS_CE_GUI = 9
IMAGE_SUBSYSTEM_EFI_APPLICATION = 10
IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11
IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12
IMAGE_SUBSYSTEM_EFI_ROM = 13
IMAGE_SUBSYSTEM_XBOX = 14
IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16


# Make default DataDirectory and standard indexes available for convenience.
# WARNING: Make sure you make a copy of DEFAULT_DATA_DIRECTORIES!!
DATA_DIR_INDEX_EXPORTS = 0
DATA_DIR_INDEX_IMPORTS = 1
DATA_DIR_INDEX_RESOURCE = 2
DATA_DIR_INDEX_EXCEPTION = 3
DATA_DIR_INDEX_CERTIFICATE = 4
DATA_DIR_INDEX_BASE_RELOC = 5
DATA_DIR_INDEX_DEBUG = 6
DATA_DIR_INDEX_ARCHITECTURE = 7
DATA_DIR_INDEX_GLOBAL_PTR = 8
DATA_DIR_INDEX_TLS = 9
DATA_DIR_INDEX_LOAD_CONFIG = 10
DATA_DIR_INDEX_BOUND_IMPORT = 11
DATA_DIR_INDEX_IMPORT_ADDRESS = 12
DATA_DIR_INDEX_DELAY_IMPORT_DESCRIPTOR = 13
DATA_DIR_INDEX_CLR_HEADER = 14
DEFAULT_DATA_DIRECTORIES = [dict(VirtualAddress=0, Size=0)] * 16

# IMAGE_OPTIONAL_HEADER.DllCharacteristics
IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE = 'IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE'
IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY = 'IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY'
IMAGE_DLLCHARACTERISTICS_NX_COMPAT = 'IMAGE_DLLCHARACTERISTICS_NX_COMPAT'
IMAGE_DLLCHARACTERISTICS_NO_ISOLATION = 'IMAGE_DLLCHARACTERISTICS_NO_ISOLATION'
IMAGE_DLLCHARACTERISTICS_NO_SEH = 'IMAGE_DLLCHARACTERISTICS_NO_SEH'
IMAGE_DLLCHARACTERISTICS_NO_BIND = 'IMAGE_DLLCHARACTERISTICS_NO_BIND'
IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = 'IMAGE_DLLCHARACTERISTICS_WDM_DRIVER'
IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 'IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE'

# IMAGE_FILE_HEADER.Machine
IMAGE_FILE_MACHINE_UNKNOWN = 0x0
IMAGE_FILE_MACHINE_AM33 = 0x1d3
IMAGE_FILE_MACHINE_AMD64 = 0x8664
IMAGE_FILE_MACHINE_ARM = 0x1c0
IMAGE_FILE_MACHINE_ARM64 = 0xaa64
IMAGE_FILE_MACHINE_ARMNT = 0x1c4
IMAGE_FILE_MACHINE_EBC = 0xebc
IMAGE_FILE_MACHINE_I386 = 0x14c
IMAGE_FILE_MACHINE_IA64 = 0x200
IMAGE_FILE_MACHINE_M32R = 0x9041
IMAGE_FILE_MACHINE_MIPS16 = 0x266
IMAGE_FILE_MACHINE_MIPSFPU = 0x366
IMAGE_FILE_MACHINE_MIPSFPU16 = 0x466
IMAGE_FILE_MACHINE_POWERPC = 0x1f0
IMAGE_FILE_MACHINE_POWERPCFP = 0x1f1
IMAGE_FILE_MACHINE_R4000 = 0x166
IMAGE_FILE_MACHINE_RISCV32 = 0x5032
IMAGE_FILE_MACHINE_RISCV64 = 0x5064
IMAGE_FILE_MACHINE_RISCV128 = 0x5128
IMAGE_FILE_MACHINE_SH3 = 0x1a2
IMAGE_FILE_MACHINE_SH3DSP = 0x1a3
IMAGE_FILE_MACHINE_SH4 = 0x1a6
IMAGE_FILE_MACHINE_SH5 = 0x1a8
IMAGE_FILE_MACHINE_THUMB = 0x1c2
IMAGE_FILE_MACHINE_WCEMIPSV2 = 0x169


# IMAGE_FILE_HEADER characterstics.
IMAGE_FILE_RELOCS_STRIPPED = 'IMAGE_FILE_RELOCS_STRIPPED'
IMAGE_FILE_EXECUTABLE_IMAGE = 'IMAGE_FILE_EXECUTABLE_IMAGE'
IMAGE_FILE_LINE_NUMS_STRIPPED = 'IMAGE_FILE_LINE_NUMS_STRIPPED'
IMAGE_FILE_LOCAL_SYMS_STRIPPED = 'IMAGE_FILE_LOCAL_SYMS_STRIPPED'
IMAGE_FILE_AGGRESIVE_WS_TRIM = 'IMAGE_FILE_AGGRESIVE_WS_TRIM'
IMAGE_FILE_LARGE_ADDRESS_AWARE = 'IMAGE_FILE_LARGE_ADDRESS_AWARE'
IMAGE_FILE_BYTES_REVERSED_LO = 'IMAGE_FILE_BYTES_REVERSED_LO'
IMAGE_FILE_32BIT_MACHINE = 'IMAGE_FILE_32BIT_MACHINE'
IMAGE_FILE_DEBUG_STRIPPED = 'IMAGE_FILE_DEBUG_STRIPPED'
IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 'IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP'
IMAGE_FILE_NET_RUN_FROM_SWAP = 'IMAGE_FILE_NET_RUN_FROM_SWAP'
IMAGE_FILE_SYSTEM = 'IMAGE_FILE_SYSTEM'
IMAGE_FILE_DLL = 'IMAGE_FILE_DLL'
IMAGE_FILE_UP_SYSTEM_ONLY = 'IMAGE_FILE_UP_SYSTEM_ONLY'
IMAGE_FILE_BYTES_REVERSED_HI = 'IMAGE_FILE_BYTES_REVERSED_HI'