Skip to content

Commit

Permalink
[libromdata] exe_pe_structs.h: IMAGE_DATA_DIRECTORY_* constants are a…
Browse files Browse the repository at this point in the history
…lso not present in the Windows SDK.

See #413: Exports/Imports table in win32 shell ext page showing blank rows
Reported by @ksharperd.
  • Loading branch information
GerbilSoft committed Apr 16, 2024
1 parent f373055 commit e8e99e2
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions src/libromdata/Other/exe_pe_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,29 +156,6 @@ typedef struct _IMAGE_FILE_HEADER {
} IMAGE_FILE_HEADER;
ASSERT_STRUCT(IMAGE_FILE_HEADER, IMAGE_SIZEOF_FILE_HEADER);

/**
* PE image data directory indexes.
* Reference: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_data_directory
*/
typedef enum {
IMAGE_DATA_DIRECTORY_EXPORT_TABLE = 0,
IMAGE_DATA_DIRECTORY_IMPORT_TABLE = 1,
IMAGE_DATA_DIRECTORY_RESOURCE_TABLE = 2,
IMAGE_DATA_DIRECTORY_EXCEPTION_TABLE = 3,
IMAGE_DATA_DIRECTORY_CERTIFICATE_TABLE = 4,
IMAGE_DATA_DIRECTORY_RELOCATION_TABLE = 5,
IMAGE_DATA_DIRECTORY_DEBUG_INFO = 6,
IMAGE_DATA_DIRECTORY_ARCH_SPECIFIC_DATA = 7,
IMAGE_DATA_DIRECTORY_GLOBAL_PTR_REG = 8,
IMAGE_DATA_DIRECTORY_TLS_TABLE = 9,
IMAGE_DATA_DIRECTORY_LOAD_CONFIG_TABLE = 10,
IMAGE_DATA_DIRECTORY_BOUND_IMPORT_TABLE = 11,
IMAGE_DATA_DIRECTORY_IMPORT_ADDR_TABLE = 12,
IMAGE_DATA_DIRECTORY_DELAY_IMPORT_DESCRIPTOR = 13,
IMAGE_DATA_DIRECTORY_CLR_HEADER = 14,
IMAGE_DATA_DIRECTORY_RESERVED = 15,
} ImageDataDirectoryIndex;

/**
* PE image data directory
* All fields are little-endian.
Expand Down Expand Up @@ -515,6 +492,30 @@ ASSERT_STRUCT(IMAGE_RESOURCE_DATA_ENTRY, 4*sizeof(uint32_t));

#endif /* IMAGE_NT_SIGNATURE */

/**
* PE image data directory indexes.
* Reference: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-image_data_directory
* NOTE: *NOT* defined in the Windows SDK.
*/
typedef enum {
IMAGE_DATA_DIRECTORY_EXPORT_TABLE = 0,
IMAGE_DATA_DIRECTORY_IMPORT_TABLE = 1,
IMAGE_DATA_DIRECTORY_RESOURCE_TABLE = 2,
IMAGE_DATA_DIRECTORY_EXCEPTION_TABLE = 3,
IMAGE_DATA_DIRECTORY_CERTIFICATE_TABLE = 4,
IMAGE_DATA_DIRECTORY_RELOCATION_TABLE = 5,
IMAGE_DATA_DIRECTORY_DEBUG_INFO = 6,
IMAGE_DATA_DIRECTORY_ARCH_SPECIFIC_DATA = 7,
IMAGE_DATA_DIRECTORY_GLOBAL_PTR_REG = 8,
IMAGE_DATA_DIRECTORY_TLS_TABLE = 9,
IMAGE_DATA_DIRECTORY_LOAD_CONFIG_TABLE = 10,
IMAGE_DATA_DIRECTORY_BOUND_IMPORT_TABLE = 11,
IMAGE_DATA_DIRECTORY_IMPORT_ADDR_TABLE = 12,
IMAGE_DATA_DIRECTORY_DELAY_IMPORT_DESCRIPTOR = 13,
IMAGE_DATA_DIRECTORY_CLR_HEADER = 14,
IMAGE_DATA_DIRECTORY_RESERVED = 15,
} ImageDataDirectoryIndex;

/** Import table **/
// Reference: http://sandsprite.com/CodeStuff/Understanding_imports.html
// NOTE: *NOT* defined in the Windows SDK.
Expand Down

0 comments on commit e8e99e2

Please sign in to comment.