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. |
![]() |
#1 | Link | ||
Registered User
Join Date: Jun 2005
Posts: 260
|
Get Blu-ray VID and RDK from MakeMKV
The last known public Host Certificate (HC) needed for Blu-ray playback has been revoked in MKBv72. As the amount of discs with a newer MKB version increases, more and more people will find themselves in the situation where their drives have permanently revoked this HC. When relying on libaacs for playback (e.g. VLC), this causes problems for new and old (!) discs as the HC is needed to retrieve the VID (aacs decryption) and the RDK (bus encryption) unless keys are cached or available in KEYDB.cfg.
Even though VID is always needed in theory to retrieve VUK/UK, in practice this is not a problem because these keys can be found using FindVUK or by downloading FindVUK's KEYDB.cfg containing a large database of keys. However RDK is unique for every drive and cannot be shared in the same way. The RDK affects a minority of BD discs but 100% of UHD discs. libaacs 0.11.0 supports cached RDK keys allowing playback of bus encrypted discs without a valid HC. However, to have this RDK in the libaacs cache, the disc had to be played before the certificate was revoked. Just like FindVUK can get VUK/UK from DVDFab, it's possible to get VID/RDK from other players or rippers that contain an unrevoked HC. This guide shows you how to get these keys from MakeMKV. This is based purely on public information released by MakeMKV but it is nonobvious. Please support MakeMKV for the work that they do. Update: Following programs automate the steps below
The following steps are performed on Windows but they are similar for Linux & Mac Step 1. Install MakeMKV Choose a version that has an unrevoked HC. As of this moment, this is v1.15.1 or later Quote:
Step 2. Get a list of drives Open a command window and run Code:
"C:\Program Files (x86)\MakeMKV\makemkvcon.exe" f --list Code:
Found 2 drives(s) 00: \Device\CdRom0, \Device\CdRom0, F: HL-DT-ST_BDDVDRW_GGC-H20L_1.03_20080515123456_XXXX 01: \Device\CdRom1, \Device\CdRom1, G: ASUS_BW-16D1HT_3.00_211511031110_YYYY Step 3. Disable LibreDrive On supported drives, LibreDrive disables bus encryption and prevents MakeMKV from revealing the RDK. Luckily, it can be disabled Quote:
Code:
set SDF_STOP=ASUS_BW-16D1HT_3.00_211511031110_YYYY Step 4. Create an encrypted backup In the command window (same one where step 3. is performed) run Code:
"C:\Program Files (x86)\MakeMKV\makemkvcon" backup disc:1 "c:\temp\getrdk" note: - disc:1 is the drivenumber from step 2 - "c:\temp\getrdk" is a directory of your choice Code:
MakeMKV v1.15.1 win(x86-release) started Debug logging enabled, log will be saved as C:\Users\*/MakeMKV_log.txt The new version 1.17.1 is available for download at http://www.makemkv.com/download/ Backing up disc into folder "c:\temp\getrdk" Loaded content hash table, will verify integrity of M2TS files. Step 5. Extract Drive Certificate (DC), VID and RDK The DC, VID and RDK are present in discatt.dat. The file format is described in the MakeMKV source code that is (partially) publicly available Code:
MakeMKV linux build & source file makemkv-oss-1.17.1\libdriveio\inc\driveio\driveio.h states - dicat_DriveStandard=1, - dicat_DiscSpecific=4, - diid_DriveCert=(dicat_DriveStandard<<24)+(3<<16)+0x38, - diid_Aacs_VID=(dicat_DiscSpecific<<24)+(0<<16)+0x80, - diid_Aacs_DataKeys=(dicat_DiscSpecific<<24)+(0<<16)+0x84, i.e. the following byte sequences should be present in discatt.dat - 01 03 00 38 00 00 00 5C [92 bytes = DC] - 04 00 00 80 00 00 00 10 [16 bytes = VID] - 04 00 00 84 00 00 00 20 [16 bytes = RDK] Code:
sfk hexdump -raw c:\temp\getrdk\discatt.dat +xex "/010300380000005C[184 bytes]/[part2]/" +hextobin c:\temp\getrdk\dc.bin sfk hexdump -raw c:\temp\getrdk\discatt.dat +xex "/0400008000000010[32 bytes]/[part2]/" -tofile c:\temp\getrdk\vid.txt sfk hexdump -raw c:\temp\getrdk\discatt.dat +xex "/0400008400000020[32 bytes]/[part2]/" -tofile c:\temp\getrdk\rdk.txt Code:
sfk hexdump -raw c:\temp\getrdk\dc.bin type c:\temp\getrdk\vid.txt type c:\temp\getrdk\rdk.txt Code:
DC = 0101005C... VID = 65869168F2AF4D69EDB79754B515A8AC RDK = 96175870A5A27DEE528975C3BF6756F9 - RDK is only available if the drive supports bus encryption - if the drive supports bus encryption, RDK is also present for discs without bus encryption even though RDK is not needed for playback - do not post your DC on the forum. Theoretically (but unlikely) it can be revoked Step 6. Save VID and RDK in libaacs cache The cache files are located in a subdir of the aacs dir with the KEYDB.cfg file - RDK: ..\aacs\rdk\[driveid]\[discid] - VID: ..\aacs\vid\[discid] where - driveid = SHA1 hash of DC which is different for all your drives - discid = SHA1 hash of the file AACS\Unit_Key_RO.inf on your Blu-ray disc Use a tool like 7-Zip to calculate these hashes Code:
driveid: "C:\Program Files\7-Zip\7z" h -scrcSHA1 c:\temp\getrdk\dc.bin discid: "C:\Program Files\7-Zip\7z" h -scrcSHA1 G:\AACS\Unit_Key_RO.inf note: - G: is driveletter from step 2 Code:
driveid: SHA1 for data: F4530616E23597A2368757EAFCFC8685C1EC38D1 discid: SHA1 for data: B01C8C10CEA251CE65508498993E36D3FD1A7B72 Note that you can also find these hashes by creating a libaacs log using VLC or aacs_info.exe included with libaacs Code:
set AACS_DEBUG_MASK=65535 set AACS_DEBUG_FILE=debuglog.txt aacs_info G: Code:
src/file/file_win32.c:131: Opened WIN32 file C:\Users\*\AppData\Roaming\aacs\rdk\f4530616e23597a2368757eafcfc8685c1ec38d1\b01c8c10cea251ce65508498993e36d3fd1a7b72 (00000000008b7cc0) Code:
Bus encryption: Device support: yes Enabled in media: yes Step 7. Repeat for other drives The RDK for the disc is unique for every drive so repeat the steps for all your drives that support bus encryption Warning: in case the firmware of a drive is updated, the RDK for all discs possible changes FAQ - VID can also be put in the KEYDB.cfg file instead of the local cache - VID in combination with MK can be used to calculate VUK/UK. Device Keys for MK retrieval are public for up to MKBv71. Besides libaacs also aacskeys supports input of VID instead of using a HC - it seems libaacs has some bugs in aacs keys calculation flow. Put both VID and MK in keydb.cfg to get the VUK in the ..\aacs\vuk\[discid] file - RDK unlike the other keys are disc+drive specific. There is NO POINT in sharing these keys as they will not work for anyone else - If MakeMKV is allowed to enable LibreDrive a power off is need to reset your drive and allow VLC to play bus encrypted discs - MakeMKV used to include the tool cddump.exe to generate the discatt.dat but it has been removed. It's unknown if there is a similar makemkvcon command to generate the file without starting a disc backup Last edited by candela; 24th January 2023 at 23:59. |
||
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Nov 2013
Location: Hannover, Germany
Posts: 321
|
Thanks for these detailed instructions. But it is mainly for VLC users, right ?
__________________
MPC-BE feature wishlist: 1) DiscID 2) Two independent volume control sliders in the UI when using directsound dual-audio-out. |
![]() |
![]() |
![]() |
#4 | Link |
Registered User
Join Date: Nov 2013
Location: Hannover, Germany
Posts: 321
|
O.K. I have got RDK and VID for one disc now but I am unfortunately stuck at step 6. Sorry, but I am confused - what should I do there ? Tools ? Also can't find this inf-file on my system.
__________________
MPC-BE feature wishlist: 1) DiscID 2) Two independent volume control sliders in the UI when using directsound dual-audio-out. |
![]() |
![]() |
![]() |
#5 | Link | |
Registered User
Join Date: Jun 2005
Posts: 260
|
Quote:
Check if it's more clear now Last edited by candela; 19th September 2022 at 20:39. |
|
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: Nov 2013
Location: Hannover, Germany
Posts: 321
|
Yes, much clearer now. Thanks !! But it is a somewhat tedious process so I hope that someone might write an app for it.
(By the way, Xreveal reports Discid and other infos that might be interesting.)
__________________
MPC-BE feature wishlist: 1) DiscID 2) Two independent volume control sliders in the UI when using directsound dual-audio-out. |
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Dec 2013
Posts: 517
|
Here it is: RDKfromMMKV 0.01
![]() Feedback is welcome ![]() I'm not sure if my way to detect if MakeMKV is installed is reliable - so please tell me your results ![]() |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Nov 2013
Location: Hannover, Germany
Posts: 321
|
I have tested the app with one Blu-Ray and one UHD and it worked, as far as I can see, perfectly !!! Thank you very much guys - you are awesome
![]() Follow up. Great results - now I am finally able to watch the extras on some discs also in MPC-BE instead of VLC.
__________________
MPC-BE feature wishlist: 1) DiscID 2) Two independent volume control sliders in the UI when using directsound dual-audio-out. Last edited by Grimsdyke; 25th September 2022 at 19:12. Reason: Add infos |
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: Jun 2005
Posts: 260
|
RDKfromMMKV doesn't work if the \rdk directory doesnt already exist
Code:
ERROR! Couldn't create directory >C:\Users\*\AppData\Roaming\aacs\rdk\3ee0a0fb6732df820f82e831e2f0319cf38b4933\< ERROR! Creating the RDK cache file failed! |
![]() |
![]() |
![]() |
#11 | Link |
Registered User
Join Date: Nov 2013
Location: Hannover, Germany
Posts: 321
|
Without rdk the opening of the extras on that discs fails again - so I would say it is needed ! Best wishes
__________________
MPC-BE feature wishlist: 1) DiscID 2) Two independent volume control sliders in the UI when using directsound dual-audio-out. |
![]() |
![]() |
![]() |
#12 | Link | ||
Registered User
Join Date: Dec 2013
Posts: 517
|
Quote:
Quote:
Didn't test it myself - so please report if I did something wrong. |
||
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: Jun 2005
Posts: 260
|
Quote:
|
|
![]() |
![]() |
![]() |
#15 | Link | |
Registered User
Join Date: Dec 2013
Posts: 517
|
Improved a few things:
Quote: Quote:
Didn't test it myself - so please report if I did something wrong. |
|
![]() |
![]() |
![]() |
#16 | Link | |
Registered User
Join Date: Dec 2010
Posts: 66
|
Quote:
RDKfromMMKV cannot detect makemkv if you did not run it at least once, and fails. Edit: after this, a different error occurred here the log (error creating dir?) Last edited by Losko; 18th October 2022 at 15:53. |
|
![]() |
![]() |
![]() |
#18 | Link |
Registered User
Join Date: Nov 2022
Posts: 2
|
Hello. Wanted to say thanks to candela for this tutorial. I was able to get VLC to play a blu-ray that otherwise gave me a key revocation error using this method. Much appreciated.
I also wrote a bash script to automate this process on Linux. Just run 'gen-rdk.sh -d <dev>' (it defaults to /dev/sr0 if you omit -d) and it'll extract everything for you to ~/.config/aacs/. So far this has only been tested on my Gentoo system w/ a small handful of blu-rays, but seems pretty solid. The part where it's most likely to break is probably when it forks makemkvcon into the background and waits for it to rip discatt.dat; I've had makemkvcon hang up trying to read the disc at that point, resulting in the script itself seeming to hang. You'll need to kill the script (ctrl+c), kill makemkvcon, and likely need to eject or possibly power cycle the drive to get makemkv to read the disc at that point. Otherwise, it should complete quite quickly. Here's an example of it running: Code:
$ gen-rdk.sh -d /dev/sr1 Properties: Device = /dev/sr1 Label = ASUS_BW-16D1HT_3.02_211711241413_SIK9QFCOB301 Disc num = 1 Temp dir = /tmp/genrdk-LXxkg Begin discatt.dat extraction... MakeMKV v1.17.2 linux(x64-release) started Debug logging enabled, log will be saved as file:///home/user/MakeMKV_log.txt DEBUG: Code 0 at /$zy3A30Z$ocw#7oPfmD-~:29393631 DEBUG: Code 0 at 0S=e}4X.);~#gZ:M:29395540 Backing up disc into folder "file:///tmp/genrdk-LXxkg" Loaded content hash table, will verify integrity of M2TS files. Mount blu-ray disc... Extract RDK and VID... VID = 'XXXXX' RDK = 'XXXXX' Dev ID = 'XXXXX' Disc ID = 'XXXXX' Write RDK and VID... Unmounting blu-ray disc and deleting temp files... Unmounted /dev/sr1. https://www.legroom.net/files/software/gen-rdk.sh |
![]() |
![]() |
![]() |
#19 | Link | |
Registered User
Join Date: Dec 2013
Posts: 517
|
Quote:
I've fixed it, please download 0.05: RDKfromMMKV_0.05.zip This time I've tried it myself and it's working. But I didn't change the detection if MakeMKV has never been started before - please simply start it once ![]() Last edited by nalor; 25th January 2023 at 11:52. |
|
![]() |
![]() |
![]() |
#20 | Link |
Registered User
Join Date: Apr 2020
Posts: 14
|
What am I doing wrong? What is this busencryption?
Code:
----------------------------------------------------------- 10:26:39 - ----------- RDKfromMMKV 0.05 ----------- ----------------------------------------------------------- 10:26:39 - Specified drive: e 10:26:39 - Drive >E< is BusEncryptionCapable 10:26:39 - ERROR! Disc in drive >E< is NOT BusEncryptionEnabled! 10:26:39 - BusEncryption is not active (drive is not BEC or disc is NOT BEE) - only VolumeID cache file will be created 10:26:39 - MakeMKV is installed :) 10:26:39 - MakeMKV has no license key - please visit >https://forum.makemkv.com/forum/viewtopic.php?t=1053< to get the current key 10:26:39 - MakeMKVcon path: C:\Program Files (x86)\MakeMKV\MakeMKVcon.exe 10:26:39 - Drivenumber is >0< 10:26:46 - discatt.dat appeared - kill MakeMKVcon now 10:26:46 - Target file >C:\Users\renan\AppData\Local\Temp\RDKfromMMKV_20230729_102639\discatt.dat< 10:26:46 - DriveId >6B9F58D60858AD3161D22EE693BA11D8AA6E35F0< 10:26:46 - VolumeId >31825E0CA73FC8697C37566BB0EA570C< 10:26:46 - DiscId >72E1395B5F4C18110140A7940D108D0785CEC94D< 10:26:46 - KeyDB path >C:\Users\renan\AppData\Roaming\aacs\keydb.cfg< 10:26:46 - VID cache will be created >C:\Users\renan\AppData\Roaming\aacs\vid\72e1395b5f4c18110140a7940d108d0785cec94d< 10:26:46 - Created the VID cache file! Press ENTER to exit Code:
C:\Users\renan>"C:\Program Files (x86)\MakeMKV\makemkvcon.exe" f --list Found 1 drives(s) 00: \Device\CdRom0, \Device\CdRom0, E: ASUS_SBW-06D2X-U_1.10_QLDL071227WL Last edited by demomode; 29th July 2023 at 15:40. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|