winedump: Print the imports thunk address also for 64-bit.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-07-20 11:55:04 +02:00
parent 8a9d8c9a42
commit 5f34d56dcb
1 changed files with 5 additions and 5 deletions

View File

@ -1186,11 +1186,11 @@ static void dump_dir_exceptions(void)
} }
static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il) static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il, DWORD thunk_rva)
{ {
/* FIXME: This does not properly handle large images */ /* FIXME: This does not properly handle large images */
const IMAGE_IMPORT_BY_NAME* iibn; const IMAGE_IMPORT_BY_NAME* iibn;
for (; il->u1.Ordinal; il++) for (; il->u1.Ordinal; il++, thunk_rva += sizeof(LONGLONG))
{ {
if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal)) if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal))
printf(" %4u <by ordinal>\n", (DWORD)IMAGE_ORDINAL64(il->u1.Ordinal)); printf(" %4u <by ordinal>\n", (DWORD)IMAGE_ORDINAL64(il->u1.Ordinal));
@ -1200,7 +1200,7 @@ static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il)
if (!iibn) if (!iibn)
printf("Can't grab import by name info, skipping to next ordinal\n"); printf("Can't grab import by name info, skipping to next ordinal\n");
else else
printf(" %4u %s %x\n", iibn->Hint, iibn->Name, (DWORD)il->u1.AddressOfData); printf(" %4u %s %x\n", iibn->Hint, iibn->Name, thunk_rva);
} }
} }
} }
@ -1256,7 +1256,7 @@ static void dump_dir_imported_functions(void)
else else
{ {
if(PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) if(PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
dump_image_thunk_data64((const IMAGE_THUNK_DATA64*)il); dump_image_thunk_data64((const IMAGE_THUNK_DATA64*)il, importDesc->FirstThunk);
else else
dump_image_thunk_data32(il, 0, importDesc->FirstThunk); dump_image_thunk_data32(il, 0, importDesc->FirstThunk);
printf("\n"); printf("\n");
@ -1344,7 +1344,7 @@ static void dump_dir_delay_imported_functions(void)
else else
{ {
if (PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) if (PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
dump_image_thunk_data64((const IMAGE_THUNK_DATA64 *)il); dump_image_thunk_data64((const IMAGE_THUNK_DATA64 *)il, importDesc->ImportAddressTableRVA);
else else
dump_image_thunk_data32(il, offset, importDesc->ImportAddressTableRVA); dump_image_thunk_data32(il, offset, importDesc->ImportAddressTableRVA);
printf("\n"); printf("\n");