public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: reverse engineering pwcx
@ 2004-08-28 16:17 Albert Cahalan
  2004-08-28 16:25 ` Lee Revell
  2004-08-29 21:04 ` Helge Hafting
  0 siblings, 2 replies; 22+ messages in thread
From: Albert Cahalan @ 2004-08-28 16:17 UTC (permalink / raw)
  To: linux-kernel mailing list; +Cc: rlrevell, clemtaylor, qg, rogers

> The LavaRnd guys examined the pixels on the actual
> CCD chip.  It's 160x120.  The 'decompression' is
> just interpolation.

First of all, it's not a CCD chip. It's CMOS.

Now, here's a Bayer pattern:

RG
GB
RGRGR
GBGBG
RGRGR
GBGBG

Don't put much faith in the 160x120 number. Suppose
that the chip is in a Bayer pattern, with 160x120
of those. Well, how many pixels is that? Who knows.
You'd sort of have 160x120, but with double the
green data. Since green carries most of the luminance
information, producing a larger image is reasonable.

Suppose the pattern is larger. The "Bayer" name in
the code may well be misleading. Each "pixel" that
was counted could be a 4x4 grid with 6 red subpixels,
8 green subpixels, and 2 blue subpixels. What's that?
You count 160x120, because it looks that way, but
it's 640x480 subpixels.

To correctly convert this to pixels while keeping the
maximum amount of image data, I think you need to
use the sinc() function. Problem is, you're getting
pre-mangled data from the camera. So it gets a bit
more complicated.

BTW, what are the legal problems? I didn't click to
agree on some EULA. I didn't sign an NDA. I don't
see how this could be considered a copy-control or
encryption system. Am I missing something? Maybe
this ought to be a 2-person project?

The code does look easy enough to take apart, even
using plain objdump. I think I'd be doing so now if
I had one of the cameras. (What nerd could resist?)
The decompiler is a much cooler option though.
By using both x86_64 and powerpc, recovery of data
types should improve.



^ permalink raw reply	[flat|nested] 22+ messages in thread
* reverse engineering pwcx
@ 2004-08-28  0:52 QuantumG
       [not found] ` <20040828012055.GL24018@isi.edu>
  2004-08-28  6:47 ` Clem Taylor
  0 siblings, 2 replies; 22+ messages in thread
From: QuantumG @ 2004-08-28  0:52 UTC (permalink / raw)
  To: linux-kernel


Having watched the discussion around pwcx since the first posting, I 
thought I would take a look at libpwcx.a.  It consists of 3 .o files 
each containing full symbol information and in total a *very* small 
amount of code.  There is no secret algorithm or complex image 
processing in this code.  Having worked on reverse engineering a complex 
audio processing application (see our paper Using a Decompiler for 
Real-World Source Recovery, to appear WCRE 2004), I expected to see some 
serious floating point calculations or at least something recognisable 
as a FFT or some other known algorithm.  There is none of this in the 
pwcx driver.   I could provide complete decompiled source code for this 
binary, however due to the legal questions I'd rather just say that 
there is really not a lot of effort required here to black box this 
driver and replicate what it is doing.  The biggest job will be 
deciphering the two or three large tables used in the decompression 
operations.

The specific issue of pwcx dealt with I'd really like to ask why 
companies perfer to release binary drivers over open source drivers.  A 
Linux kernel driver is really easy to decompile.  There's a number of 
factors that make this so, especially the large amount of symbols 
generally left in binary drivers, but mainly the fact that kernel 
drivers are by design small contained pieces of code.  Also, they are 
generally written in straight C with the only function pointers being 
well documented interfaces (and the function pointers are not changed 
dynamically).  Compared to say, a win32 application written in C++ with 
all that stdcall/fastcall stuff, a linux kernel module is a joy to 
decompile.  So why bother releasing a binary only driver?  The company 
is not protecting its intellectual property.  If an amature like me, who 
knows nothing about web cams, can understand this driver than surely 
someone at one of Philips' competitors reverse engineered and understood 
this algorithm within weeks of the drivers for this camera hitting the 
market.  I'm sure Philips' knows this so why force Nemosoft to sign an 
NDA?  And more importantly, why not let the community maintain this driver?

Trent Waddington
Decompiler maintainer, http://boomerang.sourceforge.net/


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2004-08-30 20:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-28 16:17 reverse engineering pwcx Albert Cahalan
2004-08-28 16:25 ` Lee Revell
2004-08-28 16:56   ` Albert Cahalan
2004-08-28 17:11     ` Lee Revell
2004-08-28 18:05       ` Vojtech Pavlik
2004-08-28 17:53   ` Joel Jaeggli
2004-08-28 18:04     ` Lee Revell
2004-08-28 18:08       ` Lee Revell
2004-08-29 21:04 ` Helge Hafting
2004-08-30  7:42   ` Paul Jakma
2004-08-30 12:52     ` Albert Cahalan
2004-08-30 20:23       ` dulle
  -- strict thread matches above, loose matches on Subject: below --
2004-08-28  0:52 QuantumG
     [not found] ` <20040828012055.GL24018@isi.edu>
     [not found]   ` <20040828014931.GM24018@isi.edu>
2004-08-28  3:14     ` QuantumG
2004-08-28  3:35       ` Craig Milo Rogers
2004-08-28  3:49         ` Lee Revell
2004-08-28 12:23           ` Vojtech Pavlik
2004-08-28 19:20             ` Chris Meadors
2004-08-28  3:57         ` QuantumG
2004-08-28 12:07       ` Vojtech Pavlik
2004-08-28  6:47 ` Clem Taylor
2004-08-28 12:23   ` Wouter Van Hemel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox