SCREENSHOT: Windows Genuine Advantage 'GenuineCheck.exe' program generating key on Wine!

Hans Leidekker hans at it.vu.nl
Sat Dec 17 07:48:28 CST 2005


On Saturday 17 December 2005 07:00, Segin wrote:

> The attached screenshot (UNMODIFIED) depicts the WGA 'GenuineCheck.exe'
> program that is used on the microsoft web site to 'validate' Windows so
> that you can download crap. Normally, it will not generate the needed

If WGA enables downloading crap, why are you spending effort running
it on Wine?

> key under Wine, but I have a screenshot (attached) of it doing so. I
> don't know is this is worth noting, as i couldn't tell you how I made it
> work (a LOT of things, too many to even count). However, I thought it
> might be something of intrest. If this is in any way useful to the
> development of Wine, please let me know.

It can be very simple to make Wine compatible with the WGA check, the
patch below used to do it for me. Patches like this are not likely to be
applied to mainstream Wine though.

As has been discussed before, it's not wise to engage in a hide and seek
game with Microsoft, since they will allways be able to change the check
one more time.

They _are_ straddling the fence though, because the check can be seen as
a means to tie applications to their OS. They use it to control distribution
of "OS components" that applications depend on and where the term
"OS component" is given a rather broad interpretation.

Of course, the right way for Wine to circumvent the WGA check is to provide
open source implementations of those OS components.

 -Hans

Index: dlls/ntdll/reg.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/reg.c,v
retrieving revision 1.68
diff -u -r1.68 reg.c
--- dlls/ntdll/reg.c	9 Dec 2005 13:52:46 -0000	1.68
+++ dlls/ntdll/reg.c	17 Dec 2005 12:49:16 -0000
@@ -115,6 +115,14 @@
 {
     NTSTATUS ret;
     DWORD len = attr->ObjectName->Length;
+    static const WCHAR GenuineCheck[] =
+        { 'G','e','n','u','i','n','e','C','h','e','c','k','.','e','x','e',0 };
+    static const WCHAR WineConfig[] =
+        { 'S','O','F','T','W','A','R','E',
+          '\\','W','i','n','e',
+          '\\','W','i','n','e',
+          '\\','C','o','n','f','i','g',0 };
+    LDR_MODULE *pldr;
 
     TRACE( "(%p,%s,%lx,%p)\n", attr->RootDirectory,
            debugstr_us(attr->ObjectName), access, retkey );
@@ -133,6 +141,16 @@
     }
     SERVER_END_REQ;
     TRACE("<- %p\n", *retkey);
+
+    if (!LdrFindEntryForAddress( NtCurrentTeb()->Peb->ImageBaseAddress, &pldr ))
+    {
+        if (!strcmpiW( attr->ObjectName->Buffer, WineConfig ) &&
+            !strcmpiW( pldr->BaseDllName.Buffer, GenuineCheck ))
+        {
+            TRACE( "Enabling workaround for GenuineCheck.exe\n" );
+            return STATUS_INVALID_PARAMETER;
+        }
+    }
     return ret;
 }
 




More information about the wine-devel mailing list