[Prev][Next][Index][Thread]

Late Xmas gift..



Ok, apply the following diff to wine951212, add the line "IgnoreLptStat" to
the quickcam.ini [quickcam] section, and you too can see how the quickcam
works.  You do have to be root, or setuid wine for this to work.

Oh, it's set for the Quickcam to connected to 0x378.  Just change to your
favorite port..

Yes folks, it's crackable, with no logic analyzer, no disassembling the
drivers.

oh, to see how the camera works:

wine quickpict.exe will just let it work, with no debuging

wine -debugmsg +int quickpict.exe will log _all_ IO accesses to stdout.

Be warned, the output is _huge_ (on the order of 10 to 15 megs, depending
on transfer mode and image size)

The diff:

--- wine951212/miscemu/ioports.c	Thu Jul 27 13:15:26 1995
+++ wine951212-my/miscemu/ioports.c	Tue Dec 26 00:07:31 1995
@@ -14,6 +14,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
+#include <asm/io.h>
+#include <unistd.h>
 #include "windows.h"
 #include "stddebug.h"
 /* #define DEBUG_INT */
@@ -43,7 +45,7 @@
 
     while (count-- > 0)
     {
-        switch (port++)
+        switch (port)
 	{
 	case 0x70:
             b = cmosaddress;
@@ -51,11 +53,23 @@
 	case 0x71:
             b = cmosimage[cmosaddress & 0x3f];
             break;
+	case 0x378:
+	case 0x379:
+	case 0x37a:
+	    if (ioperm(0x378, 3, 1))
+	        dprintf_int(stddeb, "IO: can't get ioperm");
+	    b = inb(port);
+	    ioperm(0x378, 3, 0);
+	    break;
 	default:
 	  b = 0xff;
 	}
+	port++;
         res = (res << 8) | b;
     }
+
+    dprintf_int(stddeb, "IO: read from port 0x%02x, res = 0x%04lx\n", --port, res );
+
     return res;
 }
 
@@ -64,14 +78,14 @@
 {
     BYTE b;
 
-    dprintf_int( stddeb, "IO: 0x%lx (%d bytes) to port 0x%02x\n",
+    dprintf_int( stddeb, "IO: 0x%04lx (%d bytes) to port 0x%02x\n",
                  value, count, port );
 
     while (count-- > 0)
     {
         b = value & 0xff;
         value >>= 8;
-        switch (port++)
+        switch (port)
 	{
 	case 0x70:
             cmosaddress = b & 0x7f;
@@ -79,8 +93,16 @@
 	case 0x71:
             cmosimage[cmosaddress & 0x3f] = b;
             break;
+	case 0x378:
+	case 0x379:
+	case 0x37a:
+	    ioperm(0x378, 3, 1);
+	    outb(b, port);
+	    ioperm(0x378, 3, 0);
+	    break;
 	default:
             /* Rien du tout.  */
 	}
+	port++;
     }
 }

-- 
Thomas Davis			| Internet:	Thomas.Davis@mnscorp.com
Systems Consultant		| Snail Mail:	Suite 528
Midwest Network Solutions Corp.	| 		1941 South 42nd Street
(402) 346-7687			|		Omaha, NE 68105-2939

Follow-Ups: