Commit bb223b78 authored by Alexandre Julliard's avatar Alexandre Julliard

winedump: Ordinal functions can be forwards too.

parent caf66f0f
...@@ -492,9 +492,7 @@ static void dump_dir_exported_functions(void) ...@@ -492,9 +492,7 @@ static void dump_dir_exported_functions(void)
pFunc = RVA(exportDir->AddressOfFunctions, exportDir->NumberOfFunctions * sizeof(DWORD)); pFunc = RVA(exportDir->AddressOfFunctions, exportDir->NumberOfFunctions * sizeof(DWORD));
if (!pFunc) {printf("Can't grab functions' address table\n"); return;} if (!pFunc) {printf("Can't grab functions' address table\n"); return;}
pName = RVA(exportDir->AddressOfNames, exportDir->NumberOfNames * sizeof(DWORD)); pName = RVA(exportDir->AddressOfNames, exportDir->NumberOfNames * sizeof(DWORD));
if (!pName) {printf("Can't grab functions' name table\n"); return;}
pOrdl = RVA(exportDir->AddressOfNameOrdinals, exportDir->NumberOfNames * sizeof(WORD)); pOrdl = RVA(exportDir->AddressOfNameOrdinals, exportDir->NumberOfNames * sizeof(WORD));
if (!pOrdl) {printf("Can't grab functions' ordinal table\n"); return;}
funcs = calloc( exportDir->NumberOfFunctions, sizeof(*funcs) ); funcs = calloc( exportDir->NumberOfFunctions, sizeof(*funcs) );
if (!funcs) fatal("no memory"); if (!funcs) fatal("no memory");
...@@ -506,15 +504,15 @@ static void dump_dir_exported_functions(void) ...@@ -506,15 +504,15 @@ static void dump_dir_exported_functions(void)
if (!pFunc[i]) continue; if (!pFunc[i]) continue;
printf(" %08X %5u ", pFunc[i], exportDir->Base + i); printf(" %08X %5u ", pFunc[i], exportDir->Base + i);
if (funcs[i]) if (funcs[i])
{
printf("%s", get_symbol_str((const char*)RVA(funcs[i], sizeof(DWORD)))); printf("%s", get_symbol_str((const char*)RVA(funcs[i], sizeof(DWORD))));
/* check for forwarded function */ else
if ((const char *)RVA(pFunc[i],1) >= (const char *)exportDir && printf("<by ordinal>");
(const char *)RVA(pFunc[i],1) < (const char *)exportDir + size)
printf(" (-> %s)", (const char *)RVA(pFunc[i],1)); /* check for forwarded function */
printf("\n"); if ((const char *)RVA(pFunc[i],1) >= (const char *)exportDir &&
} (const char *)RVA(pFunc[i],1) < (const char *)exportDir + size)
else printf("<by ordinal>\n"); printf(" (-> %s)", (const char *)RVA(pFunc[i],1));
printf("\n");
} }
free(funcs); free(funcs);
printf("\n"); printf("\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment