winedump: Manage the string table size in PE file format.
This commit is contained in:
parent
e8158e48cb
commit
7a685030f6
|
@ -373,8 +373,12 @@ static void dump_pe_header(void)
|
||||||
|
|
||||||
void dump_section(const IMAGE_SECTION_HEADER *sectHead, const char* strtable)
|
void dump_section(const IMAGE_SECTION_HEADER *sectHead, const char* strtable)
|
||||||
{
|
{
|
||||||
if (strtable && sectHead->Name[0] == '/') /* long section name */
|
unsigned offset;
|
||||||
printf(" %.8s (%s)", sectHead->Name, strtable + atoi((const char*)sectHead->Name + 1));
|
|
||||||
|
/* 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
|
else
|
||||||
printf(" %-8.8s", sectHead->Name);
|
printf(" %-8.8s", sectHead->Name);
|
||||||
printf(" VirtSize: 0x%08x VirtAddr: 0x%08x\n",
|
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)
|
if (PE_nt_headers->FileHeader.PointerToSymbolTable && PE_nt_headers->FileHeader.NumberOfSymbols)
|
||||||
{
|
{
|
||||||
/* FIXME: no way to get strtable size */
|
|
||||||
strtable = (const char*)base +
|
strtable = (const char*)base +
|
||||||
PE_nt_headers->FileHeader.PointerToSymbolTable +
|
PE_nt_headers->FileHeader.PointerToSymbolTable +
|
||||||
PE_nt_headers->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL);
|
PE_nt_headers->FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL);
|
||||||
|
|
Loading…
Reference in New Issue