winedump: Correctly get to the optional header for 64 bit images.

This commit is contained in:
Eric Pouech 2011-05-01 09:46:12 +02:00 committed by Alexandre Julliard
parent 9c76ed18b7
commit 1d3dfd9e8d
1 changed files with 3 additions and 5 deletions

View File

@ -941,13 +941,11 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx)
static void dump_dir_debug(void)
{
const IMAGE_DEBUG_DIRECTORY*debugDir = get_dir(IMAGE_FILE_DEBUG_DIRECTORY);
unsigned nb_dbg, i;
const IMAGE_DEBUG_DIRECTORY*debugDir = get_dir_and_size(IMAGE_FILE_DEBUG_DIRECTORY, &nb_dbg);
if (!debugDir) return;
nb_dbg = PE_nt_headers->OptionalHeader.DataDirectory[IMAGE_FILE_DEBUG_DIRECTORY].Size /
sizeof(*debugDir);
if (!nb_dbg) return;
nb_dbg /= sizeof(*debugDir);
if (!debugDir || !nb_dbg) return;
printf("Debug Table (%u directories)\n", nb_dbg);