Eric Pouech : winedump: Manage the string table size in PE file format.

Alexandre Julliard julliard at winehq.org
Tue Dec 29 09:06:45 CST 2009


Module: wine
Branch: master
Commit: 7a685030f61a1c78120bedd2e26a05b057694a11
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7a685030f61a1c78120bedd2e26a05b057694a11

Author: Eric Pouech <eric.pouech at orange.fr>
Date:   Tue Dec 29 13:02:33 2009 +0100

winedump: Manage the string table size in PE file format.

---

 tools/winedump/pe.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c
index 1f9c5a7..a2c2f0a 100644
--- a/tools/winedump/pe.c
+++ b/tools/winedump/pe.c
@@ -373,8 +373,12 @@ static	void	dump_pe_header(void)
 
 void dump_section(const IMAGE_SECTION_HEADER *sectHead, const char* strtable)
 {
-        if (strtable && sectHead->Name[0] == '/') /* long section name */
-            printf("  %.8s (%s)", sectHead->Name, strtable + atoi((const char*)sectHead->Name + 1));
+        unsigned offset;
+
+        /* long section name ? */
+        if (strtable && sectHead->Name[0] == '/' &&
+            ((offset = atoi((const char*)sectHead->Name + 1)) < *(DWORD*)strtable))
+            printf("  %.8s (%s)", sectHead->Name, strtable + offset);
         else
 	    printf("  %-8.8s", sectHead->Name);
 	printf("   VirtSize: 0x%08x  VirtAddr:  0x%08x\n",
@@ -456,7 +460,6 @@ static void dump_sections(const void *base, const void* addr, unsigned num_sect)
 
     if (PE_nt_headers->FileHeader.PointerToSymbolTable && PE_nt_headers->FileHeader.NumberOfSymbols)
     {
-        /* FIXME: no way to get strtable size */
         strtable = (const char*)base +
             PE_nt_headers->FileHeader.PointerToSymbolTable +
             PE_nt_headers->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL);




More information about the wine-cvs mailing list