Commit ba123abf authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

winedump: Win64 printf format warning fixes.

parent d2d33017
...@@ -3,7 +3,6 @@ TOPOBJDIR = ../.. ...@@ -3,7 +3,6 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
EXEEXT = @EXEEXT@ EXEEXT = @EXEEXT@
DEFS = -DWINE_NO_LONG_AS_INT
PROGRAMS = winedump$(EXEEXT) PROGRAMS = winedump$(EXEEXT)
MANPAGES = winedump.man MANPAGES = winedump.man
......
...@@ -424,9 +424,9 @@ static void dump_codeview_headers(unsigned long base, unsigned long len) ...@@ -424,9 +424,9 @@ static void dump_codeview_headers(unsigned long base, unsigned long len)
const struct {DWORD TimeStamp; DWORD Dunno; char Name[1];} *pdb_data; const struct {DWORD TimeStamp; DWORD Dunno; char Name[1];} *pdb_data;
pdb_data = (const void *)(signature + 1); pdb_data = (const void *)(signature + 1);
printf(" TimeStamp: %08lX (%s)\n", printf(" TimeStamp: %08X (%s)\n",
pdb_data->TimeStamp, get_time_str(pdb_data->TimeStamp)); pdb_data->TimeStamp, get_time_str(pdb_data->TimeStamp));
printf(" Dunno: %08lX\n", pdb_data->Dunno); printf(" Dunno: %08X\n", pdb_data->Dunno);
printf(" Filename: %s\n", pdb_data->Name); printf(" Filename: %s\n", pdb_data->Name);
return; return;
} }
...@@ -544,7 +544,7 @@ void dump_coff(unsigned long coffbase, unsigned long len, const void* pmt) ...@@ -544,7 +544,7 @@ void dump_coff(unsigned long coffbase, unsigned long len, const void* pmt)
*/ */
nampnt = get_coff_name( coff_sym, coff_strtab ); nampnt = get_coff_name( coff_sym, coff_strtab );
printf("%05d | %02d:%08lx [%08lx] | %s\n", i, coff_sym->SectionNumber - 1, coff_sym->Value - base, coff_sym->Value, nampnt); printf("%05d | %02d:%08x [%08x] | %s\n", i, coff_sym->SectionNumber - 1, coff_sym->Value - base, coff_sym->Value, nampnt);
i += naux; i += naux;
continue; continue;
} }
...@@ -559,7 +559,7 @@ void dump_coff(unsigned long coffbase, unsigned long len, const void* pmt) ...@@ -559,7 +559,7 @@ void dump_coff(unsigned long coffbase, unsigned long len, const void* pmt)
/* FIXME: add code to find out the file this symbol belongs to, /* FIXME: add code to find out the file this symbol belongs to,
* see winedbg */ * see winedbg */
printf("%05d | %02d:%08lx [%08lx] | %s\n", i, coff_sym->SectionNumber - 1, coff_sym->Value - base, coff_sym->Value, nampnt); printf("%05d | %02d:%08x [%08x] | %s\n", i, coff_sym->SectionNumber - 1, coff_sym->Value - base, coff_sym->Value, nampnt);
i += naux; i += naux;
continue; continue;
} }
......
...@@ -96,7 +96,7 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le ) ...@@ -96,7 +96,7 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le )
le->e32_border == 0 ? "little-indian" : "big-endian"); le->e32_border == 0 ? "little-indian" : "big-endian");
printf( " Word order: %s\n", printf( " Word order: %s\n",
le->e32_worder == 0 ? "little-indian" : "big-endian"); le->e32_worder == 0 ? "little-indian" : "big-endian");
printf( " Executable format level: %ld\n", printf( " Executable format level: %d\n",
le->e32_level); le->e32_level);
printf( " CPU type: %s\n", printf( " CPU type: %s\n",
le->e32_cpu == 0x01 ? "Intel 80286" : le->e32_cpu == 0x01 ? "Intel 80286" :
...@@ -115,9 +115,9 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le ) ...@@ -115,9 +115,9 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le )
le->e32_os == 0x03 ? "DOS 4.x" : le->e32_os == 0x03 ? "DOS 4.x" :
le->e32_os == 0x04 ? "Windows 386" : le->e32_os == 0x04 ? "Windows 386" :
"Unknown"); "Unknown");
printf( " Module version: %ld\n", printf( " Module version: %d\n",
le->e32_ver); le->e32_ver);
printf( " Module type flags: %08lx\n", printf( " Module type flags: %08x\n",
le->e32_mflags); le->e32_mflags);
if (le->e32_mflags & 0x8000) if (le->e32_mflags & 0x8000)
{ {
...@@ -140,85 +140,85 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le ) ...@@ -140,85 +140,85 @@ static void dump_le_header( const IMAGE_VXD_HEADER *le )
if (le->e32_mflags & 0x8000) if (le->e32_mflags & 0x8000)
printf( " Module is DLL\n"); printf( " Module is DLL\n");
} }
printf( " Number of memory pages: %ld\n", printf( " Number of memory pages: %d\n",
le->e32_mpages); le->e32_mpages);
printf( " Initial object CS number: %08lx\n", printf( " Initial object CS number: %08x\n",
le->e32_startobj); le->e32_startobj);
printf( " Initial EIP: %08lx\n", printf( " Initial EIP: %08x\n",
le->e32_eip); le->e32_eip);
printf( " Initial object SS number: %08lx\n", printf( " Initial object SS number: %08x\n",
le->e32_stackobj); le->e32_stackobj);
printf( " Initial ESP: %08lx\n", printf( " Initial ESP: %08x\n",
le->e32_esp); le->e32_esp);
printf( " Memory page size: %ld\n", printf( " Memory page size: %d\n",
le->e32_pagesize); le->e32_pagesize);
printf( " Bytes on last page: %ld\n", printf( " Bytes on last page: %d\n",
le->e32_lastpagesize); le->e32_lastpagesize);
printf( " Fix-up section size: %ld\n", printf( " Fix-up section size: %d\n",
le->e32_fixupsize); le->e32_fixupsize);
printf( " Fix-up section checksum: %08lx\n", printf( " Fix-up section checksum: %08x\n",
le->e32_fixupsum); le->e32_fixupsum);
printf( " Loader section size: %ld\n", printf( " Loader section size: %d\n",
le->e32_ldrsize); le->e32_ldrsize);
printf( " Loader section checksum: %08lx\n", printf( " Loader section checksum: %08x\n",
le->e32_ldrsum); le->e32_ldrsum);
printf( " Offset of object table: %08lx\n", printf( " Offset of object table: %08x\n",
le->e32_objtab); le->e32_objtab);
printf( " Object table entries: %ld\n", printf( " Object table entries: %d\n",
le->e32_objcnt); le->e32_objcnt);
printf( " Object page map offset: %08lx\n", printf( " Object page map offset: %08x\n",
le->e32_objmap); le->e32_objmap);
printf( " Object iterate data map offset: %08lx\n", printf( " Object iterate data map offset: %08x\n",
le->e32_itermap); le->e32_itermap);
printf( " Resource table offset: %08lx\n", printf( " Resource table offset: %08x\n",
le->e32_rsrctab); le->e32_rsrctab);
printf( " Resource table entries: %ld\n", printf( " Resource table entries: %d\n",
le->e32_rsrccnt); le->e32_rsrccnt);
printf( " Resident names table offset: %08lx\n", printf( " Resident names table offset: %08x\n",
le->e32_restab); le->e32_restab);
printf( " Entry table offset: %08lx\n", printf( " Entry table offset: %08x\n",
le->e32_enttab); le->e32_enttab);
printf( " Module directives table offset: %08lx\n", printf( " Module directives table offset: %08x\n",
le->e32_dirtab); le->e32_dirtab);
printf( " Module directives entries: %ld\n", printf( " Module directives entries: %d\n",
le->e32_dircnt); le->e32_dircnt);
printf( " Fix-up page table offset: %08lx\n", printf( " Fix-up page table offset: %08x\n",
le->e32_fpagetab); le->e32_fpagetab);
printf( " Fix-up record table offset: %08lx\n", printf( " Fix-up record table offset: %08x\n",
le->e32_frectab); le->e32_frectab);
printf( " Imported modules name table offset: %08lx\n", printf( " Imported modules name table offset: %08x\n",
le->e32_impmod); le->e32_impmod);
printf( " Imported modules count: %ld\n", printf( " Imported modules count: %d\n",
le->e32_impmodcnt); le->e32_impmodcnt);
printf( " Imported procedure name table offset: %08lx\n", printf( " Imported procedure name table offset: %08x\n",
le->e32_impproc); le->e32_impproc);
printf( " Per-page checksum table offset: %08lx\n", printf( " Per-page checksum table offset: %08x\n",
le->e32_pagesum); le->e32_pagesum);
printf( " Data pages offset from top of table: %08lx\n", printf( " Data pages offset from top of table: %08x\n",
le->e32_datapage); le->e32_datapage);
printf( " Preload page count: %08lx\n", printf( " Preload page count: %08x\n",
le->e32_preload); le->e32_preload);
printf( " Non-resident names table offset: %08lx\n", printf( " Non-resident names table offset: %08x\n",
le->e32_nrestab); le->e32_nrestab);
printf( " Non-resident names table length: %ld\n", printf( " Non-resident names table length: %d\n",
le->e32_cbnrestab); le->e32_cbnrestab);
printf( " Non-resident names table checksum: %08lx\n", printf( " Non-resident names table checksum: %08x\n",
le->e32_nressum); le->e32_nressum);
printf( " Automatic data object: %08lx\n", printf( " Automatic data object: %08x\n",
le->e32_autodata); le->e32_autodata);
printf( " Debug information offset: %08lx\n", printf( " Debug information offset: %08x\n",
le->e32_debuginfo); le->e32_debuginfo);
printf( " Debug information length: %ld\n", printf( " Debug information length: %d\n",
le->e32_debuglen); le->e32_debuglen);
printf( " Preload instance pages number: %ld\n", printf( " Preload instance pages number: %d\n",
le->e32_instpreload); le->e32_instpreload);
printf( " Demand instance pages number: %ld\n", printf( " Demand instance pages number: %d\n",
le->e32_instdemand); le->e32_instdemand);
printf( " Extra heap allocation: %ld\n", printf( " Extra heap allocation: %d\n",
le->e32_heapsize); le->e32_heapsize);
printf( " VxD resource table offset: %08lx\n", printf( " VxD resource table offset: %08x\n",
le->e32_winresoff); le->e32_winresoff);
printf( " Size of VxD resource table: %ld\n", printf( " Size of VxD resource table: %d\n",
le->e32_winreslen); le->e32_winreslen);
printf( " VxD identifier: %x\n", printf( " VxD identifier: %x\n",
le->e32_devid); le->e32_devid);
......
...@@ -266,17 +266,17 @@ static int dump_location(int fd) ...@@ -266,17 +266,17 @@ static int dump_location(int fd)
printf("Location\n"); printf("Location\n");
printf("--------\n\n"); printf("--------\n\n");
printf("Total size = %ld\n", loc->dwTotalSize); printf("Total size = %d\n", loc->dwTotalSize);
printf("Header size = %ld\n", loc->dwHeaderSize); printf("Header size = %d\n", loc->dwHeaderSize);
printf("Flags = %08lx\n", loc->dwFlags); printf("Flags = %08x\n", loc->dwFlags);
/* dump out information about the volume the link points to */ /* dump out information about the volume the link points to */
printf("Volume ofs = %08lx ", loc->dwVolTableOfs); printf("Volume ofs = %08x ", loc->dwVolTableOfs);
if (loc->dwVolTableOfs && (loc->dwVolTableOfs<loc->dwTotalSize)) if (loc->dwVolTableOfs && (loc->dwVolTableOfs<loc->dwTotalSize))
{ {
LOCAL_VOLUME_INFO *vol = (LOCAL_VOLUME_INFO *) &p[loc->dwVolTableOfs]; LOCAL_VOLUME_INFO *vol = (LOCAL_VOLUME_INFO *) &p[loc->dwVolTableOfs];
printf("size %ld type %ld serial %08lx label %ld ", printf("size %d type %d serial %08x label %d ",
vol->dwSize, vol->dwType, vol->dwVolSerial, vol->dwVolLabelOfs); vol->dwSize, vol->dwType, vol->dwVolSerial, vol->dwVolLabelOfs);
if(vol->dwVolLabelOfs) if(vol->dwVolLabelOfs)
printf("(\"%s\")", &p[loc->dwVolTableOfs + vol->dwVolLabelOfs]); printf("(\"%s\")", &p[loc->dwVolTableOfs + vol->dwVolLabelOfs]);
...@@ -284,13 +284,13 @@ static int dump_location(int fd) ...@@ -284,13 +284,13 @@ static int dump_location(int fd)
printf("\n"); printf("\n");
/* dump out the path the link points to */ /* dump out the path the link points to */
printf("LocalPath ofs = %08lx ", loc->dwLocalPathOfs); printf("LocalPath ofs = %08x ", loc->dwLocalPathOfs);
if( loc->dwLocalPathOfs && (loc->dwLocalPathOfs < loc->dwTotalSize) ) if( loc->dwLocalPathOfs && (loc->dwLocalPathOfs < loc->dwTotalSize) )
printf("(\"%s\")", &p[loc->dwLocalPathOfs]); printf("(\"%s\")", &p[loc->dwLocalPathOfs]);
printf("\n"); printf("\n");
printf("Net Path ofs = %08lx\n", loc->dwNetworkVolTableOfs); printf("Net Path ofs = %08x\n", loc->dwNetworkVolTableOfs);
printf("Final Path = %08lx ", loc->dwFinalPathOfs); printf("Final Path = %08x ", loc->dwFinalPathOfs);
if( loc->dwFinalPathOfs && (loc->dwFinalPathOfs < loc->dwTotalSize) ) if( loc->dwFinalPathOfs && (loc->dwFinalPathOfs < loc->dwTotalSize) )
printf("(\"%s\")", &p[loc->dwFinalPathOfs]); printf("(\"%s\")", &p[loc->dwFinalPathOfs]);
printf("\n"); printf("\n");
...@@ -348,7 +348,7 @@ static int dump_advertise_info(int fd, const char *type) ...@@ -348,7 +348,7 @@ static int dump_advertise_info(int fd, const char *type)
printf("Advertise Info\n"); printf("Advertise Info\n");
printf("--------------\n\n"); printf("--------------\n\n");
printf("magic = %lx\n", avt->magic); printf("magic = %x\n", avt->magic);
printf("%s = %s\n", type, avt->bufA); printf("%s = %s\n", type, avt->bufA);
if (avt->magic == 0xa0000006) if (avt->magic == 0xa0000006)
{ {
...@@ -402,19 +402,19 @@ static int dump_lnk_fd(int fd) ...@@ -402,19 +402,19 @@ static int dump_lnk_fd(int fd)
printf("Header\n"); printf("Header\n");
printf("------\n\n"); printf("------\n\n");
printf("Size: %04lx\n", hdr->dwSize); printf("Size: %04x\n", hdr->dwSize);
printf("GUID: %s\n", guid); printf("GUID: %s\n", guid);
printf("FileAttr: %08lx\n", hdr->dwFileAttr); printf("FileAttr: %08x\n", hdr->dwFileAttr);
printf("FileLength: %08lx\n", hdr->dwFileLength); printf("FileLength: %08x\n", hdr->dwFileLength);
printf("nIcon: %ld\n", hdr->nIcon); printf("nIcon: %d\n", hdr->nIcon);
printf("Startup: %ld\n", hdr->fStartup); printf("Startup: %d\n", hdr->fStartup);
printf("HotKey: %08lx\n", hdr->wHotKey); printf("HotKey: %08x\n", hdr->wHotKey);
printf("Unknown5: %08lx\n", hdr->Unknown5); printf("Unknown5: %08x\n", hdr->Unknown5);
printf("Unknown6: %08lx\n", hdr->Unknown6); printf("Unknown6: %08x\n", hdr->Unknown6);
/* dump out all the flags */ /* dump out all the flags */
printf("Flags: %04lx ( ", hdr->dwFlags); printf("Flags: %04x ( ", hdr->dwFlags);
#define FLAG(x) if(hdr->dwFlags & SCF_##x) printf("%s ",#x); #define FLAG(x) if(hdr->dwFlags & SCF_##x) printf("%s ",#x);
FLAG(PIDL) FLAG(PIDL)
FLAG(LOCATION) FLAG(LOCATION)
...@@ -429,7 +429,7 @@ static int dump_lnk_fd(int fd) ...@@ -429,7 +429,7 @@ static int dump_lnk_fd(int fd)
#undef FLAG #undef FLAG
printf(")\n"); printf(")\n");
printf("Length: %04lx\n", hdr->dwFileLength); printf("Length: %04x\n", hdr->dwFileLength);
printf("\n"); printf("\n");
if (hdr->dwFlags & SCF_PIDL) if (hdr->dwFlags & SCF_PIDL)
......
...@@ -72,20 +72,20 @@ void mdmp_dump(void) ...@@ -72,20 +72,20 @@ void mdmp_dump(void)
return; return;
} }
printf("Signature: %lu (%.4s)\n", hdr->Signature, (const char*)&hdr->Signature); printf("Signature: %u (%.4s)\n", hdr->Signature, (const char*)&hdr->Signature);
printf("Version: %lx\n", hdr->Version); printf("Version: %x\n", hdr->Version);
printf("NumberOfStreams: %lu\n", hdr->NumberOfStreams); printf("NumberOfStreams: %u\n", hdr->NumberOfStreams);
printf("StreamDirectoryRva: %lu\n", hdr->StreamDirectoryRva); printf("StreamDirectoryRva: %u\n", hdr->StreamDirectoryRva);
printf("CheckSum: %lu\n", hdr->CheckSum); printf("CheckSum: %u\n", hdr->CheckSum);
printf("TimeDateStamp: %s\n", get_time_str(hdr->u.TimeDateStamp)); printf("TimeDateStamp: %s\n", get_time_str(hdr->u.TimeDateStamp));
printf("Flags: %lx%08lx\n", (DWORD)(hdr->Flags >> 32), (DWORD)hdr->Flags); printf("Flags: %x%08x\n", (DWORD)(hdr->Flags >> 32), (DWORD)hdr->Flags);
for (idx = 0; idx <= LastReservedStream; idx++) for (idx = 0; idx <= LastReservedStream; idx++)
{ {
if (!(dir = get_mdmp_dir(hdr, idx))) continue; if (!(dir = get_mdmp_dir(hdr, idx))) continue;
stream = PRD(dir->Location.Rva, dir->Location.DataSize); stream = PRD(dir->Location.Rva, dir->Location.DataSize);
printf("Directory [%lu]: ", ndir++); printf("Directory [%u]: ", ndir++);
switch (dir->StreamType) switch (dir->StreamType)
{ {
case ThreadListStream: case ThreadListStream:
...@@ -94,16 +94,16 @@ void mdmp_dump(void) ...@@ -94,16 +94,16 @@ void mdmp_dump(void)
const MINIDUMP_THREAD* mt = &mtl->Threads[0]; const MINIDUMP_THREAD* mt = &mtl->Threads[0];
unsigned int i; unsigned int i;
printf("Threads: %lu\n", mtl->NumberOfThreads); printf("Threads: %u\n", mtl->NumberOfThreads);
for (i = 0; i < mtl->NumberOfThreads; i++, mt++) for (i = 0; i < mtl->NumberOfThreads; i++, mt++)
{ {
printf(" Thread: #%d\n", i); printf(" Thread: #%d\n", i);
printf(" ThreadId: %lu\n", mt->ThreadId); printf(" ThreadId: %u\n", mt->ThreadId);
printf(" SuspendCount: %lu\n", mt->SuspendCount); printf(" SuspendCount: %u\n", mt->SuspendCount);
printf(" PriorityClass: %lu\n", mt->PriorityClass); printf(" PriorityClass: %u\n", mt->PriorityClass);
printf(" Priority: %lu\n", mt->Priority); printf(" Priority: %u\n", mt->Priority);
printf(" Teb: 0x%lx%08lx\n", (DWORD)(mt->Teb >> 32), (DWORD)mt->Teb); printf(" Teb: 0x%x%08x\n", (DWORD)(mt->Teb >> 32), (DWORD)mt->Teb);
printf(" Stack: 0x%lx%08lx-0x%lx%08lx\n", printf(" Stack: 0x%x%08x-0x%x%08x\n",
(DWORD)(mt->Stack.StartOfMemoryRange >> 32), (DWORD)(mt->Stack.StartOfMemoryRange >> 32),
(DWORD)mt->Stack.StartOfMemoryRange, (DWORD)mt->Stack.StartOfMemoryRange,
(DWORD)((mt->Stack.StartOfMemoryRange + mt->Stack.Memory.DataSize) >> 32), (DWORD)((mt->Stack.StartOfMemoryRange + mt->Stack.Memory.DataSize) >> 32),
...@@ -123,23 +123,23 @@ void mdmp_dump(void) ...@@ -123,23 +123,23 @@ void mdmp_dump(void)
const char* p1; const char* p1;
const char* p2; const char* p2;
printf("Modules (%s): %lu\n", printf("Modules (%s): %u\n",
dir->StreamType == ModuleListStream ? "PE" : "ELF", dir->StreamType == ModuleListStream ? "PE" : "ELF",
mml->NumberOfModules); mml->NumberOfModules);
for (i = 0; i < mml->NumberOfModules; i++, mm++) for (i = 0; i < mml->NumberOfModules; i++, mm++)
{ {
printf(" Module #%d:\n", i); printf(" Module #%d:\n", i);
printf(" BaseOfImage: 0x%lx%08lx\n", printf(" BaseOfImage: 0x%x%08x\n",
(DWORD)(mm->BaseOfImage >> 32), (DWORD) mm->BaseOfImage); (DWORD)(mm->BaseOfImage >> 32), (DWORD) mm->BaseOfImage);
printf(" SizeOfImage: %lu\n", mm->SizeOfImage); printf(" SizeOfImage: %u\n", mm->SizeOfImage);
printf(" CheckSum: %lu\n", mm->CheckSum); printf(" CheckSum: %u\n", mm->CheckSum);
printf(" TimeDateStamp: %s\n", get_time_str(mm->TimeDateStamp)); printf(" TimeDateStamp: %s\n", get_time_str(mm->TimeDateStamp));
printf(" ModuleName: "); printf(" ModuleName: ");
dump_mdmp_string(mm->ModuleNameRva); dump_mdmp_string(mm->ModuleNameRva);
printf("\n"); printf("\n");
printf(" VersionInfo:\n"); printf(" VersionInfo:\n");
printf(" dwSignature: %lx\n", mm->VersionInfo.dwSignature); printf(" dwSignature: %x\n", mm->VersionInfo.dwSignature);
printf(" dwStrucVersion: %lx\n", printf(" dwStrucVersion: %x\n",
mm->VersionInfo.dwStrucVersion); mm->VersionInfo.dwStrucVersion);
printf(" dwFileVersion: %d,%d,%d,%d\n", printf(" dwFileVersion: %d,%d,%d,%d\n",
HIWORD(mm->VersionInfo.dwFileVersionMS), HIWORD(mm->VersionInfo.dwFileVersionMS),
...@@ -151,7 +151,7 @@ void mdmp_dump(void) ...@@ -151,7 +151,7 @@ void mdmp_dump(void)
LOWORD(mm->VersionInfo.dwProductVersionMS), LOWORD(mm->VersionInfo.dwProductVersionMS),
HIWORD(mm->VersionInfo.dwProductVersionLS), HIWORD(mm->VersionInfo.dwProductVersionLS),
LOWORD(mm->VersionInfo.dwProductVersionLS)); LOWORD(mm->VersionInfo.dwProductVersionLS));
printf(" dwFileFlagsMask: %lu\n", printf(" dwFileFlagsMask: %u\n",
mm->VersionInfo.dwFileFlagsMask); mm->VersionInfo.dwFileFlagsMask);
printf(" dwFileFlags: %s%s%s%s%s%s\n", printf(" dwFileFlags: %s%s%s%s%s%s\n",
mm->VersionInfo.dwFileFlags & VS_FF_DEBUG ? "Debug " : "", mm->VersionInfo.dwFileFlags & VS_FF_DEBUG ? "Debug " : "",
...@@ -195,17 +195,17 @@ void mdmp_dump(void) ...@@ -195,17 +195,17 @@ void mdmp_dump(void)
default: p1 = "---"; break; default: p1 = "---"; break;
} }
printf(" dwFileType: %s\n", p1); printf(" dwFileType: %s\n", p1);
printf(" dwFileSubtype: %lu\n", printf(" dwFileSubtype: %u\n",
mm->VersionInfo.dwFileSubtype); mm->VersionInfo.dwFileSubtype);
printf(" dwFileDate: %lx%08lx\n", printf(" dwFileDate: %x%08x\n",
mm->VersionInfo.dwFileDateMS, mm->VersionInfo.dwFileDateLS); mm->VersionInfo.dwFileDateMS, mm->VersionInfo.dwFileDateLS);
printf(" CvRecord: <%lu>\n", mm->CvRecord.DataSize); printf(" CvRecord: <%u>\n", mm->CvRecord.DataSize);
dump_mdmp_data(&mm->CvRecord, " "); dump_mdmp_data(&mm->CvRecord, " ");
printf(" MiscRecord: <%lu>\n", mm->MiscRecord.DataSize); printf(" MiscRecord: <%u>\n", mm->MiscRecord.DataSize);
dump_mdmp_data(&mm->MiscRecord, " "); dump_mdmp_data(&mm->MiscRecord, " ");
printf(" Reserved0: 0x%lx%08lx\n", printf(" Reserved0: 0x%x%08x\n",
(DWORD)(mm->Reserved0 >> 32), (DWORD)mm->Reserved0); (DWORD)(mm->Reserved0 >> 32), (DWORD)mm->Reserved0);
printf(" Reserved1: 0x%lx%08lx\n", printf(" Reserved1: 0x%x%08x\n",
(DWORD)(mm->Reserved1 >> 32), (DWORD)mm->Reserved1); (DWORD)(mm->Reserved1 >> 32), (DWORD)mm->Reserved1);
} }
} }
...@@ -216,11 +216,11 @@ void mdmp_dump(void) ...@@ -216,11 +216,11 @@ void mdmp_dump(void)
const MINIDUMP_MEMORY_DESCRIPTOR* mmd = &mml->MemoryRanges[0]; const MINIDUMP_MEMORY_DESCRIPTOR* mmd = &mml->MemoryRanges[0];
unsigned int i; unsigned int i;
printf("Memory Ranges: %lu\n", mml->NumberOfMemoryRanges); printf("Memory Ranges: %u\n", mml->NumberOfMemoryRanges);
for (i = 0; i < mml->NumberOfMemoryRanges; i++, mmd++) for (i = 0; i < mml->NumberOfMemoryRanges; i++, mmd++)
{ {
printf(" Memory Range #%d:\n", i); printf(" Memory Range #%d:\n", i);
printf(" Range: 0x%lx%08lx-0x%lx%08lx\n", printf(" Range: 0x%x%08x-0x%x%08x\n",
(DWORD)(mmd->StartOfMemoryRange >> 32), (DWORD)(mmd->StartOfMemoryRange >> 32),
(DWORD)mmd->StartOfMemoryRange, (DWORD)mmd->StartOfMemoryRange,
(DWORD)((mmd->StartOfMemoryRange + mmd->Memory.DataSize) >> 32), (DWORD)((mmd->StartOfMemoryRange + mmd->Memory.DataSize) >> 32),
...@@ -305,21 +305,21 @@ void mdmp_dump(void) ...@@ -305,21 +305,21 @@ void mdmp_dump(void)
break; break;
default: str = "???"; break; default: str = "???"; break;
} }
printf(" Version: Windows %s (%lu)\n", str, msi->BuildNumber); printf(" Version: Windows %s (%u)\n", str, msi->BuildNumber);
printf(" PlatformId: %lu\n", msi->PlatformId); printf(" PlatformId: %u\n", msi->PlatformId);
printf(" CSD: "); printf(" CSD: ");
dump_mdmp_string(msi->CSDVersionRva); dump_mdmp_string(msi->CSDVersionRva);
printf("\n"); printf("\n");
printf(" Reserved1: %lu\n", msi->u1.Reserved1); printf(" Reserved1: %u\n", msi->u1.Reserved1);
if (msi->ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL) if (msi->ProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
{ {
printf(" x86.VendorId: %.12s\n", printf(" x86.VendorId: %.12s\n",
(const char*)&msi->Cpu.X86CpuInfo.VendorId[0]); (const char*)&msi->Cpu.X86CpuInfo.VendorId[0]);
printf(" x86.VersionInformation: %lx\n", printf(" x86.VersionInformation: %x\n",
msi->Cpu.X86CpuInfo.VersionInformation); msi->Cpu.X86CpuInfo.VersionInformation);
printf(" x86.FeatureInformation: %lx\n", printf(" x86.FeatureInformation: %x\n",
msi->Cpu.X86CpuInfo.FeatureInformation); msi->Cpu.X86CpuInfo.FeatureInformation);
printf(" x86.AMDExtendedCpuFeatures: %lu\n", printf(" x86.AMDExtendedCpuFeatures: %u\n",
msi->Cpu.X86CpuInfo.AMDExtendedCpuFeatures); msi->Cpu.X86CpuInfo.AMDExtendedCpuFeatures);
} }
} }
...@@ -329,17 +329,17 @@ void mdmp_dump(void) ...@@ -329,17 +329,17 @@ void mdmp_dump(void)
const MINIDUMP_MISC_INFO* mmi = (const MINIDUMP_MISC_INFO*)stream; const MINIDUMP_MISC_INFO* mmi = (const MINIDUMP_MISC_INFO*)stream;
printf("Misc Information\n"); printf("Misc Information\n");
printf(" Size: %lu\n", mmi->SizeOfInfo); printf(" Size: %u\n", mmi->SizeOfInfo);
printf(" Flags: %s%s\n", printf(" Flags: %s%s\n",
mmi->Flags1 & MINIDUMP_MISC1_PROCESS_ID ? "ProcessId " : "", mmi->Flags1 & MINIDUMP_MISC1_PROCESS_ID ? "ProcessId " : "",
mmi->Flags1 & MINIDUMP_MISC1_PROCESS_TIMES ? "ProcessTimes " : ""); mmi->Flags1 & MINIDUMP_MISC1_PROCESS_TIMES ? "ProcessTimes " : "");
if (mmi->Flags1 & MINIDUMP_MISC1_PROCESS_ID) if (mmi->Flags1 & MINIDUMP_MISC1_PROCESS_ID)
printf(" ProcessId: %lu\n", mmi->ProcessId); printf(" ProcessId: %u\n", mmi->ProcessId);
if (mmi->Flags1 & MINIDUMP_MISC1_PROCESS_TIMES) if (mmi->Flags1 & MINIDUMP_MISC1_PROCESS_TIMES)
{ {
printf(" ProcessCreateTime: %lu\n", mmi->ProcessCreateTime); printf(" ProcessCreateTime: %u\n", mmi->ProcessCreateTime);
printf(" ProcessUserTime: %lu\n", mmi->ProcessUserTime); printf(" ProcessUserTime: %u\n", mmi->ProcessUserTime);
printf(" ProcessKernelTime: %lu\n", mmi->ProcessKernelTime); printf(" ProcessKernelTime: %u\n", mmi->ProcessKernelTime);
} }
} }
break; break;
...@@ -349,21 +349,21 @@ void mdmp_dump(void) ...@@ -349,21 +349,21 @@ void mdmp_dump(void)
unsigned int i; unsigned int i;
printf("Exception:\n"); printf("Exception:\n");
printf(" ThreadId: %08lx\n", mes->ThreadId); printf(" ThreadId: %08x\n", mes->ThreadId);
printf(" ExceptionRecord:\n"); printf(" ExceptionRecord:\n");
printf(" ExceptionCode: %lu\n", mes->ExceptionRecord.ExceptionCode); printf(" ExceptionCode: %u\n", mes->ExceptionRecord.ExceptionCode);
printf(" ExceptionFlags: %lu\n", mes->ExceptionRecord.ExceptionFlags); printf(" ExceptionFlags: %u\n", mes->ExceptionRecord.ExceptionFlags);
printf(" ExceptionRecord: 0x%lx%08lx\n", printf(" ExceptionRecord: 0x%x%08x\n",
(DWORD)(mes->ExceptionRecord.ExceptionRecord >> 32), (DWORD)(mes->ExceptionRecord.ExceptionRecord >> 32),
(DWORD)mes->ExceptionRecord.ExceptionRecord); (DWORD)mes->ExceptionRecord.ExceptionRecord);
printf(" ExceptionAddress: 0x%lx%08lx\n", printf(" ExceptionAddress: 0x%x%08x\n",
(DWORD)(mes->ExceptionRecord.ExceptionAddress >> 32), (DWORD)(mes->ExceptionRecord.ExceptionAddress >> 32),
(DWORD)(mes->ExceptionRecord.ExceptionAddress)); (DWORD)(mes->ExceptionRecord.ExceptionAddress));
printf(" ExceptionNumberParameters: %lu\n", printf(" ExceptionNumberParameters: %u\n",
mes->ExceptionRecord.NumberParameters); mes->ExceptionRecord.NumberParameters);
for (i = 0; i < mes->ExceptionRecord.NumberParameters; i++) for (i = 0; i < mes->ExceptionRecord.NumberParameters; i++)
{ {
printf(" [%d]: 0x%lx%08lx\n", i, printf(" [%d]: 0x%x%08x\n", i,
(DWORD)(mes->ExceptionRecord.ExceptionInformation[i] >> 32), (DWORD)(mes->ExceptionRecord.ExceptionInformation[i] >> 32),
(DWORD)mes->ExceptionRecord.ExceptionInformation[i]); (DWORD)mes->ExceptionRecord.ExceptionInformation[i]);
} }
...@@ -373,9 +373,9 @@ void mdmp_dump(void) ...@@ -373,9 +373,9 @@ void mdmp_dump(void)
break; break;
default: default:
printf("NIY %ld\n", dir->StreamType); printf("NIY %d\n", dir->StreamType);
printf(" RVA: %lu\n", dir->Location.Rva); printf(" RVA: %u\n", dir->Location.Rva);
printf(" Size: %lu\n", dir->Location.DataSize); printf(" Size: %u\n", dir->Location.DataSize);
dump_mdmp_data(&dir->Location, " "); dump_mdmp_data(&dir->Location, " ");
break; break;
} }
......
...@@ -73,7 +73,7 @@ static void dump_ne_header( const IMAGE_OS2_HEADER *ne ) ...@@ -73,7 +73,7 @@ static void dump_ne_header( const IMAGE_OS2_HEADER *ne )
printf( "File header:\n" ); printf( "File header:\n" );
printf( "Linker version: %d.%d\n", ne->ne_ver, ne->ne_rev ); printf( "Linker version: %d.%d\n", ne->ne_ver, ne->ne_rev );
printf( "Entry table: %x len %d\n", ne->ne_enttab, ne->ne_cbenttab ); printf( "Entry table: %x len %d\n", ne->ne_enttab, ne->ne_cbenttab );
printf( "Checksum: %08lx\n", ne->ne_crc ); printf( "Checksum: %08x\n", ne->ne_crc );
printf( "Flags: %04x\n", ne->ne_flags ); printf( "Flags: %04x\n", ne->ne_flags );
printf( "Auto data segment: %x\n", ne->ne_autodata ); printf( "Auto data segment: %x\n", ne->ne_autodata );
printf( "Heap size: %d bytes\n", ne->ne_heap ); printf( "Heap size: %d bytes\n", ne->ne_heap );
...@@ -87,7 +87,7 @@ static void dump_ne_header( const IMAGE_OS2_HEADER *ne ) ...@@ -87,7 +87,7 @@ static void dump_ne_header( const IMAGE_OS2_HEADER *ne )
printf( "Resident name table: %x\n", ne->ne_restab ); printf( "Resident name table: %x\n", ne->ne_restab );
printf( "Module table: %x\n", ne->ne_modtab ); printf( "Module table: %x\n", ne->ne_modtab );
printf( "Import table: %x\n", ne->ne_imptab ); printf( "Import table: %x\n", ne->ne_imptab );
printf( "Non-resident table: %lx\n", ne->ne_nrestab ); printf( "Non-resident table: %x\n", ne->ne_nrestab );
printf( "Exe type: %x\n", ne->ne_exetyp ); printf( "Exe type: %x\n", ne->ne_exetyp );
printf( "Other flags: %x\n", ne->ne_flagsothers ); printf( "Other flags: %x\n", ne->ne_flagsothers );
printf( "Fast load area: %x-%x\n", ne->ne_pretthunks << ne->ne_align, printf( "Fast load area: %x-%x\n", ne->ne_pretthunks << ne->ne_align,
......
...@@ -159,7 +159,7 @@ static inline void print_word(const char *title, WORD value) ...@@ -159,7 +159,7 @@ static inline void print_word(const char *title, WORD value)
static inline void print_dword(const char *title, DWORD value) static inline void print_dword(const char *title, DWORD value)
{ {
printf(" %-34s 0x%-8lx %lu\n", title, value, value); printf(" %-34s 0x%-8x %u\n", title, value, value);
} }
static inline void print_longlong(const char *title, ULONGLONG value) static inline void print_longlong(const char *title, ULONGLONG value)
...@@ -208,11 +208,11 @@ static inline void print_datadirectory(DWORD n, const IMAGE_DATA_DIRECTORY *dire ...@@ -208,11 +208,11 @@ static inline void print_datadirectory(DWORD n, const IMAGE_DATA_DIRECTORY *dire
{ {
unsigned i; unsigned i;
printf("Data Directory\n"); printf("Data Directory\n");
printf("%ld\n", n * sizeof(IMAGE_DATA_DIRECTORY)); printf("%d\n", n * sizeof(IMAGE_DATA_DIRECTORY));
for (i = 0; i < n && i < 16; i++) for (i = 0; i < n && i < 16; i++)
{ {
printf(" %-12s rva: 0x%-8lX size: %8lu\n", printf(" %-12s rva: 0x%-8X size: %8u\n",
DirectoryNames[i], directory[i].VirtualAddress, DirectoryNames[i], directory[i].VirtualAddress,
directory[i].Size); directory[i].Size);
} }
...@@ -299,11 +299,11 @@ static void dump_pe_header(void) ...@@ -299,11 +299,11 @@ static void dump_pe_header(void)
printf(" Machine: %04X (%s)\n", printf(" Machine: %04X (%s)\n",
fileHeader->Machine, get_machine_str(fileHeader->Machine)); fileHeader->Machine, get_machine_str(fileHeader->Machine));
printf(" Number of Sections: %d\n", fileHeader->NumberOfSections); printf(" Number of Sections: %d\n", fileHeader->NumberOfSections);
printf(" TimeDateStamp: %08lX (%s) offset %lu\n", printf(" TimeDateStamp: %08X (%s) offset %lu\n",
fileHeader->TimeDateStamp, get_time_str(fileHeader->TimeDateStamp), fileHeader->TimeDateStamp, get_time_str(fileHeader->TimeDateStamp),
Offset(&(fileHeader->TimeDateStamp))); Offset(&(fileHeader->TimeDateStamp)));
printf(" PointerToSymbolTable: %08lX\n", fileHeader->PointerToSymbolTable); printf(" PointerToSymbolTable: %08X\n", fileHeader->PointerToSymbolTable);
printf(" NumberOfSymbols: %08lX\n", fileHeader->NumberOfSymbols); printf(" NumberOfSymbols: %08X\n", fileHeader->NumberOfSymbols);
printf(" SizeOfOptionalHeader: %04X\n", fileHeader->SizeOfOptionalHeader); printf(" SizeOfOptionalHeader: %04X\n", fileHeader->SizeOfOptionalHeader);
printf(" Characteristics: %04X\n", fileHeader->Characteristics); printf(" Characteristics: %04X\n", fileHeader->Characteristics);
#define X(f,s) if (fileHeader->Characteristics & f) printf(" %s\n", s) #define X(f,s) if (fileHeader->Characteristics & f) printf(" %s\n", s)
...@@ -350,16 +350,16 @@ static void dump_sections(const void* addr, unsigned num_sect) ...@@ -350,16 +350,16 @@ static void dump_sections(const void* addr, unsigned num_sect)
printf("Section Table\n"); printf("Section Table\n");
for (i = 0; i < num_sect; i++, sectHead++) for (i = 0; i < num_sect; i++, sectHead++)
{ {
printf(" %02d %-8.8s VirtSize: %-8lu VirtAddr: %-8lu 0x%08lx\n", printf(" %02d %-8.8s VirtSize: %-8u VirtAddr: %-8u 0x%08x\n",
i + 1, sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress, i + 1, sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress,
sectHead->VirtualAddress); sectHead->VirtualAddress);
printf(" raw data offs: %-8lu raw data size: %-8lu\n", printf(" raw data offs: %-8u raw data size: %-8u\n",
sectHead->PointerToRawData, sectHead->SizeOfRawData); sectHead->PointerToRawData, sectHead->SizeOfRawData);
printf(" relocation offs: %-8lu relocations: %-8u\n", printf(" relocation offs: %-8u relocations: %-8u\n",
sectHead->PointerToRelocations, sectHead->NumberOfRelocations); sectHead->PointerToRelocations, sectHead->NumberOfRelocations);
printf(" line # offs: %-8lu line #'s: %-8u\n", printf(" line # offs: %-8u line #'s: %-8u\n",
sectHead->PointerToLinenumbers, sectHead->NumberOfLinenumbers); sectHead->PointerToLinenumbers, sectHead->NumberOfLinenumbers);
printf(" characteristics: 0x%08lx\n", sectHead->Characteristics); printf(" characteristics: 0x%08x\n", sectHead->Characteristics);
printf(" "); printf(" ");
#define X(b,s) if (sectHead->Characteristics & b) printf(s " ") #define X(b,s) if (sectHead->Characteristics & b) printf(s " ")
/* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */ /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */
...@@ -429,16 +429,16 @@ static void dump_dir_exported_functions(void) ...@@ -429,16 +429,16 @@ static void dump_dir_exported_functions(void)
printf("Exports table:\n"); printf("Exports table:\n");
printf("\n"); printf("\n");
printf(" Name: %s\n", (const char*)RVA(exportDir->Name, sizeof(DWORD))); printf(" Name: %s\n", (const char*)RVA(exportDir->Name, sizeof(DWORD)));
printf(" Characteristics: %08lx\n", exportDir->Characteristics); printf(" Characteristics: %08x\n", exportDir->Characteristics);
printf(" TimeDateStamp: %08lX %s\n", printf(" TimeDateStamp: %08X %s\n",
exportDir->TimeDateStamp, get_time_str(exportDir->TimeDateStamp)); exportDir->TimeDateStamp, get_time_str(exportDir->TimeDateStamp));
printf(" Version: %u.%02u\n", exportDir->MajorVersion, exportDir->MinorVersion); printf(" Version: %u.%02u\n", exportDir->MajorVersion, exportDir->MinorVersion);
printf(" Ordinal base: %lu\n", exportDir->Base); printf(" Ordinal base: %u\n", exportDir->Base);
printf(" # of functions: %lu\n", exportDir->NumberOfFunctions); printf(" # of functions: %u\n", exportDir->NumberOfFunctions);
printf(" # of Names: %lu\n", exportDir->NumberOfNames); printf(" # of Names: %u\n", exportDir->NumberOfNames);
printf("Addresses of functions: %08lX\n", exportDir->AddressOfFunctions); printf("Addresses of functions: %08X\n", exportDir->AddressOfFunctions);
printf("Addresses of name ordinals: %08lX\n", exportDir->AddressOfNameOrdinals); printf("Addresses of name ordinals: %08X\n", exportDir->AddressOfNameOrdinals);
printf("Addresses of names: %08lX\n", exportDir->AddressOfNames); printf("Addresses of names: %08X\n", exportDir->AddressOfNames);
printf("\n"); printf("\n");
printf(" Entry Pt Ordn Name\n"); printf(" Entry Pt Ordn Name\n");
...@@ -462,7 +462,7 @@ static void dump_dir_exported_functions(void) ...@@ -462,7 +462,7 @@ static void dump_dir_exported_functions(void)
name = (const char*)RVA(*pName, sizeof(DWORD)); name = (const char*)RVA(*pName, sizeof(DWORD));
if (name && globals.do_demangle) if (name && globals.do_demangle)
{ {
printf(" %08lX %4lu ", pFunc[*pOrdl], exportDir->Base + *pOrdl); printf(" %08X %4u ", pFunc[*pOrdl], exportDir->Base + *pOrdl);
symbol_init(&symbol, name); symbol_init(&symbol, name);
if (symbol_demangle(&symbol) == -1) if (symbol_demangle(&symbol) == -1)
...@@ -475,7 +475,7 @@ static void dump_dir_exported_functions(void) ...@@ -475,7 +475,7 @@ static void dump_dir_exported_functions(void)
} }
else else
{ {
printf(" %08lX %4lu %s", pFunc[*pOrdl], exportDir->Base + *pOrdl, name); printf(" %08X %4u %s", pFunc[*pOrdl], exportDir->Base + *pOrdl, name);
} }
/* check for forwarded function */ /* check for forwarded function */
if ((const char *)RVA(pFunc[*pOrdl],sizeof(void*)) >= (const char *)exportDir && if ((const char *)RVA(pFunc[*pOrdl],sizeof(void*)) >= (const char *)exportDir &&
...@@ -489,7 +489,7 @@ static void dump_dir_exported_functions(void) ...@@ -489,7 +489,7 @@ static void dump_dir_exported_functions(void)
{ {
if (pFunc[i] && !(map[i / 32] & (1 << (i % 32)))) if (pFunc[i] && !(map[i / 32] & (1 << (i % 32))))
{ {
printf(" %08lX %4lu <by ordinal>\n", pFunc[i], exportDir->Base + i); printf(" %08X %4u <by ordinal>\n", pFunc[i], exportDir->Base + i);
} }
} }
free(map); free(map);
...@@ -503,14 +503,14 @@ static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il) ...@@ -503,14 +503,14 @@ static void dump_image_thunk_data64(const IMAGE_THUNK_DATA64 *il)
for (; il->u1.Ordinal; il++) for (; il->u1.Ordinal; il++)
{ {
if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal)) if (IMAGE_SNAP_BY_ORDINAL64(il->u1.Ordinal))
printf(" %4lu <by ordinal>\n", (DWORD)IMAGE_ORDINAL64(il->u1.Ordinal)); printf(" %4u <by ordinal>\n", (DWORD)IMAGE_ORDINAL64(il->u1.Ordinal));
else else
{ {
iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD)); iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD));
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 %lx\n", iibn->Hint, iibn->Name, (DWORD)il->u1.AddressOfData); printf(" %4u %s %x\n", iibn->Hint, iibn->Name, (DWORD)il->u1.AddressOfData);
} }
} }
} }
...@@ -521,14 +521,14 @@ static void dump_image_thunk_data32(const IMAGE_THUNK_DATA32 *il) ...@@ -521,14 +521,14 @@ static void dump_image_thunk_data32(const IMAGE_THUNK_DATA32 *il)
for (; il->u1.Ordinal; il++) for (; il->u1.Ordinal; il++)
{ {
if (IMAGE_SNAP_BY_ORDINAL32(il->u1.Ordinal)) if (IMAGE_SNAP_BY_ORDINAL32(il->u1.Ordinal))
printf(" %4lu <by ordinal>\n", IMAGE_ORDINAL32(il->u1.Ordinal)); printf(" %4u <by ordinal>\n", IMAGE_ORDINAL32(il->u1.Ordinal));
else else
{ {
iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD)); iibn = RVA((DWORD)il->u1.AddressOfData, sizeof(DWORD));
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 %lx\n", iibn->Hint, iibn->Name, (DWORD)il->u1.AddressOfData); printf(" %4u %s %x\n", iibn->Hint, iibn->Name, (DWORD)il->u1.AddressOfData);
} }
} }
} }
...@@ -550,7 +550,7 @@ static void dump_dir_imported_functions(void) ...@@ -550,7 +550,7 @@ static void dump_dir_imported_functions(void)
directorySize = opt->DataDirectory[IMAGE_FILE_IMPORT_DIRECTORY].Size; directorySize = opt->DataDirectory[IMAGE_FILE_IMPORT_DIRECTORY].Size;
} }
printf("Import Table size: %08lx\n", directorySize);/* FIXME */ printf("Import Table size: %08x\n", directorySize);/* FIXME */
for (;;) for (;;)
{ {
...@@ -559,11 +559,11 @@ static void dump_dir_imported_functions(void) ...@@ -559,11 +559,11 @@ static void dump_dir_imported_functions(void)
if (!importDesc->Name || !importDesc->FirstThunk) break; if (!importDesc->Name || !importDesc->FirstThunk) break;
printf(" offset %08lx %s\n", Offset(importDesc), (const char*)RVA(importDesc->Name, sizeof(DWORD))); printf(" offset %08lx %s\n", Offset(importDesc), (const char*)RVA(importDesc->Name, sizeof(DWORD)));
printf(" Hint/Name Table: %08lX\n", (DWORD)importDesc->u.OriginalFirstThunk); printf(" Hint/Name Table: %08X\n", (DWORD)importDesc->u.OriginalFirstThunk);
printf(" TimeDataStamp: %08lX (%s)\n", printf(" TimeDataStamp: %08X (%s)\n",
importDesc->TimeDateStamp, get_time_str(importDesc->TimeDateStamp)); importDesc->TimeDateStamp, get_time_str(importDesc->TimeDateStamp));
printf(" ForwarderChain: %08lX\n", importDesc->ForwarderChain); printf(" ForwarderChain: %08X\n", importDesc->ForwarderChain);
printf(" First thunk RVA: %08lX\n", (DWORD)importDesc->FirstThunk); printf(" First thunk RVA: %08X\n", (DWORD)importDesc->FirstThunk);
printf(" Ordn Name\n"); printf(" Ordn Name\n");
...@@ -613,7 +613,7 @@ static void dump_dir_delay_imported_functions(void) ...@@ -613,7 +613,7 @@ static void dump_dir_delay_imported_functions(void)
directorySize = opt->DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size; directorySize = opt->DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size;
} }
printf("Delay Import Table size: %08lx\n", directorySize); /* FIXME */ printf("Delay Import Table size: %08x\n", directorySize); /* FIXME */
for (;;) for (;;)
{ {
...@@ -622,10 +622,10 @@ static void dump_dir_delay_imported_functions(void) ...@@ -622,10 +622,10 @@ static void dump_dir_delay_imported_functions(void)
if (!importDesc->szName || !importDesc->pIAT || !importDesc->pINT) break; if (!importDesc->szName || !importDesc->pIAT || !importDesc->pINT) break;
printf(" grAttrs %08lx offset %08lx %s\n", importDesc->grAttrs, Offset(importDesc), printf(" grAttrs %08x offset %08lx %s\n", importDesc->grAttrs, Offset(importDesc),
use_rva ? (const char *)RVA(importDesc->szName, sizeof(DWORD)) : (char *)importDesc->szName); use_rva ? (const char *)RVA(importDesc->szName, sizeof(DWORD)) : (char *)importDesc->szName);
printf(" Hint/Name Table: %08lx\n", importDesc->pINT); printf(" Hint/Name Table: %08x\n", importDesc->pINT);
printf(" TimeDataStamp: %08lX (%s)\n", printf(" TimeDataStamp: %08X (%s)\n",
importDesc->dwTimeStamp, get_time_str(importDesc->dwTimeStamp)); importDesc->dwTimeStamp, get_time_str(importDesc->dwTimeStamp));
printf(" Ordn Name\n"); printf(" Ordn Name\n");
...@@ -652,8 +652,8 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx) ...@@ -652,8 +652,8 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx)
const char* str; const char* str;
printf("Directory %02u\n", idx + 1); printf("Directory %02u\n", idx + 1);
printf(" Characteristics: %08lX\n", idd->Characteristics); printf(" Characteristics: %08X\n", idd->Characteristics);
printf(" TimeDateStamp: %08lX %s\n", printf(" TimeDateStamp: %08X %s\n",
idd->TimeDateStamp, get_time_str(idd->TimeDateStamp)); idd->TimeDateStamp, get_time_str(idd->TimeDateStamp));
printf(" Version %u.%02u\n", idd->MajorVersion, idd->MinorVersion); printf(" Version %u.%02u\n", idd->MajorVersion, idd->MinorVersion);
switch (idd->Type) switch (idd->Type)
...@@ -671,10 +671,10 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx) ...@@ -671,10 +671,10 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx)
case IMAGE_DEBUG_TYPE_BORLAND: str = "BORLAND"; break; case IMAGE_DEBUG_TYPE_BORLAND: str = "BORLAND"; break;
case IMAGE_DEBUG_TYPE_RESERVED10: str = "RESERVED10"; break; case IMAGE_DEBUG_TYPE_RESERVED10: str = "RESERVED10"; break;
} }
printf(" Type: %lu (%s)\n", idd->Type, str); printf(" Type: %u (%s)\n", idd->Type, str);
printf(" SizeOfData: %lu\n", idd->SizeOfData); printf(" SizeOfData: %u\n", idd->SizeOfData);
printf(" AddressOfRawData: %08lX\n", idd->AddressOfRawData); printf(" AddressOfRawData: %08X\n", idd->AddressOfRawData);
printf(" PointerToRawData: %08lX\n", idd->PointerToRawData); printf(" PointerToRawData: %08X\n", idd->PointerToRawData);
switch (idd->Type) switch (idd->Type)
{ {
...@@ -694,10 +694,10 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx) ...@@ -694,10 +694,10 @@ static void dump_dir_debug_dir(const IMAGE_DEBUG_DIRECTORY* idd, int idx)
{ {
const IMAGE_DEBUG_MISC* misc = PRD(idd->PointerToRawData, idd->SizeOfData); const IMAGE_DEBUG_MISC* misc = PRD(idd->PointerToRawData, idd->SizeOfData);
if (!misc) {printf("Can't get misc debug information\n"); break;} if (!misc) {printf("Can't get misc debug information\n"); break;}
printf(" DataType: %lu (%s)\n", printf(" DataType: %u (%s)\n",
misc->DataType, misc->DataType,
(misc->DataType == IMAGE_DEBUG_MISC_EXENAME) ? "Exe name" : "Unknown"); (misc->DataType == IMAGE_DEBUG_MISC_EXENAME) ? "Exe name" : "Unknown");
printf(" Length: %lu\n", misc->Length); printf(" Length: %u\n", misc->Length);
printf(" Unicode: %s\n", misc->Unicode ? "Yes" : "No"); printf(" Unicode: %s\n", misc->Unicode ? "Yes" : "No");
printf(" Data: %s\n", misc->Data); printf(" Data: %s\n", misc->Data);
} }
...@@ -760,19 +760,19 @@ static void dump_dir_tls(void) ...@@ -760,19 +760,19 @@ static void dump_dir_tls(void)
/* FIXME: This does not properly handle large images */ /* FIXME: This does not properly handle large images */
printf( "Thread Local Storage\n" ); printf( "Thread Local Storage\n" );
printf( " Raw data %08lx-%08lx (data size %lx zero fill size %lx)\n", printf( " Raw data %08x-%08x (data size %x zero fill size %x)\n",
(DWORD)dir.StartAddressOfRawData, (DWORD)dir.EndAddressOfRawData, (DWORD)dir.StartAddressOfRawData, (DWORD)dir.EndAddressOfRawData,
(DWORD)(dir.EndAddressOfRawData - dir.StartAddressOfRawData), (DWORD)(dir.EndAddressOfRawData - dir.StartAddressOfRawData),
(DWORD)dir.SizeOfZeroFill ); (DWORD)dir.SizeOfZeroFill );
printf( " Index address %08lx\n", (DWORD)dir.AddressOfIndex ); printf( " Index address %08x\n", (DWORD)dir.AddressOfIndex );
printf( " Characteristics %08lx\n", dir.Characteristics ); printf( " Characteristics %08x\n", dir.Characteristics );
printf( " Callbacks %08lx -> {", (DWORD)dir.AddressOfCallBacks ); printf( " Callbacks %08x -> {", (DWORD)dir.AddressOfCallBacks );
if (dir.AddressOfCallBacks) if (dir.AddressOfCallBacks)
{ {
DWORD addr = (DWORD)dir.AddressOfCallBacks - PE_nt_headers->OptionalHeader.ImageBase; DWORD addr = (DWORD)dir.AddressOfCallBacks - PE_nt_headers->OptionalHeader.ImageBase;
while ((callbacks = RVA(addr, sizeof(DWORD))) && *callbacks) while ((callbacks = RVA(addr, sizeof(DWORD))) && *callbacks)
{ {
printf( " %08lx", *callbacks ); printf( " %08x", *callbacks );
addr += sizeof(DWORD); addr += sizeof(DWORD);
} }
} }
...@@ -795,14 +795,14 @@ void dump_separate_dbg(void) ...@@ -795,14 +795,14 @@ void dump_separate_dbg(void)
printf ("Machine: 0x%04X (%s)\n", printf ("Machine: 0x%04X (%s)\n",
separateDebugHead->Machine, get_machine_str(separateDebugHead->Machine)); separateDebugHead->Machine, get_machine_str(separateDebugHead->Machine));
printf ("Characteristics: 0x%04X\n", separateDebugHead->Characteristics); printf ("Characteristics: 0x%04X\n", separateDebugHead->Characteristics);
printf ("TimeDateStamp: 0x%08lX (%s)\n", printf ("TimeDateStamp: 0x%08X (%s)\n",
separateDebugHead->TimeDateStamp, get_time_str(separateDebugHead->TimeDateStamp)); separateDebugHead->TimeDateStamp, get_time_str(separateDebugHead->TimeDateStamp));
printf ("CheckSum: 0x%08lX\n", separateDebugHead->CheckSum); printf ("CheckSum: 0x%08X\n", separateDebugHead->CheckSum);
printf ("ImageBase: 0x%08lX\n", separateDebugHead->ImageBase); printf ("ImageBase: 0x%08X\n", separateDebugHead->ImageBase);
printf ("SizeOfImage: 0x%08lX\n", separateDebugHead->SizeOfImage); printf ("SizeOfImage: 0x%08X\n", separateDebugHead->SizeOfImage);
printf ("NumberOfSections: 0x%08lX\n", separateDebugHead->NumberOfSections); printf ("NumberOfSections: 0x%08X\n", separateDebugHead->NumberOfSections);
printf ("ExportedNamesSize: 0x%08lX\n", separateDebugHead->ExportedNamesSize); printf ("ExportedNamesSize: 0x%08X\n", separateDebugHead->ExportedNamesSize);
printf ("DebugDirectorySize: 0x%08lX\n", separateDebugHead->DebugDirectorySize); printf ("DebugDirectorySize: 0x%08X\n", separateDebugHead->DebugDirectorySize);
if (!PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER), if (!PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER),
separateDebugHead->NumberOfSections * sizeof(IMAGE_SECTION_HEADER))) separateDebugHead->NumberOfSections * sizeof(IMAGE_SECTION_HEADER)))
...@@ -1234,7 +1234,7 @@ static void do_grab_sym( enum FileSig sig, const void* pmt ) ...@@ -1234,7 +1234,7 @@ static void do_grab_sym( enum FileSig sig, const void* pmt )
{ {
char ordinal_text[256]; char ordinal_text[256];
/* Ordinal only entry */ /* Ordinal only entry */
snprintf (ordinal_text, sizeof(ordinal_text), "%s_%lu", snprintf (ordinal_text, sizeof(ordinal_text), "%s_%u",
globals.forward_dll ? globals.forward_dll : OUTPUT_UC_DLL_NAME, globals.forward_dll ? globals.forward_dll : OUTPUT_UC_DLL_NAME,
exportDir->Base + i); exportDir->Base + i);
str_toupper(ordinal_text); str_toupper(ordinal_text);
...@@ -1248,7 +1248,7 @@ static void do_grab_sym( enum FileSig sig, const void* pmt ) ...@@ -1248,7 +1248,7 @@ static void do_grab_sym( enum FileSig sig, const void* pmt )
free(map); free(map);
if (NORMAL) if (NORMAL)
printf("%lu named symbols in DLL, %lu total, %d unique (ordinal base = %ld)\n", printf("%u named symbols in DLL, %u total, %d unique (ordinal base = %d)\n",
exportDir->NumberOfNames, exportDir->NumberOfFunctions, j, exportDir->Base); exportDir->NumberOfNames, exportDir->NumberOfFunctions, j, exportDir->Base);
qsort( dll_symbols, j, sizeof(dll_symbol), symbol_cmp ); qsort( dll_symbols, j, sizeof(dll_symbol), symbol_cmp );
......
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