http://bugs.winehq.org/show_bug.cgi?id=29669
Bug #: 29669 Summary: Dragon Age: Origins DVD authenticity checks fail (descriptor structures returned by DVD_READ_STRUCT need a descriptor header prepended) Product: Wine Version: 1.3.37 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: ntdll AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net Classification: Unclassified
Hello,
continuation of bug 29667 Now that DVD_LAYER_DESCRIPTOR data is properly verified, the game loader retrieves DvdManufacturerDescriptor using IOCTL_DVD_READ_STRUCTURE.
The interesting part is that the game loader copies the returned buffer bytes starting from offset 4 (throwing the first _four_ bytes away).
Remembering these four bytes, I went back here:
http://source.winehq.org/git/wine.git/blob/f082eac97c3ec71de58eea85bb4de5a12...
--- quote --- /* The documented format of DVD_LAYER_DESCRIPTOR is wrong. Even the format in the * DDK's header is wrong. There are four bytes at the start defined by * MMC-5. The first two are the size of the structure in big-endian order as * defined by MMC-5. The other two are reserved. */ --- quote ---
Actually all descriptor structures handled by DVD_READ_STRUCTURE have a DVD_DESCRIPTOR_HEADER prepended - not just DVD_LAYER_DESCRIPTOR.
This forum posts give some useful information:
http://forums.techguy.org/software-development/812384-scsi-read-disc-structu...
--- snip --- typedef struct { USHORT Length; /* bigEndian */ UCHAR Reserved[2]; } DVD_DESCRIPTOR_HEADER, *PDVD_DESCRIPTOR_HEADER; --- snip ---
Because of the missing DVD_DESCRIPTOR_HEADER, the first four bytes get lost hence the extraction of specific fields from manufacturer buffer gives wrong values.
With the DVD_DESCRIPTOR_HEADER in place, all DVD authenticity checks pass and the game successfully runs using original media.
Regards
http://bugs.winehq.org/show_bug.cgi?id=29669
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |obfuscation Depends on| |29667
--- Comment #1 from Anastasius Focht focht@gmx.net 2012-01-21 06:36:07 CST --- Hello,
filling fields ...
Regards
http://bugs.winehq.org/show_bug.cgi?id=29669
Cùran debian@carbon-project.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |debian@carbon-project.org
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #2 from Dan Kegel dank@kegel.com 2012-01-25 13:09:43 CST --- Created attachment 38552 --> http://bugs.winehq.org/attachment.cgi?id=38552 draft patch, with extra traces
Here's a first try, not yet working. On kernel 3.0, the ioctl for DvdManufacturerDescriptor fails with EIO because of https://bugs.launchpad.net/ubuntu/+source/linux/+bug/777528 On kernel 3.2, the ioctl succeeds, and I see a good-looking manufacturer string, but Dragon Age Origins Ultimate Edition still says the cd looks wrong.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #3 from Anastasius Focht focht@gmx.net 2012-01-25 14:15:22 CST --- Hello,
For me it works as expected. Maybe the "Ultimate" edition has a different copy protection/more checks.
--- snip --- $ WINEDEBUG=+tid,+cdrom wine ./daorigins.exe 0009:trace:cdrom:CDROM_DeviceIoControl 0xa4 IOCTL_CDROM_READ_TOC (nil) 0 0x32e0a8 804 0x32d850 0009:trace:cdrom:CDROM_Open 0, 6 0009:trace:cdrom:CDROM_SyncCache caching toc from=1 to=1 0009:trace:cdrom:CDROM_DeviceIoControl 0xa4 IOCTL_SCSI_GET_ADDRESS (nil) 0 0x32e4e0 8 0x32e480 0009:trace:cdrom:CDROM_Open 0, 6 0009:trace:cdrom:CDROM_DeviceIoControl 0xa4 IOCTL_SCSI_GET_INQUIRY_DATA (nil) 0 0x36518b90 4096 0x32e480 0009:trace:cdrom:CDROM_Open 0, 6 0009:trace:cdrom:CDROM_DeviceIoControl 0xa4 IOCTL_DVD_READ_STRUCTURE 0x32e510 17 0x36518b90 2052 0x32e49c 0009:trace:cdrom:CDROM_Open 0, 6 0009:trace:cdrom:CDROM_DeviceIoControl doing DVD_READ_STRUCTURE 0009:trace:cdrom:DVD_ReadStructure Format 0 0009:trace:cdrom:DVD_ReadStructure DvdPhysicalDescriptor: StartingDataSector 768 0009:trace:cdrom:CDROM_DeviceIoControl 0xa4 IOCTL_DVD_READ_STRUCTURE 0x32e548 17 0x36519bb0 2052 0x32e4e4 0009:trace:cdrom:CDROM_Open 0, 6 0009:trace:cdrom:CDROM_DeviceIoControl doing DVD_READ_STRUCTURE 0009:trace:cdrom:DVD_ReadStructure Format 4 0009:trace:cdrom:DVD_ReadStructure Reading DvdManufacturerDescriptor(layer_num 0)... 0009:trace:cdrom:DVD_ReadStructure DvdManufacturerDescriptor: 05000000 002b:fixme:win:EnumDisplayDevicesW ((null),0,0x528e248,0x00000000), stub! --- snip ---
--- snip --- -=[ ProtectionID v0.6.4.0 JULY]=- (c) 2003-2010 CDKiLLER & TippeX Build 07/08/10-17:57:05 Ready...
Scanning -> Z:\opt\wineprefix\drive_c\Program Files\Dragon Age\bin_ship\daorigins.exe File Type : 32-Bit Exe (Subsystem : Win GUI / 2), Size : 9909480 (09734E8h) Byte(s) -> File Appears to be Digitally Signed @ Offset 0972000h, size : 014E8h / 05352 byte(s) [File Heuristics] -> Flag : 00000000000000001000000000000100 (0x00008004) [!] EA Custom Protection detected ! [CompilerDetect] -> Visual C++ 8.0 (Visual Studio 2005) - Scan Took : 0.91 Second(s)
Scanning -> Z:\opt\wineprefix\drive_c\Program Files\Dragon Age\bin_ship\daupdater.engine.dll File Type : 32-Bit Dll (Subsystem : Win CUI / 3), Size : 136424 (0214E8h) Byte(s) -> File Appears to be Digitally Signed @ Offset 020000h, size : 014E8h / 05352 byte(s) [File Heuristics] -> Flag : 00000000000001001101000000110100 (0x0004D034) [!] Possible CD/DVD-Key or Serial Check -> SerialNumber [CompilerDetect] -> .NET [!] File appears to have no protection or is using an unknown protection - Scan Took : 0.383 Second(s) --- snip ---
http://www.gamespot.com/news/6209144.html
--- quote --- "We're happy to announce that the boxed/retail PC version of Dragon Age: Origins will use only a basic disk check and it will not require online authentication," confirmed community coordinator Chris Priestly on BioWare's official forums. "In other words, the retail PC version of the game won't require you to go online to authenticate the game for offline play. We have chosen not to use SecuROM in any version of Dragon Age that is distributed by EA or BioWare." --- quote ---
Regards
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dank@kegel.com
--- Comment #4 from Dan Kegel dank@kegel.com 2012-01-25 14:39:11 CST --- No, no, it just turns out to be helpful to insert disc 1 instead of disc 2 :-) Works here, too.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #5 from Cùran debian@carbon-project.org 2012-01-25 17:27:28 CST --- I can confirm, that applying the following patches solves the DVD authentication bug for DA:O Ultimate.
Patches applied: 1. Bug #26459: master/b94fabfb5bfe9a19af22b9e28f7b6176ab1de00a 2. Bug #29667: attachment 38540 (proposed patch) 3. this bug: attachment 38552 (proposed patch)
As noted in a private e-mail to Dan, the patch from attachment 38552 doesn't apply cleanly, the last hunk fails, but as this is a draft and easy to fix, that should not matter in the end.
For other Debian users hitting this bug: I'll upload new packages in a few hours.
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38552|0 |1 is obsolete| |
--- Comment #6 from Dan Kegel dank@kegel.com 2012-02-04 00:31:58 CST --- Created attachment 38688 --> http://bugs.winehq.org/attachment.cgi?id=38688 Updated draft patch
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #7 from Dan Kegel dank@kegel.com 2012-02-04 00:35:27 CST --- Created attachment 38689 --> http://bugs.winehq.org/attachment.cgi?id=38689 Sample program used to test patch
On my Asus laptop, the patch makes the test program happy except maybe for some length fields. On my i7 desktop, the test program causes my kernel to panic (!), see https://bugs.launchpad.net/bugs/924596, presumably either my sata controller or its driver are unhappy.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #8 from Cùran debian@carbon-project.org 2012-02-04 11:47:43 CST --- Created attachment 38698 --> http://bugs.winehq.org/attachment.cgi?id=38698 Slightly modified version of attachment 38688
(In reply to comment #6)
Created attachment 38688 Updated draft patch
I have two minor nitpicks: First I think you forgot to increment once and secondly it doesn't apply cleanly on top of 1.4 RC2 and attachment 38540. I've attached an updated version with this comment. Apart from that, it looks close to the previous version of this patch, which worked for me.
Wrt the panic: I'll test that as soon as possible (though it might take me some time). Do only burned discs cause this or is it also reproducible with a "pressed" one (ie. DVD-R vs. DVD-ROM)?
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #9 from Dan Kegel dank@kegel.com 2012-02-04 12:01:25 CST --- Thanks for the review. I've been attaching rollup patches that include the fix for the other bug, but I'll separate them before I submit.
I have only tested the panic with a pressed dvd so far.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #10 from Cùran debian@carbon-project.org 2012-02-04 12:11:07 CST --- (In reply to comment #9)
Thanks for the review. I've been attaching rollup patches that include the fix for the other bug, but I'll separate them before I submit.
Ah ok. Another nitpick would be, that the link in the added warning is missing a "https://" at the beginning (that would make the link clickable e.g. in KDE's Konsole application).
I have only tested the panic with a pressed dvd so far.
Ok, thanks. I'll see what I can do in the next days.
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38689|0 |1 is obsolete| | AssignedTo|wine-bugs@winehq.org |dank@kegel.com
--- Comment #11 from Dan Kegel dank@kegel.com 2012-02-05 00:27:40 CST --- Created attachment 38708 --> http://bugs.winehq.org/attachment.cgi?id=38708 Updated test program
Test program now checks what happens if user program uses structures of wrong size.
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38708|0 |1 is obsolete| |
--- Comment #12 from Dan Kegel dank@kegel.com 2012-02-06 14:47:30 CST --- Created attachment 38725 --> http://bugs.winehq.org/attachment.cgi?id=38725 Updated test program
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38688|0 |1 is obsolete| | Attachment #38698|0 |1 is obsolete| |
--- Comment #13 from Dan Kegel dank@kegel.com 2012-02-06 14:50:47 CST --- Created attachment 38726 --> http://bugs.winehq.org/attachment.cgi?id=38726 Cleaned up patch; needs testing on macosx
Here's an updated rollup patch for both this bug and bug 29667. It needs testing on macosx, not sure if it compiles there. (It should, but...)
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38726|0 |1 is obsolete| |
--- Comment #14 from Dan Kegel dank@kegel.com 2012-02-06 15:47:25 CST --- Created attachment 38727 --> http://bugs.winehq.org/attachment.cgi?id=38727 Updated draft patch, forces same Length as seen on Windows, fixes -Wall. Needs macosx testing.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #15 from Dan Kegel dank@kegel.com 2012-02-09 17:56:57 CST --- Patches sent, see http://www.winehq.org/pipermail/wine-patches/2012-February/111467.html et al
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38725|0 |1 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #38727|0 |1 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=29669
Saulius K. saulius2@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |saulius2@gmail.com
http://bugs.winehq.org/show_bug.cgi?id=29669
Charles Davis cdavis@mymail.mines.edu changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |cdavis@mymail.mines.edu
--- Comment #16 from Charles Davis cdavis@mymail.mines.edu 2012-02-10 15:54:08 CST --- (In reply to comment #14)
Created attachment 38727 [details] Updated draft patch, forces same Length as seen on Windows, fixes -Wall. Needs macosx testing.
Patch doesn't even compile :). When you got rid of the 'ret' variable in the Mac OS path, you didn't change the call to ioctl(2) not to use it.
After fixing that little detail, I found I couldn't run the test program as-is because Mac OS only gives read-only access (i.e. the device file has mode 0440) to read-only media. And after fixing *that*, the test program failed miserably--probably due to terrible mistakes I made when I first implemented this for Mac. For one thing, I forgot to memset(3) dvdrs to 0. (Those pesky reserved fields have to be zero or the driver will reject them outright! And I should know, because my own driver rejects DKIOCSCSICOMMAND if any of the reserved fields are nonzero!) After fixing NTDLL and my custom SCSI driver not to reject the massive sense buffer you handed them (kSenseInfoDefaultSize is only 18 bytes on Mac OS), I'm down to one failure, which turns out has to do with the OSReadBigInt32() calls I made in my original patch. With that fixed, the tests finally pass. I will send my changes soon.
Regarding the buffer sizes: I know that MMC-5 says that most of the buffers are supposed to be 2048 bytes; I'm not sure where the extra two bytes come from.
http://bugs.winehq.org/show_bug.cgi?id=29669
Bug 29669 depends on bug 29667, which changed state.
Bug 29667 Summary: Dragon Age: Origins DVD authenticity checks fail (DVD_LAYER_DESCRIPTOR big endian values need to be converted host endianness before being returned to caller) http://bugs.winehq.org/show_bug.cgi?id=29667
What |Old Value |New Value ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #17 from Dan Kegel dank@kegel.com 2012-02-16 23:01:00 CST --- The extra two bytes are, I think, the reserved field of DVD_DESCRIPTOR_HEADER.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #18 from Dan Kegel dank@kegel.com 2012-02-16 23:03:07 CST --- Created attachment 38919 --> http://bugs.winehq.org/attachment.cgi?id=38919 Minimal fix suitable for code freeze
Draft patches; these are stripped down to the minimum needed to fix just this bug. We can do more after release when code freeze is over. I'll send this in tomorrow, after Charles has a chance to test it on the mac.
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #19 from Dan Kegel dank@kegel.com 2012-02-16 23:21:40 CST --- Created attachment 38921 --> http://bugs.winehq.org/attachment.cgi?id=38921 dvd info hex dump program
Here's a little program that dumps the physical layer field and the manufacturer field in hex, from both normal and passthrough ioctl's. If the versions don't match, the bug is still there; if the hex is all zeroes, the disc doesn't have a nonzero manufacturer field and won't be a good test.
http://bugs.winehq.org/show_bug.cgi?id=29669
Dan Kegel dank@kegel.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |austinenglish@gmail.com
--- Comment #20 from Dan Kegel dank@kegel.com 2012-02-29 20:52:24 CST --- *** Bug 23184 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #21 from Cùran debian@carbon-project.org 2012-05-20 05:41:37 CDT --- The proposed patch (attachment 38919) works fine for DA:O UE, heavily field tested through my Wine packages (http://dev.carbon-project.org/debian/wine-unstable/).
Any chance this will become part of mainline soon? What is missing?
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #22 from Dan Kegel dank@kegel.com 2012-05-20 12:30:04 CDT --- I don't have time to work on it right now, sorry.
http://bugs.winehq.org/show_bug.cgi?id=29669
Alex cerebro.alexiel@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |cerebro.alexiel@gmail.com
--- Comment #23 from Alex cerebro.alexiel@gmail.com 2012-05-28 04:14:34 CDT --- During my analysis of bug #30632, I found that the problem was exactly the same as this one.
I'm not marking it as a duplicate of this one (yet) because it reminds me GetVolumeInformation calls SetLastError in some cases while succeeding.
I started writing a test case but found Dan already wrote one (http://www.winehq.org/pipermail/wine-patches/2012-February/111469.html).
@Dan Now we are not in code freeze anymore, can you resend your patches ? I would like to extend them.
http://bugs.winehq.org/show_bug.cgi?id=29669
Hendrik Knackstedt hendrik.knackstedt@t-online.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |hendrik.knackstedt@t-online | |.de
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #24 from Hendrik Knackstedt hendrik.knackstedt@t-online.de 2012-07-10 05:37:11 CDT --- Any updates on this?
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #25 from Alex cerebro.alexiel@gmail.com 2012-07-11 13:08:44 CDT --- I've sent a first attempt of my patches in early June ([01] [02] [03] and [04]). AJ, the project leader commented my first patch [05] I revised them and re-submitted my patches a week later ([06] [07] [08] [09] and [10]). I got another comment [11] and only resubmitted the wrong patch [12]. Since then, my patches were forgotten and AJ went on vacation [13]. Now, he's back so I will resubmit them.
-- [01] : http://www.winehq.org/pipermail/wine-patches/2012-June/114934.html [02] : http://www.winehq.org/pipermail/wine-patches/2012-June/114935.html [03] : http://www.winehq.org/pipermail/wine-patches/2012-June/114936.html [04] : http://www.winehq.org/pipermail/wine-patches/2012-June/114937.html [05] : http://www.winehq.org/pipermail/wine-devel/2012-June/095860.html [06] : http://www.winehq.org/pipermail/wine-patches/2012-June/115186.html [07] : http://www.winehq.org/pipermail/wine-patches/2012-June/115187.html [08] : http://www.winehq.org/pipermail/wine-patches/2012-June/115190.html [09] : http://www.winehq.org/pipermail/wine-patches/2012-June/115189.html [10] : http://www.winehq.org/pipermail/wine-patches/2012-June/115188.html [11] : http://www.winehq.org/pipermail/wine-devel/2012-June/095963.html [12] : http://www.winehq.org/pipermail/wine-patches/2012-June/115350.html [13] : http://www.winehq.org/pipermail/wine-devel/2012-June/096152.html
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #26 from Alex cerebro.alexiel@gmail.com 2012-07-14 04:17:24 CDT --- The add-a-test-for-it part of my patches have been committed ([1] [2] [3] and [4]).
The last one (which actually fix this bug) has been marked as "Build failure" but builds/works for me so I'm waiting an answer of AJ (see [5]).
I hope I could fix it by next Monday i.e. wine-1.5.9. --- [1] : http://source.winehq.org/git/wine.git/commitdiff/9536e66d61ac3ac9185b6da518f... [2] : http://source.winehq.org/git/wine.git/commitdiff/7c27a969973d2b54215be7906bf... [3] : http://source.winehq.org/git/wine.git/commitdiff/a3b5dd2dff0d04fe317f00282cc... [4] : http://source.winehq.org/git/wine.git/commitdiff/9fce6a37ecb2a09e14bd3d38413... [5] : http://www.winehq.org/pipermail/wine-devel/2012-July/096283.html
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #27 from Dan Kegel dank@kegel.com 2012-07-14 07:45:55 CDT --- *** Bug 30632 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=29669
--- Comment #28 from Alex cerebro.alexiel@gmail.com 2012-07-17 13:02:34 CDT --- Yeehaa !! Patch committed : http://source.winehq.org/git/wine.git/commitdiff/5feea8ce1a90e651a12ce6a10bc...
http://bugs.winehq.org/show_bug.cgi?id=29669
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |5feea8ce1a90e651a12ce6a10bc | |a538907deab97 Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #29 from Austin English austinenglish@gmail.com 2012-07-17 13:09:46 CDT --- (In reply to comment #28)
Yeehaa !! Patch committed : http://source.winehq.org/git/wine.git/commitdiff/5feea8ce1a90e651a12ce6a10bc...
Fixed.
http://bugs.winehq.org/show_bug.cgi?id=29669
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #30 from Alexandre Julliard julliard@winehq.org 2012-07-17 13:52:33 CDT --- Closing bugs fixed in 1.5.9.
http://bugs.winehq.org/show_bug.cgi?id=29669
Robert Wm Ruedisueli ruediix@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ruediix@gmail.com
--- Comment #31 from Robert Wm Ruedisueli ruediix@gmail.com --- I an confirm this is also fixed for The Sims 3 as well, which also uses EA DiskCheck copy protection.
https://bugs.winehq.org/show_bug.cgi?id=29669
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |thomas.mertes@gmx.at
--- Comment #32 from Anastasius Focht focht@gmx.net --- *** Bug 31797 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=29669
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|dank@kegel.com |wine-bugs@winehq.org