winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2006
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
720 discussions
Start a n
N
ew thread
Dmitry Timoshkov : winedump: Dump section data of COFF library files, decode some import data.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 690c852540e5f68675cfb5f6a1798e20c352e6e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=690c852540e5f68675cfb5f6a…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:43:48 2006 +0800 winedump: Dump section data of COFF library files, decode some import data. --- tools/winedump/lib.c | 120 ++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 98 insertions(+), 22 deletions(-) diff --git a/tools/winedump/lib.c b/tools/winedump/lib.c index 858c37b..a7f8367 100644 --- a/tools/winedump/lib.c +++ b/tools/winedump/lib.c @@ -18,10 +18,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -/* FIXME: Add support for import library with the long format described in - * Microsoft Portable Executable and Common Object File Format Specification. - */ - #include "config.h" #include "wine/port.h" @@ -80,6 +76,70 @@ static void dump_import_object(const IMP } } +static void dump_long_import(const void *base, const IMAGE_SECTION_HEADER *ish, unsigned num_sect) +{ + unsigned i; + const DWORD *imp_data5 = NULL; + const WORD *imp_data6 = NULL; + + if (globals.do_dumpheader) + printf("Section Table\n"); + + for (i = 0; i < num_sect; i++) + { + if (globals.do_dumpheader) + dump_section(&ish[i]); + + if (globals.do_dump_rawdata) + { + dump_data((const unsigned char *)base + ish[i].PointerToRawData, ish[i].SizeOfRawData, " " ); + printf("\n"); + } + + if (!strcmp((const char *)ish[i].Name, ".idata$5")) + { + imp_data5 = (const DWORD *)((const char *)base + ish[i].PointerToRawData); + } + else if (!strcmp((const char *)ish[i].Name, ".idata$6")) + { + imp_data6 = (const WORD *)((const char *)base + ish[i].PointerToRawData); + } + else if (globals.do_debug && !strcmp((const char *)ish[i].Name, ".debug$S")) + { + const char *imp_debug$ = (const char *)base + ish[i].PointerToRawData; + + codeview_dump_symbols(imp_debug$, ish[i].SizeOfRawData); + printf("\n"); + } + } + + if (imp_data5) + { + WORD ordinal = 0; + const char *name = NULL; + + if (imp_data5[0] & 0x80000000) + ordinal = (WORD)(imp_data5[0] & ~0x80000000); + + if (imp_data6) + { + if (!ordinal) ordinal = imp_data6[0]; + name = (const char *)(imp_data6 + 1); + } + else + { + /* FIXME: find out a name in the section's data */ + } + + if (ordinal) + { + printf(" Symbol name : %s\n", name ? name : "(ordinal import) /* FIXME */"); + printf(" %-13s: %u\n", (imp_data5[0] & 0x80000000) ? "Ordinal" : "Hint", ordinal); + printf("\n"); + } + } +} + enum FileSig get_kind_lib(void) { const char* arch = PRD(0, IMAGE_ARCHIVE_START_SIZE); @@ -101,27 +161,28 @@ void lib_dump(void) long size; if (!(iamh = PRD(cur_file_pos, sizeof(*iamh)))) break; - cur_file_pos += sizeof(IMAGE_ARCHIVE_MEMBER_HEADER); - -#if 0 /* left here for debugging purposes, also should be helpful for - * adding support for new library formats. - */ - printf("cur_file_pos %08lx\n", Offset(iamh)); - printf("Name %.16s", iamh->Name); - if (!strncmp(iamh->Name, IMAGE_ARCHIVE_LINKER_MEMBER, sizeof(iamh->Name))) + if (globals.do_dumpheader) { - printf(" - %s archive linker member\n", - cur_file_pos == IMAGE_ARCHIVE_START_SIZE ? "1st" : "2nd"); + printf("Archive member name at %08lx\n", Offset(iamh)); + + printf("Name %.16s", iamh->Name); + if (!strncmp((const char *)iamh->Name, IMAGE_ARCHIVE_LINKER_MEMBER, sizeof(iamh->Name))) + { + printf(" - %s archive linker member\n", + cur_file_pos == IMAGE_ARCHIVE_START_SIZE ? "1st" : "2nd"); + } + else + printf("\n"); + printf("Date %.12s %s\n", iamh->Date, get_time_str(strtoul((const char *)iamh->Date, NULL, 10))); + printf("UserID %.6s\n", iamh->UserID); + printf("GroupID %.6s\n", iamh->GroupID); + printf("Mode %.8s\n", iamh->Mode); + printf("Size %.10s\n\n", iamh->Size); } - else - printf("\n"); - printf("Date %.12s\n", iamh->Date); - printf("UserID %.6s\n", iamh->UserID); - printf("GroupID %.6s\n", iamh->GroupID); - printf("Mode %.8s\n", iamh->Mode); - printf("Size %.10s\n", iamh->Size); -#endif + + cur_file_pos += sizeof(IMAGE_ARCHIVE_MEMBER_HEADER); + /* FIXME: only import library contents with the short format are * recognized. */ @@ -130,6 +191,21 @@ void lib_dump(void) { dump_import_object(ioh); } + else if (strncmp((const char *)iamh->Name, IMAGE_ARCHIVE_LINKER_MEMBER, sizeof(iamh->Name))) + { + const IMAGE_FILE_HEADER *fh = (const IMAGE_FILE_HEADER *)ioh; + + if (globals.do_dumpheader) + { + dump_file_header(fh); + if (fh->SizeOfOptionalHeader) + { + const IMAGE_OPTIONAL_HEADER32 *oh = (const IMAGE_OPTIONAL_HEADER32 *)((const char *)fh + sizeof(*fh)); + dump_optional_header(oh, fh->SizeOfOptionalHeader); + } + } + dump_long_import(fh, (const IMAGE_SECTION_HEADER *)((const char *)fh + sizeof(*fh) + fh->SizeOfOptionalHeader), fh->NumberOfSections); + } size = strtoul((const char *)iamh->Size, NULL, 10); size = (size + 1) & ~1; /* align to an even address */
1
0
0
0
Dmitry Timoshkov : winedump: Add a possibility to dump raw section data.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: e0518a9d884d649d6ff51d50c2a9509e05406815 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e0518a9d884d649d6ff51d50c…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:43:37 2006 +0800 winedump: Add a possibility to dump raw section data. --- tools/winedump/main.c | 1 + tools/winedump/pe.c | 8 +++++++- tools/winedump/winedump.h | 1 + 3 files changed, 9 insertions(+), 1 deletions(-) diff --git a/tools/winedump/main.c b/tools/winedump/main.c index f0ea281..ad24379 100644 --- a/tools/winedump/main.c +++ b/tools/winedump/main.c @@ -186,6 +186,7 @@ static void do_rawdebug (void) static void do_dumpall(void) { globals.do_dumpheader = 1; + globals.do_dump_rawdata = 1; globals.dumpsect = "ALL"; } diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 54bc6fb..e9ec8f8 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -375,7 +375,7 @@ void dump_section(const IMAGE_SECTION_HE printf(" %-8.8s VirtSize: %-8u VirtAddr: %-8u 0x%08x\n", sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress, sectHead->VirtualAddress); - printf(" raw data offs: %-8u raw data size: %-8u\n", + printf(" raw data offs: %-8u raw data size: %-8u\n", sectHead->PointerToRawData, sectHead->SizeOfRawData); printf(" relocation offs: %-8u relocations: %-8u\n", sectHead->PointerToRelocations, sectHead->NumberOfRelocations); @@ -453,6 +453,12 @@ static void dump_sections(const void *ba for (i = 0; i < num_sect; i++, sectHead++) { dump_section(sectHead); + + if (globals.do_dump_rawdata) + { + dump_data((const unsigned char *)base + sectHead->PointerToRawData, sectHead->SizeOfRawData, " " ); + printf("\n"); + } } } diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index 5b1c68e..1da28d7 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -128,6 +128,7 @@ typedef struct __globals /* Options: dump mode */ int do_demangle; /* -d */ int do_dumpheader; /* -f */ + int do_dump_rawdata; /* -x */ int do_debug; /* -G == 1, -g == 2 */ /* Option arguments: spec mode */
1
0
0
0
Dmitry Timoshkov : winedump: Export dump_section() for use outside of pe.c.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 1542722121130f9651109a84bea62ef27f36082b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1542722121130f9651109a84b…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:43:25 2006 +0800 winedump: Export dump_section() for use outside of pe.c. --- tools/winedump/pe.c | 28 ++++++++++++++++------------ tools/winedump/winedump.h | 1 + 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index b3360f4..54bc6fb 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -370,16 +370,10 @@ static void dump_pe_header(void) dump_optional_header((const IMAGE_OPTIONAL_HEADER32*)&PE_nt_headers->OptionalHeader, PE_nt_headers->FileHeader.SizeOfOptionalHeader); } -static void dump_sections(const void* addr, unsigned num_sect) +void dump_section(const IMAGE_SECTION_HEADER *sectHead) { - const IMAGE_SECTION_HEADER* sectHead = addr; - unsigned i; - - printf("Section Table\n"); - for (i = 0; i < num_sect; i++, sectHead++) - { - printf(" %02d %-8.8s VirtSize: %-8u VirtAddr: %-8u 0x%08x\n", - i + 1, sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress, + printf(" %-8.8s VirtSize: %-8u VirtAddr: %-8u 0x%08x\n", + sectHead->Name, sectHead->Misc.VirtualSize, sectHead->VirtualAddress, sectHead->VirtualAddress); printf(" raw data offs: %-8u raw data size: %-8u\n", sectHead->PointerToRawData, sectHead->SizeOfRawData); @@ -448,8 +442,18 @@ static void dump_sections(const void* ad X(IMAGE_SCN_MEM_WRITE, "MEM_WRITE"); #undef X printf("\n\n"); +} + +static void dump_sections(const void *base, const void* addr, unsigned num_sect) +{ + const IMAGE_SECTION_HEADER* sectHead = addr; + unsigned i; + + printf("Section Table\n"); + for (i = 0; i < num_sect; i++, sectHead++) + { + dump_section(sectHead); } - printf("\n"); } static void dump_dir_exported_functions(void) @@ -858,7 +862,7 @@ void dbg_dump(void) separateDebugHead->NumberOfSections * sizeof(IMAGE_SECTION_HEADER))) {printf("Can't get the sections, aborting\n"); return;} - dump_sections(separateDebugHead + 1, separateDebugHead->NumberOfSections); + dump_sections(separateDebugHead, separateDebugHead + 1, separateDebugHead->NumberOfSections); nb_dbg = separateDebugHead->DebugDirectorySize / sizeof(IMAGE_DEBUG_DIRECTORY); debugDir = PRD(sizeof(IMAGE_SEPARATE_DEBUG_HEADER) + @@ -1193,7 +1197,7 @@ void pe_dump(void) { dump_pe_header(); /* FIXME: should check ptr */ - dump_sections((const char*)PE_nt_headers + sizeof(DWORD) + + dump_sections(PRD(0, 1), (const char*)PE_nt_headers + sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER) + PE_nt_headers->FileHeader.SizeOfOptionalHeader, PE_nt_headers->FileHeader.NumberOfSections); } diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index e48f252..5b1c68e 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -237,6 +237,7 @@ unsigned int strlenW( const unsigned void dump_unicode_str( const unsigned short *str, int len ); void dump_file_header(const IMAGE_FILE_HEADER *); void dump_optional_header(const IMAGE_OPTIONAL_HEADER32 *, UINT); +void dump_section(const IMAGE_SECTION_HEADER *); enum FileSig get_kind_exec(void); void pe_dump( void );
1
0
0
0
Dmitry Timoshkov : winedump: Handle properly partial optional COFF headers.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 7928f5460fd4c9799baaf461b93e17870d95f722 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7928f5460fd4c9799baaf461b…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:43:15 2006 +0800 winedump: Handle properly partial optional COFF headers. Export dump_file_header() and dump_optional_header() for use outside of pe.c. --- tools/winedump/pe.c | 63 ++++++++++++++++++++++++++++++-------------- tools/winedump/winedump.h | 7 +++++ 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index a5bba57..b3360f4 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -91,7 +91,7 @@ static const IMAGE_NT_HEADERS32 *get_nt_ const IMAGE_DOS_HEADER *dos; dos = PRD(0, sizeof(*dos)); if (!dos) return NULL; - return PRD(dos->e_lfanew, sizeof(IMAGE_NT_HEADERS32)); + return PRD(dos->e_lfanew, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER)); } static int is_fake_dll( void ) @@ -223,8 +223,16 @@ static inline void print_datadirectory(D } } -static void dump_optional_header32(const IMAGE_OPTIONAL_HEADER32 *optionalHeader) +static void dump_optional_header32(const IMAGE_OPTIONAL_HEADER32 *image_oh, UINT header_size) { + IMAGE_OPTIONAL_HEADER32 oh; + const IMAGE_OPTIONAL_HEADER32 *optionalHeader; + + /* in case optional header is missing or partial */ + memset(&oh, 0, sizeof(oh)); + memcpy(&oh, image_oh, min(header_size, sizeof(oh))); + optionalHeader = &oh; + print_word("Magic", optionalHeader->Magic); print_ver("linker version", optionalHeader->MajorLinkerVersion, optionalHeader->MinorLinkerVersion); @@ -257,10 +265,19 @@ static void dump_optional_header32(const print_dword("RVAs & sizes", optionalHeader->NumberOfRvaAndSizes); printf("\n"); print_datadirectory(optionalHeader->NumberOfRvaAndSizes, optionalHeader->DataDirectory); + printf("\n"); } -static void dump_optional_header64(const IMAGE_OPTIONAL_HEADER64 *optionalHeader) +static void dump_optional_header64(const IMAGE_OPTIONAL_HEADER64 *image_oh, UINT header_size) { + IMAGE_OPTIONAL_HEADER64 oh; + const IMAGE_OPTIONAL_HEADER64 *optionalHeader; + + /* in case optional header is missing or partial */ + memset(&oh, 0, sizeof(oh)); + memcpy(&oh, image_oh, min(header_size, sizeof(oh))); + optionalHeader = &oh; + print_word("Magic", optionalHeader->Magic); print_ver("linker version", optionalHeader->MajorLinkerVersion, optionalHeader->MinorLinkerVersion); @@ -292,14 +309,29 @@ static void dump_optional_header64(const print_dword("RVAs & sizes", optionalHeader->NumberOfRvaAndSizes); printf("\n"); print_datadirectory(optionalHeader->NumberOfRvaAndSizes, optionalHeader->DataDirectory); + printf("\n"); } -static void dump_pe_header(void) +void dump_optional_header(const IMAGE_OPTIONAL_HEADER32 *optionalHeader, UINT header_size) { - const IMAGE_FILE_HEADER *fileHeader; + printf("Optional Header (%s)\n", get_magic_type(optionalHeader->Magic)); + + switch(optionalHeader->Magic) { + case IMAGE_NT_OPTIONAL_HDR32_MAGIC: + dump_optional_header32(optionalHeader, header_size); + break; + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + dump_optional_header64((const IMAGE_OPTIONAL_HEADER64 *)optionalHeader, header_size); + break; + default: + printf(" Unknown optional header magic: 0x%-4X\n", optionalHeader->Magic); + break; + } +} +void dump_file_header(const IMAGE_FILE_HEADER *fileHeader) +{ printf("File Header\n"); - fileHeader = &PE_nt_headers->FileHeader; printf(" Machine: %04X (%s)\n", fileHeader->Machine, get_machine_str(fileHeader->Machine)); @@ -330,21 +362,12 @@ static void dump_pe_header(void) X(IMAGE_FILE_BYTES_REVERSED_HI, "BYTES_REVERSED_HI"); #undef X printf("\n"); +} - /* hope we have the right size */ - printf("Optional Header (%s)\n", get_magic_type(PE_nt_headers->OptionalHeader.Magic)); - switch(PE_nt_headers->OptionalHeader.Magic) { - case IMAGE_NT_OPTIONAL_HDR32_MAGIC: - dump_optional_header32((const IMAGE_OPTIONAL_HEADER32*)&PE_nt_headers->OptionalHeader); - break; - case IMAGE_NT_OPTIONAL_HDR64_MAGIC: - dump_optional_header64((const IMAGE_OPTIONAL_HEADER64*)&PE_nt_headers->OptionalHeader); - break; - default: - printf(" Unknown header magic: 0x%-4X\n", PE_nt_headers->OptionalHeader.Magic); - break; - } - printf("\n"); +static void dump_pe_header(void) +{ + dump_file_header(&PE_nt_headers->FileHeader); + dump_optional_header((const IMAGE_OPTIONAL_HEADER32*)&PE_nt_headers->OptionalHeader, PE_nt_headers->FileHeader.SizeOfOptionalHeader); } static void dump_sections(const void* addr, unsigned num_sect) diff --git a/tools/winedump/winedump.h b/tools/winedump/winedump.h index 0d2a051..e48f252 100644 --- a/tools/winedump/winedump.h +++ b/tools/winedump/winedump.h @@ -47,6 +47,11 @@ #include <assert.h> #include <stdarg.h> +#define NONAMELESSUNION +#define NONAMELESSSTRUCT +#include "windef.h" +#include "winbase.h" + /* Argument type constants */ #define MAX_FUNCTION_ARGS 32 @@ -230,6 +235,8 @@ void dump_data( const unsigne const char* get_time_str( unsigned long ); unsigned int strlenW( const unsigned short *str ); void dump_unicode_str( const unsigned short *str, int len ); +void dump_file_header(const IMAGE_FILE_HEADER *); +void dump_optional_header(const IMAGE_OPTIONAL_HEADER32 *, UINT); enum FileSig get_kind_exec(void); void pe_dump( void );
1
0
0
0
Dmitry Timoshkov : winedump: IMAGE_SCN_ALIGN_??? are not the bit fields, but the values masked by IMAGE_SCN_ALIGN_MASK.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: cb7453ff4d7125063e582d05839d5f23ecaf8541 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb7453ff4d7125063e582d058…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:43:04 2006 +0800 winedump: IMAGE_SCN_ALIGN_??? are not the bit fields, but the values masked by IMAGE_SCN_ALIGN_MASK. --- tools/winedump/pe.c | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 8365432..a5bba57 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -365,8 +365,8 @@ static void dump_sections(const void* ad printf(" line # offs: %-8u line #'s: %-8u\n", sectHead->PointerToLinenumbers, sectHead->NumberOfLinenumbers); printf(" characteristics: 0x%08x\n", sectHead->Characteristics); - printf(" "); -#define X(b,s) if (sectHead->Characteristics & b) printf(s " ") + printf(" "); +#define X(b,s) if (sectHead->Characteristics & b) printf(" " s) /* #define IMAGE_SCN_TYPE_REG 0x00000000 - Reserved */ /* #define IMAGE_SCN_TYPE_DSECT 0x00000001 - Reserved */ /* #define IMAGE_SCN_TYPE_NOLOAD 0x00000002 - Reserved */ @@ -394,14 +394,25 @@ static void dump_sections(const void* ad X(IMAGE_SCN_MEM_LOCKED, "MEM_LOCKED"); X(IMAGE_SCN_MEM_PRELOAD, "MEM_PRELOAD"); - X(IMAGE_SCN_ALIGN_1BYTES, "ALIGN_1BYTES"); - X(IMAGE_SCN_ALIGN_2BYTES, "ALIGN_2BYTES"); - X(IMAGE_SCN_ALIGN_4BYTES, "ALIGN_4BYTES"); - X(IMAGE_SCN_ALIGN_8BYTES, "ALIGN_8BYTES"); - X(IMAGE_SCN_ALIGN_16BYTES, "ALIGN_16BYTES"); - X(IMAGE_SCN_ALIGN_32BYTES, "ALIGN_32BYTES"); - X(IMAGE_SCN_ALIGN_64BYTES, "ALIGN_64BYTES"); -/* 0x00800000 - Unused */ + switch (sectHead->Characteristics & IMAGE_SCN_ALIGN_MASK) + { +#define X2(b,s) case b: printf(" " s); break; + X2(IMAGE_SCN_ALIGN_1BYTES, "ALIGN_1BYTES"); + X2(IMAGE_SCN_ALIGN_2BYTES, "ALIGN_2BYTES"); + X2(IMAGE_SCN_ALIGN_4BYTES, "ALIGN_4BYTES"); + X2(IMAGE_SCN_ALIGN_8BYTES, "ALIGN_8BYTES"); + X2(IMAGE_SCN_ALIGN_16BYTES, "ALIGN_16BYTES"); + X2(IMAGE_SCN_ALIGN_32BYTES, "ALIGN_32BYTES"); + X2(IMAGE_SCN_ALIGN_64BYTES, "ALIGN_64BYTES"); + X2(IMAGE_SCN_ALIGN_128BYTES, "ALIGN_128BYTES"); + X2(IMAGE_SCN_ALIGN_256BYTES, "ALIGN_256BYTES"); + X2(IMAGE_SCN_ALIGN_512BYTES, "ALIGN_512BYTES"); + X2(IMAGE_SCN_ALIGN_1024BYTES, "ALIGN_1024BYTES"); + X2(IMAGE_SCN_ALIGN_2048BYTES, "ALIGN_2048BYTES"); + X2(IMAGE_SCN_ALIGN_4096BYTES, "ALIGN_4096BYTES"); + X2(IMAGE_SCN_ALIGN_8192BYTES, "ALIGN_8192BYTES"); +#undef X2 + } X(IMAGE_SCN_LNK_NRELOC_OVFL, "LNK_NRELOC_OVFL");
1
0
0
0
Dmitry Timoshkov : winedump: Avoid returning void from a void function.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 2d9046e209a90963663375da6d38b01b3514c410 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2d9046e209a90963663375da6…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:42:54 2006 +0800 winedump: Avoid returning void from a void function. --- tools/winedump/pdb.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 93df303..9dd9c2c 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -671,9 +671,15 @@ void pdb_dump(void) /* init_types(); */ head = PRD(0, sizeof(pdb2) - 1); if (head && !memcmp(head, pdb2, sizeof(pdb2) - 1)) - return pdb_jg_dump(); + { + pdb_jg_dump(); + return; + } head = PRD(0, sizeof(pdb7) - 1); if (head && !memcmp(head, pdb7, sizeof(pdb7) - 1)) - return pdb_ds_dump(); + { + pdb_ds_dump(); + return; + } printf("Unrecognized header %s\n", head); }
1
0
0
0
Dmitry Timoshkov : winedump: Make output of dump_data fit into 80 columns.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 53e89174c0da98723a1fbfb41432b3163396ef28 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53e89174c0da98723a1fbfb41…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:42:44 2006 +0800 winedump: Make output of dump_data fit into 80 columns. --- tools/winedump/pdb.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/winedump/pdb.c b/tools/winedump/pdb.c index 0310ab7..93df303 100644 --- a/tools/winedump/pdb.c +++ b/tools/winedump/pdb.c @@ -145,7 +145,7 @@ static void pdb_exit(struct pdb_reader* size = pdb_get_file_size(reader, i); printf("File --unused-- #%d (%x)\n", i, size); - dump_data(file, size, "\t"); + dump_data(file, size, " "); free((char*)file); } #endif @@ -204,7 +204,7 @@ static void pdb_dump_symbols(struct pdb_ printf("\t----------offsets------------\n"); src = (const BYTE*)((const char*)symbols + sizeof(PDB_SYMBOLS) + symbols->module_size); - dump_data(src, symbols->offset_size, "\t\t"); + dump_data(src, symbols->offset_size, " "); } if (symbols->srcmodule_size) @@ -396,13 +396,13 @@ static void pdb_dump_symbols(struct pdb_ if (symbol_size) codeview_dump_symbols((const char*)modimage + sizeof(DWORD), symbol_size); - + /* what's that part ??? */ if (0) - dump_data(modimage + symbol_size + lineno_size, total_size - (symbol_size + lineno_size), "\t\t\t"); + dump_data(modimage + symbol_size + lineno_size, total_size - (symbol_size + lineno_size), " "); free((char*)modimage); } - + file_name += strlen(file_name) + 1; file = (char*)((DWORD)(file_name + strlen(file_name) + 1 + 3) & ~3); }
1
0
0
0
Dmitry Timoshkov : kernel32: Add PE images with section alignment 1 and 2 to the loader test.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 046814701eda99f7b77bf46b03e3209b04a0ded3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=046814701eda99f7b77bf46b0…
Author: Dmitry Timoshkov <dmitry(a)codeweavers.com> Date: Thu Dec 7 21:39:16 2006 +0800 kernel32: Add PE images with section alignment 1 and 2 to the loader test. --- dlls/kernel32/tests/loader.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index fbf1b6a..ed3f7a5 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -171,6 +171,16 @@ START_TEST(loader) 0, ERROR_SUCCESS }, + { 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 4, 4, + 1, + 0, + ERROR_SUCCESS + }, + { 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 1, 1, + 1, + 0, + ERROR_SUCCESS + }, { 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x200, 0x200, 0, 0, @@ -192,10 +202,11 @@ START_TEST(loader) SetErrorMode(SEM_FAILCRITICALERRORS); GetTempPath(MAX_PATH, temp_path); - GetTempFileName(temp_path, "ldr", 0, dll_name); for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { + GetTempFileName(temp_path, "ldr", 0, dll_name); + /*trace("creating %s\n", dll_name);*/ hfile = CreateFileA(dll_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); if (hfile == INVALID_HANDLE_VALUE)
1
0
0
0
Alexandre Julliard : ntdll: Fix the failing loader tests.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 94ac9895341d6a8544690ea63ff4655ecd61496c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94ac9895341d6a8544690ea63…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Dec 7 15:34:36 2006 +0100 ntdll: Fix the failing loader tests. --- dlls/kernel32/tests/loader.c | 12 ------------ dlls/ntdll/virtual.c | 8 +++++--- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 50dbfb8..fbf1b6a 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -294,16 +294,12 @@ START_TEST(loader) { ok(info.BaseAddress == (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: %p != %p\n", i, info.BaseAddress, (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize)); -todo_wine { ok(info.AllocationBase == 0, "%d: %p != 0\n", i, info.AllocationBase); -} ok(info.AllocationProtect == 0, "%d: %x != 0\n", i, info.AllocationProtect); /*ok(info.RegionSize == not_practical_value, "%d: %lx != not_practical_value\n", i, info.RegionSize);*/ ok(info.State == MEM_FREE, "%d: %x != MEM_FREE\n", i, info.State); ok(info.Type == 0, "%d: %x != 0\n", i, info.Type); -todo_wine { ok(info.Protect == PAGE_NOACCESS, "%d: %x != PAGE_NOACCESS\n", i, info.Protect); -} } else { @@ -322,14 +318,6 @@ todo_wine { } else { /* LoadLibrary has failed */ - if (hlib) /* remove completely once Wine is fixed */ - { - todo_wine ok(!hlib, "%d: LoadLibrary should fail\n", i); - FreeLibrary(hlib); - DeleteFile(dll_name); - continue; - } - ok(!hlib, "%d: LoadLibrary should fail\n", i); if (GetLastError() == ERROR_GEN_FAILURE) /* Win9x, broken behaviour */ diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 54193ff..2b1ff24 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -1021,6 +1021,7 @@ static NTSTATUS map_image( HANDLE hmappi removable ) != STATUS_SUCCESS) goto error; /* check that all sections are loaded at the right offset */ + if (nt->OptionalHeader.FileAlignment != nt->OptionalHeader.SectionAlignment) goto error; for (i = 0; i < nt->FileHeader.NumberOfSections; i++) { if (sec[i].VirtualAddress != sec[i].PointerToRawData) @@ -1710,7 +1711,8 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HA if (!view) { info->State = MEM_FREE; - info->Protect = 0; + info->Protect = PAGE_NOACCESS; + info->AllocationBase = 0; info->AllocationProtect = 0; info->Type = 0; } @@ -1719,6 +1721,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HA BYTE vprot = view->prot[(base - alloc_base) >> page_shift]; info->State = (vprot & VPROT_COMMITTED) ? MEM_COMMIT : MEM_RESERVE; info->Protect = VIRTUAL_GetWin32Prot( vprot ); + info->AllocationBase = alloc_base; info->AllocationProtect = VIRTUAL_GetWin32Prot( view->protect ); if (view->protect & VPROT_IMAGE) info->Type = MEM_IMAGE; else if (view->flags & VFLAG_VALLOC) info->Type = MEM_PRIVATE; @@ -1728,8 +1731,7 @@ NTSTATUS WINAPI NtQueryVirtualMemory( HA } RtlLeaveCriticalSection(&csVirtual); - info->BaseAddress = (LPVOID)base; - info->AllocationBase = (LPVOID)alloc_base; + info->BaseAddress = base; info->RegionSize = size - (base - alloc_base); if (res_len) *res_len = sizeof(*info); return STATUS_SUCCESS;
1
0
0
0
Chris Robinson : wgl: Implement wglGetPixelFormatAttribfvARB.
by Alexandre Julliard
07 Dec '06
07 Dec '06
Module: wine Branch: master Commit: 34c40097a51509447c7078313421a38a8514dfc4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34c40097a51509447c7078313…
Author: Chris Robinson <chris.kcat(a)gmail.com> Date: Tue Dec 5 17:46:30 2006 -0800 wgl: Implement wglGetPixelFormatAttribfvARB. --- dlls/winex11.drv/opengl.c | 45 ++++++++++++++++++++++++++++++++++----------- 1 files changed, 34 insertions(+), 11 deletions(-) diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 9178152..9d42019 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2228,17 +2228,6 @@ static GLboolean WINAPI X11DRV_wglChoose } /** - * X11DRV_wglGetPixelFormatAttribfvARB - * - * WGL_ARB_pixel_format: wglGetPixelFormatAttribfvARB - */ -static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues) -{ - FIXME("(%p, %d, %d, %d, %p, %p): stub\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); - return GL_FALSE; -} - -/** * X11DRV_wglGetPixelFormatAttribivARB * * WGL_ARB_pixel_format: wglGetPixelFormatAttribivARB @@ -2462,6 +2451,40 @@ pix_error: } /** + * X11DRV_wglGetPixelFormatAttribfvARB + * + * WGL_ARB_pixel_format: wglGetPixelFormatAttribfvARB + */ +static GLboolean WINAPI X11DRV_wglGetPixelFormatAttribfvARB(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues) +{ + int *attr; + int ret; + int i; + + TRACE("(%p, %d, %d, %d, %p, %p)\n", hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, pfValues); + + /* Allocate a temporary array to store integer values */ + attr = HeapAlloc(GetProcessHeap(), 0, nAttributes * sizeof(int)); + if (!attr) { + ERR("couldn't allocate %d array\n", nAttributes); + return GL_FALSE; + } + + /* Piggy-back on wglGetPixelFormatAttribivARB */ + ret = X11DRV_wglGetPixelFormatAttribivARB(hdc, iPixelFormat, iLayerPlane, nAttributes, piAttributes, attr); + if (ret) { + /* Convert integer values to float. Should also check for attributes + that can give decimal values here */ + for (i=0; i<nAttributes;i++) { + pfValues[i] = attr[i]; + } + } + + HeapFree(GetProcessHeap(), 0, attr); + return ret; +} + +/** * X11DRV_wglBindTexImageARB * * WGL_ARB_render_texture: wglBindTexImageARB
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
57
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200