Question about WINE and adding the "low-level" CD access APIs...

Roderick Colenbrander thunderbird2k at gmx.net
Mon Jul 14 07:41:52 CDT 2003


Hi,

Not that I don't know a lot about copy protections but what I know might help 
you a little. There are various different copy protections. The most popular 
I think is Safedisc followed by SecureRom. Atleast Safedisc uses some 
.vxd/.sys driver to do some stuff. Not exactly sure what it is doing. 
Something related to extracting the executable. Some time ago Laurent 
Pinchart tried to implement Safedisc version 1.x. He managed to get some 
games working but the code never made it into wine because of DMCA issues. 
(also one of the reasons Transgaming's cd code isn't open another is that 
they have some deals with Macrovision the makers of Safedisc) Check his work 
here: http://www.winehq.com/hypermail/wine-patches/2002/04/0194.html

I don't know much about SecureRom other than that some Blizzard games use it. 
(and others)

Your welcome to look into Safedisc (really lots of games atleast use it). You 
can try to port Laurent's work over to a recent Wine version and you can 
contact him for more info. Creating a driver for the newer Safedisc 2.x too 
would take lots of debugging.. Perhaps a better way is nowadays to find a way 
to load the Windows .sys/.vxd driver. In the past this was about impossible 
but now it might not be that hard anymore. To get this working an x86 
emulator is needed with ring0 support or whatever it is. Recently a new x86 
emulator called qemu popped up that is useable for this task I think. It can 
both emulate Linux x86 binaries (binary loader) and even simulate a Linux 
system. (it has a x86 emu library that can be used under the LGPL too) If 
interested check here: http://fabrice.bellard.free.fr/qemu/

I hope my little info helped,
Roderick

On Monday 14 July 2003 14:24, Jonathan Wilson wrote:
> Many copy protections use special tricks on the CDs (I dont know the
> details). Presumably these protections use some kind of lower-level API to
> access the data on the CD directly (instead of going through the file I/O
> calls). Currently TransGaming does something specific for each kind of copy
> protection to make it work. Would it be possible to implement these APIs in
> WINE and have them redirect to whatever low level APIs are provided by
> linux/x/whatever? That way (assuming the implementation was complete), any
> copy protection would work (i.e. when the protection says "give me this bit
> of data from the CD in this form", WINE hooks that, gets the relavent data
> and returns it to the application. Same could be said for protections that
> use the "boot blocks" to store licence data (such as CDilla Licence
> Manager), for those you could hook the "read from boot block" and "write to
> boot block" calls and store the data somewhere (preferably not the real
> boot block :)
>
> If someone can tell me what the low-level access that these protections use
> is actually called (i.e. what search term to use in MSDN to look for
> documentation etc) as well as info on whatever the relavent linux low-level
> access stuff would be, I can look at drawing up some kind of "here is how
> this could be done" document.
>
> Similar low-level hooks could be used to allow things like AudioCatalyst
> (program that converts audio-cd tracks to MP3 files) and anything else that
> does lower level access to CDs/DVDs than the high-level file I/O APIs and
> etc. (the day its possible to run Nero Burning Rom in WINE with no problems
> will be a great day indeed for the project :)
>
> If this isnt fesable for copy protection and so on, please explain why (I
> know nothing about copy protection or how to program the CD-ROM in win32)
> Basicly, I dont understand why there is a need for "protection-specific"
> code in WineX when you could emulate whatever the protection uses and
> appear just like real windows to the game...




More information about the wine-devel mailing list