diff --git a/tools/winedump/dump.c b/tools/winedump/dump.c index abfc2ab8c74..90602d43367 100644 --- a/tools/winedump/dump.c +++ b/tools/winedump/dump.c @@ -33,11 +33,11 @@ void *dump_base = NULL; size_t dump_total_len = 0; -void dump_data( const unsigned char *ptr, unsigned int size, const char *prefix ) +void dump_data_offset( const unsigned char *ptr, unsigned int size, unsigned int offset, const char *prefix ) { unsigned int i, j; - printf( "%s%08x: ", prefix, 0 ); + printf( "%s%08x: ", prefix, offset ); if (!ptr) { printf("NULL\n"); @@ -51,7 +51,7 @@ void dump_data( const unsigned char *ptr, unsigned int size, const char *prefix printf( " " ); for (j = 0; j < 16; j++) printf( "%c", isprint(ptr[i-15+j]) ? ptr[i-15+j] : '.' ); - if (i < size-1) printf( "\n%s%08x: ", prefix, i + 1 ); + if (i < size-1) printf( "\n%s%08x: ", prefix, offset + i + 1 ); } } if (i % 16) @@ -63,6 +63,11 @@ void dump_data( const unsigned char *ptr, unsigned int size, const char *prefix printf( "\n" ); } +void dump_data( const unsigned char *ptr, unsigned int size, const char *prefix ) +{ + dump_data_offset( ptr, size, 0, prefix ); +} + static char* dump_want_n(unsigned sz) { static char buffer[64 * 1024]; diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 3defdcd664b..a49c4e83d52 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -539,7 +539,8 @@ static void dump_sections(const void *base, const void* addr, unsigned num_sect) if (globals.do_dump_rawdata) { - dump_data((const unsigned char *)base + sectHead->PointerToRawData, sectHead->SizeOfRawData, " " ); + dump_data_offset((const unsigned char *)base + sectHead->PointerToRawData, + sectHead->SizeOfRawData, sectHead->VirtualAddress, " " ); printf("\n"); } } diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index 91b7170b774..3df2410a6c3 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -224,6 +224,7 @@ unsigned long Offset(const void* ptr); typedef void (*file_dumper)(void); BOOL dump_analysis(const char*, file_dumper, enum FileSig); +void dump_data_offset( const unsigned char *ptr, unsigned int size, unsigned int offset, const char *prefix ); void dump_data( const unsigned char *ptr, unsigned int size, const char *prefix ); const char* get_time_str( unsigned long ); unsigned int strlenW( const unsigned short *str );