Ignore the delay load directory size.

This commit is contained in:
Dmitry Timoshkov 2005-10-06 11:34:29 +00:00 committed by Alexandre Julliard
parent 119da5a94c
commit ea4586215e
1 changed files with 10 additions and 18 deletions

View File

@ -583,7 +583,6 @@ static void dump_dir_delay_imported_functions(void)
DWORD pUnloadIAT; DWORD pUnloadIAT;
DWORD dwTimeStamp; DWORD dwTimeStamp;
} *importDesc = get_dir(IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT); } *importDesc = get_dir(IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT);
unsigned nb_imp, i;
DWORD directorySize; DWORD directorySize;
if (!importDesc) return; if (!importDesc) return;
@ -597,22 +596,16 @@ static void dump_dir_delay_imported_functions(void)
IMAGE_OPTIONAL_HEADER32 *opt = (IMAGE_OPTIONAL_HEADER32 *)&PE_nt_headers->OptionalHeader; IMAGE_OPTIONAL_HEADER32 *opt = (IMAGE_OPTIONAL_HEADER32 *)&PE_nt_headers->OptionalHeader;
directorySize = opt->DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size; directorySize = opt->DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size;
} }
nb_imp = directorySize / sizeof(*importDesc);
if (!nb_imp) return;
printf("Delay Import Table size: %08lx\n", directorySize); /* FIXME */ printf("Delay Import Table size: %08lx\n", directorySize); /* FIXME */
for (i = 0; i < nb_imp - 1; i++) /* the last descr is set as 0 as a sentinel */ for (;;)
{ {
BOOL use_rva = importDesc->grAttrs & 1; BOOL use_rva = importDesc->grAttrs & 1;
IMAGE_THUNK_DATA32 *il; IMAGE_THUNK_DATA32 *il;
if (!importDesc->szName || !importDesc->pIAT || !importDesc->pINT) if (!importDesc->szName || !importDesc->pIAT || !importDesc->pINT) break;
{
/* FIXME */
printf("<<<<<<<null entry\n");
break;
}
printf(" grAttrs %08lx offset %08lx %s\n", importDesc->grAttrs, Offset(importDesc), printf(" grAttrs %08lx offset %08lx %s\n", importDesc->grAttrs, Offset(importDesc),
use_rva ? (char *)RVA(importDesc->szName, sizeof(DWORD)) : (char *)importDesc->szName); use_rva ? (char *)RVA(importDesc->szName, sizeof(DWORD)) : (char *)importDesc->szName);
printf(" Hint/Name Table: %08lx\n", importDesc->pINT); printf(" Hint/Name Table: %08lx\n", importDesc->pINT);
@ -624,16 +617,15 @@ static void dump_dir_delay_imported_functions(void)
il = use_rva ? (IMAGE_THUNK_DATA32 *)RVA(importDesc->pINT, sizeof(DWORD)) : (IMAGE_THUNK_DATA32 *)importDesc->pINT; il = use_rva ? (IMAGE_THUNK_DATA32 *)RVA(importDesc->pINT, sizeof(DWORD)) : (IMAGE_THUNK_DATA32 *)importDesc->pINT;
if (!il) if (!il)
{
printf("Can't grab thunk data, going to next imported DLL\n"); printf("Can't grab thunk data, going to next imported DLL\n");
continue;
}
if (PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
dump_image_thunk_data64((IMAGE_THUNK_DATA64 *)il);
else else
dump_image_thunk_data32(il); {
printf("\n"); if (PE_nt_headers->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
dump_image_thunk_data64((IMAGE_THUNK_DATA64 *)il);
else
dump_image_thunk_data32(il);
printf("\n");
}
importDesc++; importDesc++;
} }
printf("\n"); printf("\n");