diff --git a/tools/winedump/lnk.c b/tools/winedump/lnk.c index f8909ffc4c8..f709cdea4a3 100644 --- a/tools/winedump/lnk.c +++ b/tools/winedump/lnk.c @@ -191,7 +191,8 @@ static lnk_string* load_string(int fd, int unicode) static int dump_pidl(int fd) { - void *pidl; + lnk_string *pidl; + int i, n = 0, sz = 0; pidl = load_pidl(fd); if (!pidl) @@ -200,6 +201,26 @@ static int dump_pidl(int fd) printf("PIDL\n"); printf("----\n\n"); + while(szsize) + { + lnk_string *segment = (lnk_string*) &pidl->str.a[sz]; + + if(!segment->size) + break; + sz+=segment->size; + if(sz>pidl->size) + { + printf("bad pidl\n"); + break; + } + n++; + printf("segment %d (%2d bytes) : ",n,segment->size); + for(i=0; isize; i++) + printf("%02x ",segment->str.a[i]); + printf("\n"); + } + printf("\n"); + free(pidl); return 0; @@ -257,7 +278,7 @@ static int dump_location(int fd) printf("size %ld type %ld serial %08lx label %ld ", vol->dwSize, vol->dwType, vol->dwVolSerial, vol->dwVolLabelOfs); if(vol->dwVolLabelOfs) - printf("(\"%s\")", &p[vol->dwVolLabelOfs]); + printf("(\"%s\")", &p[loc->dwVolTableOfs + vol->dwVolLabelOfs]); } printf("\n");