Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Decrypting

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th September 2016, 14:51   #1  |  Link
ehehon
Registered User
 
Join Date: Aug 2016
Posts: 4
Open source and BD+

Hi, I'd like to ask what is the state-of-the-art for open source BluRay playback?

I just want to buy BluRays from the shop and watch them on my projector. I now have a custom build of mplayer (on Linux) that uses libbluray, libaacs and libbdplus from Git.

My understanding is that I can play all discs up to BD+ generation 3, but no more, and as long as somebody has already extracted the VUK using closed software.

Does the open source code just require development, or further reverse engineering or even cracking of encryption? And even then, could it play all disks?

The first disc I bought (The Girl With The Dragon Tatoo) worked successfully, and so duly purchased another thinking it was solved. However my second disc (A box set, actually; The Alien Anthology) won't play:

Code:
loader.c:81: [bdplus] WARNING: BD+ generation 9 not tested / supported
and corrupt data seems to get passed to the codec ever few seconds.

Can others watch/rip these BluRay discs with closed software? Seems somebody must be doing something with the VUKs that I find online, and I can see rips of these movies have been made. I'm a competent developer (albeit with not much time); is there a useful contribution to libbdplus I could make, or should I just throw in the towel and go back to DVDs?

Thanks
ehehon is offline   Reply With Quote
Old 7th September 2016, 15:31   #2  |  Link
dizzier
Registered User
 
Join Date: Jan 2010
Posts: 74
You can play all current Blu-Ray discs, that do not use BD+ (most of my discs, even new ones, don't have BD+ at all, but that depends what you buy), if you can find VUK for them. You can easily extract VUK from DVDFab, using FindVUK tool from this forum.

If you want to contribute to libdbplus, then do so. But there is no TODO or any list of things missing. If we knew what is missing then it would be implemented long time ago. You must reverse engineer commercial Blu-Ray player and try to implement whatever is not implemented yet. But note that this is extremely complex task as the code is heavily obfuscated, later BD+ versions talk with obfuscated Java code and even later BD+ generations simply force software players to load native .dll files from the discs, you'd need to reverse engineer that too.

In practical terms, the easiest solution is to use commercial MakeMKV to create unencrypted disc image and play those. MakeMKV works fine on Linux. It can even emulate libaacs/libbdplus to enable VLC play discs without having to dump them first, but I haven't tried that.
dizzier is offline   Reply With Quote
Old 7th September 2016, 22:02   #3  |  Link
ehehon
Registered User
 
Join Date: Aug 2016
Posts: 4
Thanks, that's the useful information I was looking for.

MakeMKV does claim to have better BD+ decoding, though it was still not able to handle the Alien discs. I got the same glitches (but the bdplus warning now eliminated) from the backup.

So whilst it seems to have a better go, it does leave me in exactly the same position.

From what I can see, MakeMKV distributes additional 'SVQ' files used to generate 'FUTs' (fix-up-tables); I get the impression this is state information that could even come not from BD+ decoding but from intercepting an official player?

It does seem like my hopes of an open source decoder are rather unlikely :-(

It sounds like it's going to be infeasible for me to contribute, as I'd need to get up to speed with everything that's gone before.

Code:
MakeMKV v1.10.1 linux(x64-release) started
Backing up disc into folder "/home/ehehon/Videos/backup/ALIENS_WW"
Evaluation version, 30 day(s) out of 30 remaining
Error 'Scsi error - ILLEGAL REQUEST:COPY PROTECTION KEY EXCHANGE FAILURE - KEY NOT ESTABLISHED' occurred while issuing SCSI command AD010..080002400 to device 'SG:dev_11:1'
...
Can't read AACS VID from disc - most likely current AACS host certificate is revoked by your drive
Highest AACS version is v19 , MKB saved as /home/mark/.MakeMKV/MKB_v19_ALIENS_WW.tgz
The volume Id is unknown for this disc - BD+ code will likely fail
Automatic SVQ downloading is disabled or failed.
Loaded 424 SVQ file(s)
Processing BD+ code, please be patient - this may take up to few minutes
Processing BD+ code using generic SVQ from builtin/00000.svq
Saved BD+ dump file as /home/ehehon/.MakeMKV/dump_ALIENS_WW_E6363BCA5681E2B0.tgz
Loaded content hash table, will verify integrity of M2TS files.

Last edited by ehehon; 7th September 2016 at 22:08. Reason: Added log
ehehon is offline   Reply With Quote
Old 8th September 2016, 00:25   #4  |  Link
dizzier
Registered User
 
Join Date: Jan 2010
Posts: 74
Quote:
Originally Posted by ehehon View Post
MakeMKV does claim to have better BD+ decoding, though it was still not able to handle the Alien discs. I got the same glitches (but the bdplus warning now eliminated) from the backup.
That is strange. Aliens Anthology is very old, back from 2010. In fact, I own it too and it was working and still works just fine with MakeMKV (and MakeMKV can even easily decrypt really recent BD+ discs, like Deadpool).
The error you pasted indicates that the basic AACS failed, even before BD+ comes to play, but since BD+ requires output from AACS, it cannot proceed. Maybe your disc or drive is defective? Try with different disc from the Anthology or with different drive.

Quote:
Originally Posted by ehehon View Post
From what I can see, MakeMKV distributes additional 'SVQ' files used to generate 'FUTs' (fix-up-tables); I get the impression this is state information that could even come not from BD+ decoding but from intercepting an official player?
Not sure what you mean. Obviously available rippers use decryption keys extracted from official players. AACS/BD+ encryption was not broken as such, that would mean breaking ECDSA and AES (unless some flaw in the overall architecture was found, or stupid error like when Sony used constant for 'k' in ECDSA). SVQ files are MakeMKV specific, while they allow decryption of BD+ it is unclear what they contain and if they can be used by anything beside MakeMKV.
dizzier is offline   Reply With Quote
Old 8th September 2016, 17:32   #5  |  Link
ehehon
Registered User
 
Join Date: Aug 2016
Posts: 4
Quote:
Originally Posted by dizzier View Post
The error you pasted indicates that the basic AACS failed, even before BD+ comes to play, but since BD+ requires output from AACS, it cannot proceed. Maybe your disc or drive is defective? Try with different disc from the Anthology or with different drive.
I get the same with other discs in the Anthology. The drive itself is the only one I have access to, and it's a cheap USB thing from eBay; so I wouldn't put it past having problems, but it's been well behaved with non BD+ so far.

Now correct me if I'm wrong, I understood the drive itself to be involved with decryption normally, but by having a VUK ourselves (in keysdb.cfg) is allowing us to bypass that and do it all on the host.

And it seems to be the case; if I don't have a keysdb.cfg file in place, then MakeMKV gets to that "Can't read AACS VID" and stops. But once I added keysdb.cfg it carried on to the BD+ stuff.

So I'm inclined to read the log at face value:

Code:
The volume Id is unknown for this disc - BD+ code will likely fail
In your case is it able to read the "volume Id" from the disc itself because you have a bona-fide BluRay drive? And therefore it has this piece of information to run the BD+ part.

Whereas I have some eBay heap of crap, I can't run any actual hardware encryption code to get the missing "volume Id" (though I assumed that to be in the keysdb.cfg file)

And for some discs, even if I didn't have the "volume ID", MakeMVK has these extra SVQ files to potentially skip that step entirely.

I wonder if that sounds about right?

(not that any of this helps with decoding using open source -- a shame to conclude that but thanks for all your help)
ehehon is offline   Reply With Quote
Old 8th September 2016, 20:11   #6  |  Link
dizzier
Registered User
 
Join Date: Jan 2010
Posts: 74
Ok, from what it seems you have a Blu-Ray drive that cannot do proper AACS authentication. This process is needed to acquire so called VID.

Now, with open source software and libaacs, you can put VID+Media Key or VUK (VUK is derived from VID+Media Key) in keydb.cfg and have the disc played. However, open source cannot handle BD+.

MakeMKV can handle BD+, however I believe that it does not use keydb.cfg but tries to behave like a real player and do AACS authentication using keys from reverse engineered player. Since your drive cannot do this, it fails.

I'm afraid there is little that can be done here, just buy a recent Blu-Ray drive, then you would be able to decrypt discs using MakeMKV and then play them using opens source. Try to borrow a drive from a friend, to make sure that all of this is true
dizzier is offline   Reply With Quote
Old 8th September 2016, 21:47   #7  |  Link
candela
Registered User
 
Join Date: Jun 2005
Posts: 259
It seems MakeMKV falls back on KEYDB.cfg if it cannot extract the keys from the drive

Since apparently VolumeID is needed for BD+ processing, it makes me wonder if FindVUK should also extract the VolumeID from DVDFab and put it in KEYDB.cfg together with the VUK or MediaKey. This not only benefits MakeMKV but also any possible future open source implementation of BD+ preventing the requirement to have a working host certificate

If we look at a FindVUK memory dump, the keys always appear at fixed offsets compared to the used AACS folder

AACS folder (e.g. F:/AACS if the drive is F) = 0x0000 (base address)
DiscID [20 bytes] = 0x0114 (offset from AACS folder)
VolumeID [16 bytes] = 0x0018 (offset from DiscID) = 0x012C (offset from AACS folder)
MediaKey [16 bytes] = 0x0037 (offset from VolumeID) = 0x0163 (offset from AACS folder)
VUK [16 bytes] = 0x0010 (offset from MediaKey) = 0x0173 (offset from AACS folder)

@ehehon, try extracting the VolumeID from a FindVUk dump and put in in the KEYDB.cfg together with the VUK. Then check if MakeMKV works properly. The KEYDB.cfg spec is here

It should work like this <DiscID> = title | V | <VUK> | I | <Volume ID> ; comment

Last edited by candela; 9th September 2016 at 18:22.
candela is offline   Reply With Quote
Old 9th September 2016, 09:22   #8  |  Link
dizzier
Registered User
 
Join Date: Jan 2010
Posts: 74
Media Key is also being used by BD+, but MakeMKV shouldn't have problems with that though.
dizzier is offline   Reply With Quote
Old 9th September 2016, 16:17   #9  |  Link
ehehon
Registered User
 
Join Date: Aug 2016
Posts: 4
Thanks a lot. Yes it does seem prudent to capture all the available information into the KEYSDB.cfg entry.

Quote:
Originally Posted by candela View Post
@ehehon, try extracting the VolumeID from a FindVUk dump and put in in the KEYDB.cfg together with the VUK. Then check if MakeMKV works properly.
Though I'd like to help, I'm not sure I'm equipped to do this; looks like I'd need Windows, the other software and an improved BluRay drive with the valid certificates etc.?

Also, just for info, my Alien Anthology is dated 2012 and perhaps different to the 2010 release.

Thanks
ehehon is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:07.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.