Skip to content

Commit

Permalink
[libromdata] exe_pe_structs.h: IMAGE_IMPORT_DIRECTORY is *not* define…
Browse files Browse the repository at this point in the history
…d 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 9323430 commit f373055
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/libromdata/Other/exe_pe_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,24 +458,6 @@ typedef struct _IMAGE_EXPORT_DIRECTORY {
} IMAGE_EXPORT_DIRECTORY;
ASSERT_STRUCT(IMAGE_EXPORT_DIRECTORY, 10*sizeof(uint32_t));

/** Import table. **/
// Reference: http://sandsprite.com/CodeStuff/Understanding_imports.html

/**
* Import directory.
*/
typedef struct _IMAGE_IMPORT_DIRECTORY {
uint32_t rvaImportLookupTable; // RVA of the import lookup table
uint32_t TimeDateStamp; // UNIX timestamp
uint32_t ForwarderChain;
uint32_t rvaModuleName; // RVA of the DLL filename
uint32_t rvaImportAddressTable; // RVA of the thunk table
} IMAGE_IMPORT_DIRECTORY;
ASSERT_STRUCT(IMAGE_IMPORT_DIRECTORY, 5*sizeof(uint32_t));

// Import lookup table consists of 32-bit values which are either
// RVAs to the function name or, if the low(?) bit is set, an ordinal.

/** Win32 resources **/

// Resource directory
Expand Down Expand Up @@ -527,13 +509,31 @@ ASSERT_STRUCT(IMAGE_NT_HEADERS32, 248);
ASSERT_STRUCT(IMAGE_NT_HEADERS64, 264);
ASSERT_STRUCT(IMAGE_SECTION_HEADER, IMAGE_SIZEOF_SECTION_HEADER);
ASSERT_STRUCT(IMAGE_EXPORT_DIRECTORY, 10*sizeof(uint32_t));
ASSERT_STRUCT(IMAGE_IMPORT_DIRECTORY, 5*sizeof(uint32_t));
ASSERT_STRUCT(IMAGE_RESOURCE_DIRECTORY, 16);
ASSERT_STRUCT(IMAGE_RESOURCE_DIRECTORY_ENTRY, 2*sizeof(uint32_t));
ASSERT_STRUCT(IMAGE_RESOURCE_DATA_ENTRY, 4*sizeof(uint32_t));

#endif /* IMAGE_NT_SIGNATURE */

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

/**
* Import directory
*
* Import lookup table consists of 32-bit values which are either
* RVAs to the function name or, if the low(?) bit is set, an ordinal.
*/
typedef struct _IMAGE_IMPORT_DIRECTORY {
uint32_t rvaImportLookupTable; // RVA of the import lookup table
uint32_t TimeDateStamp; // UNIX timestamp
uint32_t ForwarderChain;
uint32_t rvaModuleName; // RVA of the DLL filename
uint32_t rvaImportAddressTable; // RVA of the thunk table
} IMAGE_IMPORT_DIRECTORY;
ASSERT_STRUCT(IMAGE_IMPORT_DIRECTORY, 5*sizeof(uint32_t));

// Manifest IDs
typedef enum {
CREATEPROCESS_MANIFEST_RESOURCE_ID = 1,
Expand Down

0 comments on commit f373055

Please sign in to comment.