Alexandre Julliard : winedump: Also check for builtin dll signature.

Alexandre Julliard julliard at winehq.org
Mon Apr 22 16:30:38 CDT 2019


Module: wine
Branch: master
Commit: 209d2976f261bf9444d9ce9af722baef0b159842
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=209d2976f261bf9444d9ce9af722baef0b159842

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Apr 22 19:48:04 2019 +0200

winedump: Also check for builtin dll signature.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winedump/pe.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c
index bbfd296..d33e8ef 100644
--- a/tools/winedump/pe.c
+++ b/tools/winedump/pe.c
@@ -98,16 +98,20 @@ static const IMAGE_NT_HEADERS32 *get_nt_header( void )
     return PRD(dos->e_lfanew, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER));
 }
 
-static BOOL is_fake_dll( void )
+static void print_fake_dll( void )
 {
+    static const char builtin_signature[] = "Wine builtin DLL";
     static const char fakedll_signature[] = "Wine placeholder DLL";
     const IMAGE_DOS_HEADER *dos;
 
-    dos = PRD(0, sizeof(*dos) + sizeof(fakedll_signature));
-
-    if (dos && dos->e_lfanew >= sizeof(*dos) + sizeof(fakedll_signature) &&
-        !memcmp( dos + 1, fakedll_signature, sizeof(fakedll_signature) )) return TRUE;
-    return FALSE;
+    dos = PRD(0, sizeof(*dos) + 32);
+    if (dos && dos->e_lfanew >= sizeof(*dos) + 32)
+    {
+        if (!memcmp( dos + 1, builtin_signature, sizeof(builtin_signature) ))
+            printf( "*** This is a Wine builtin DLL ***\n\n" );
+        else if (!memcmp( dos + 1, fakedll_signature, sizeof(fakedll_signature) ))
+            printf( "*** This is a Wine fake DLL ***\n\n" );
+    }
 }
 
 static const void *get_dir_and_size(unsigned int idx, unsigned int *size)
@@ -1948,7 +1952,7 @@ void pe_dump(void)
     int	all = (globals.dumpsect != NULL) && strcmp(globals.dumpsect, "ALL") == 0;
 
     PE_nt_headers = get_nt_header();
-    if (is_fake_dll()) printf( "*** This is a Wine fake DLL ***\n\n" );
+    print_fake_dll();
 
     if (globals.do_dumpheader)
     {




More information about the wine-cvs mailing list