View Full Version : DecryptHD - Realtime decryption and streaming


Zotty
3rd June 2007, 19:31
Time to introduce a new tool called DecryptHD. While most other tools focus on 'backing up' an entire HD DVD, this one can be used for realtime decryption while streaming the decrypted movie to the player. It uses drive authentication to obtain the volume ID from it. This means it doesn't use a key database, but you do need a real drive. Without a real drive there's probably no point in realtime decryption anyway. Not wanting to watch all files on disc starting from A to Z, this also means it works on a per file basis. You have to specify the file you want to watch.

Atm this tool is Linux only for the simple reason that it's my normal desktop and development environment (Debian). So it's kinda obvious the targeted player is mplayer because of this. This is also where the streaming comes into the picture. The ffvc1 decoder not only works for normal playback from harddisk, but also supports streaming.

The current status of the tool is that it works and runs stable. But I've only tested it with the Bourne Supremacy, but I'm hoping that it should with all HD DVDs released to date. Mind the "hoping" though since a 1 disc test is not a 100% guarantee. See this as a testrun. It's written in C++ and if there's demand I'll release the source once the rough edges are gone. Also need to improve the subset-difference stuff first, it's kinda sucky the way it's implemented right now. Also both currently discovered processing keys are in it (let's get this into the open right away). The advantage of this is that there's no fiddling with keys, but the downside is that when keys get revoked/discovered, this will require an update of the app. Maybe I'll make a different solution at a later time, who knows.
If you run into trouble (so many things can go wrong), there's a log created called decrypthd.log in the same directory the tool is in. Please include it in any bug reports.

Right, enough talk, how does the damn thing work?

As you might have guessed it's console based (maybe a GUI in the future). It uses the following syntax:

decrypthd <device> <mountpoint> <filename> -o | <player>

This should sound familiar to most Linux users; First you need to plug in your drive if you haven't done so already (DUH!). I'v been using a Xbox360 HD DVD drive. Unmodified, just as you buy it in a store. Once plugged in you'll need to find it's device. Usually this is /dev/sr0 (it's alias is /dev/scd0). This is the <device> value and you need this for the drive authentication. Next mount the drive (the <mountpoint>). In short now you're good to go.
In reality however, you need to know the filename of the evo you want to watch. On the disc I've got here this is FEATURE_1.EVO (case sensitive). So look this up in the HVDVD_TS directory.
It uses OpenSSL for the signature calculations, so make sure you've got that.

Now fire the entire thing up (I'm assuming you've got the latest mplayer). You need to specify the demuxer and decoder:

decrypthd /dev/scd0 /mnt/hddvd/ FEATURE_1.EVO -o | mplayer -demuxer mpegps -vc ffvc1 -

Grab some popcorn and enjoy.

On a sidenote it's also possible to replace the -o and pipe stuff by a directory. In that case it doesn't stream to mplayer, but just outputs the decrypted content to that directory.

PS, a huge thanks to arnezami for figuring out the ECDSA stuff (and the rest ;)). Interresting stuff to dive into, but not at this time. And thanks to all others who have contributed to the information available here.

PS 2, in theory this approach should also work with a windows version of mplayer. This would require tweaking the code so it compiles under Windows, but it offers the possibility of banning that crappy PowerDVD :devil:

----------------------------- LATEST VERSION -----------------------

Links:
sourcecode at www.decrypthd.org/ (http://www.decrypthd.org/)
binaries (http://rapidshare.com/files/82329549/libaacs_v0.5_bin.tar.bz2.html)

Changelog
v0.5 - 2008/01/08
- Fixed bug where Title Key 0 resulted in an invalid key exception
- Split into libaacs and seperate tools
- Fixed memoryleaks
- Processingkeys are internal again
- Added CMake build system

v0.4 - 2007/11/28
- Added ACA file decryption
- Added XPL file decryption
- Rewrote logging code
- Improved error handling
- Improved utility usability
- Improved filesystem code
- HDDVDFS now detects files independant of case
- Renamed classes to better reflect their purpose
- External certificate/keys are used to overrule the internal ones
- Minor bug/leak fixes throughout the code

v0.3.1 - 2007/11/15
- Fixed bug that prevented Xbox 360 drive from authenticating
- Reduced memory I/O
- Minor fixes in HD DVD drive handling code

v0.3 - 2007/11/15
- Made drive, harddisk and HDDVDFS version (huge thanks to pensivepuppy)
- Keys/certificates/etc are replacable
- Rewritten stream decryption code
- Bug fixes
- Probably more which I don't remember

v0.2 - 2007/7/11
- Simultanious save to file while watching (use <output dir> -o)
- CMAC AES (for Volume ID verification)
- Code cleanup
- Resets AGIDs so it's no longer needed to manually reset the drive

v0.1 - 2007/6/3
- Initial release

arnezami
3rd June 2007, 19:52
Sounds really cool. :)

Completely open source huh. Wow.

arnezami

Zotty
3rd June 2007, 20:31
Completely open source huh. Wow.
Yup, that's the idea.

Btw, a few things I just realised. I have no clue what the current state of audioplayback for VC-1 video is. Been running it on my server which has no audio. Maybe the peepz at MplayerHQ are still working on this?
Another thing is that this doesn't need an expensive video card! It's running rather smooth on a build into the chipset thingy (Intel G965).

Rufus210
3rd June 2007, 21:02
Btw, a few things I just realised. I have no clue what the current state of audioplayback for VC-1 video is. Been running it on my server which has no audio. Maybe the peepz at MplayerHQ are still working on this?
Another thing is that this doesn't need an expensive video card! It's running rather smooth on a build into the chipset thingy (Intel G965).
The none of the new audio formats (DTS-HD, E-AC3/DD+ and TrueHD) are supported yet. DTS-HD is nice in that it's a backwards compatible format, meaning the ffmpeg DTS decoder will get a DTS stream, but not the advantage of the better quality HD stream. The only way to currently play the others at all is to use windows codecs. There's a tool (http://forum.doom9.org/showthread.php?t=125966) for converting them to AC3, but it requires the windows codecs. Someone might be able to get the mplayer binary codec loader to load the audio codecs, but AFAIK the binary loader has only been used for video codecs so far. There is hope though, there's an ffmpeg summer of code ( http://code.google.com/soc/ffmpeg/appinfo.html?csaid=988946629C3C7BE9) project for E-AC3, but no TrueHD project yet (that I know of).

It would be nice if you could integrate this into mplayer directly. Something like `mplayer hddvd://' and it handles the decryption, reads the playlist, and starts playing tracks. Ideally it could even be made into a library, libaacs or something. That way any program (ffmpeg, mplayer, xine, etc) could just ask the library "open this disk" and "open this file" and the library does all the needed decryption. Kinda like libdvdcss.

It's always nice to see open-source linux work going on. Be sure to post this to mplayer's user list, and the -dev list if you're interested in integrating it into mplayer. Just be warned that mplayer devs are quite against C++, but that shouldn't be too big of a deal.

Adub
4th June 2007, 14:10
This is a really cool idea, Zotty. Thank you very much. I have already archived a copy of the code, just in case.

qubic
4th June 2007, 19:54
Hi Zotty

I get these errors:

[root@dhcppc0 ~]# /data/decrypthd /dev/scd0 /mnt/hddvd/ /mnt/hddvd/HVDVD_TS/THECAST.EVO -o
/data/decrypthd: /usr/lib/libcrypto.so.0.9.8: no version information available (required by /data/decrypthd)
/data/decrypthd: relocation error: /data/decrypthd: symbol EC_KEY_new, version OPENSSL_0.9.8 not defined in file libcrypto.so.0.9.8 with link time reference
[root@dhcppc0 ~]# /data/decrypthd /dev/scd0 /mnt/hddvd/ /mnt/hddvd/HVDVD_TS/THECAST.EVO -o
/data/decrypthd: /usr/lib/libcrypto.so.0.9.8: no version information available (required by /data/decrypthd)
ioctl failed: -1 errno 5 stat 0
Error fetching AGID, aborting. -1
[root@dhcppc0 ~]#


regards qub

xyz987
4th June 2007, 20:22
Great!

:thanks:

And yes, there is demand for source code ;-)

Sirber
4th June 2007, 20:42
@qubic

you are missing libcrypto ;)

jackelmatador
4th June 2007, 23:48
Zotty this is awesome! I was wondering if I should bother with my Xbox 360 drive as ripping and playing was sort of a pain, but now....I will try this tonight with planet earth and king kong and let you know how well it works!

Galileo2000
5th June 2007, 01:00
PS 2, in theory this approach should also work with a windows version of mplayer. This would require tweaking the code so it compiles under Windows, but it offers the possibility of banning that crappy PowerDVD


Zotty, we need a Windoz version :D

HyperHacker
5th June 2007, 07:49
Very nice. Could it be made to output to both a file and mplayer at the same time? Then you save time by creating0 a backup as you watch.

For the keys, I'd just use a keys.ini or similar file, having one processing key per line. It would just try each key in order, so new keys can be added to the end. However, keep a list of known keys built in as well; this would allow it to fall back or re-create keys.ini if the file is missing or corrupt.

spare
5th June 2007, 12:16
"Could it be made to output to both a file and mplayer at the same time? Then you save time by creating0 a backup as you watch."

:helpful: Alright...

I know very little about linux (nothing about this subject) but because i wanted to do something "similar" once maybe I know the answer to this !!

Isn't there a program that accepts input in stdio and outputs it both to stdout and a list of named files ????

tee ???

So it would be something like:

decrypthd /dev/scd0 /mnt/hddvd/ FEATURE_1.EVO -o |

tee <path><filename> |

mplayer -demuxer mpegps -vc ffvc1 -

(on a per-file basis, of course, if you mean backup the entire "set", i don't know,... but this program doesn't do that anyway, right)


Hope it's helpful, like i said I'm just curious, not "knowledgeable"...

qubic
5th June 2007, 12:23
@qubic

you are missing libcrypto ;)

no, it is installed. version 0.9.8b.

I get the "EC_KEY_new" error once, and then it continous with the "ioctl" error. I have to reconnect the drive, to get the "EC_KEY_new" error again.
Unmounting and mounting the drive, is not enough.

the log is:

*** Starting log ***

DecryptHD v0.1 (Jun 3 2007 21:52:35)
Device: /dev/scd0
Mountpoint: /mnt/hddvd/
Filename: /mnt/hddvd/HVDVD_TS/THECAST.EVO
Ouput dir: dumping to stdout
Chunksize: 65536

*** Setting up decrypter ***
Processing MKB
MKB filesize: 1000000
Extracting MKB version:
Type 266243, Version 1
Extracting U masks and UV numbers
Extracting Media Key Data
Detecting media
Detected HD DVD
Loading Title Key file
Extracting encrypted Title Keys:
Encrypted key 1: 5B2CF6D81024C18C4F54280F2E86D150
Encrypted key 2: 2ED608CE2384B0873138C288A30739CB
Encrypted key 3: 03A4B96F5AFB62CE54437C2A968C78EB
Encrypted key 4: 1E8082AA5AB23645B01FF95CF74603B6
Encrypted key 5: 812EB64622B848F7B16092B5037231E3
Encrypted key 6: F61921838D9B2E131EB97DDFB69C1B3C
Encrypted key 7: E969678D372C93D6F3F2C40EA2970FDB
Encrypted key 8: 04B8F5104E06DDB055E99EF44BDD56BD
Encrypted key 9: CD15EDCC39BFD202FA01032AEFCCE8A6
Encrypted key 10: 5AAEC6174259B9B5C3B23DD40E0AB57D
Encrypted key 11: A2CF3664C5C87CAB054B35F1A098DCA7
Encrypted key 12: CF5CE9527669B442FC07D0B1C1EB487A
Encrypted key 13: 18456DDB1F260A5852FD59B4A8A30680
Calculating Media Key:
Processing Key 09F911029D74E35BD84156C5635688C0
Media Key Data 0A1E9BEC716F34061519D8F6A0795A45
Decrypt result CCFB14DF10623C201C7BA4961C30708A
Media Key CCFB14DF10623C201C7BA4961C30708B
Verifying Media Key
Verify Data CEA882A57091F8EBB3C0F82C7F7C1576
Verify result 0123456789ABCDEF
Media Key is valid.
Device /dev/scd0 opened (handle 4)
Doing drive authentication



regards qub

qubic
5th June 2007, 12:28
Hi Zotty

please write log into $HOME or somthing. not current dir.

thanks.

-qub

Zotty
5th June 2007, 20:26
The none of the new audio formats (DTS-HD, E-AC3/DD+ and TrueHD) are supported yet. DTS-HD is nice in that it's a backwards compatible format, meaning the ffmpeg DTS decoder will get a DTS stream, but not the advantage of the better quality HD stream. The only way to currently play the others at all is to use windows codecs. There's a tool (http://forum.doom9.org/showthread.php?t=125966) for converting them to AC3, but it requires the windows codecs. Someone might be able to get the mplayer binary codec loader to load the audio codecs, but AFAIK the binary loader has only been used for video codecs so far. There is hope though, there's an ffmpeg summer of code ( http://code.google.com/soc/ffmpeg/appinfo.html?csaid=988946629C3C7BE9) project for E-AC3, but no TrueHD project yet (that I know of).

Thanks for clearing this up. I really hope someone picks this up soon so we can all enjoy a more complete movie experience!


It would be nice if you could integrate this into mplayer directly. Something like `mplayer hddvd://' and it handles the decryption, reads the playlist, and starts playing tracks. Ideally it could even be made into a library, libaacs or something. That way any program (ffmpeg, mplayer, xine, etc) could just ask the library "open this disk" and "open this file" and the library does all the needed decryption. Kinda like libdvdcss.

I love the idea, but they may be a problem; player certificate and processing keys. Unless a different solution is found, these are essential for authentication/decryption. Since there is no open-source certificate available, this would mean using the (perhaps revoked) certificate of an unnamed commercial player. IF it would be allowed in the source, it would probably make mplayer a prime target for AACS LA and friends.

Another option would be to make library of this like libcss. I haven't looked at how that one works, but the idea might be a potential possibility.

However just image this would work. How about adding total menu functionality aswell. Would be nice to have complete playback and not only the movie itself. Just pop in the disc, navigate the menu (subtitles, audiotracks, scne selection, extra's, etc.) and have fun for the coming 2 hours.

Zotty, we need a Windoz version :D
When I've got some spare time I'll see if I can compile the latest mplayer source using mingw. If that works and it plays evo files from harddisk, 'tweaking' the app and testing would be the next logical step. Very doable imho.

Very nice. Could it be made to output to both a file and mplayer at the same time? Then you save time by creating0 a backup as you watch.
Should be easy to implement. Added to the todo list.


For the keys, I'd just use a keys.ini or similar file, having one processing key per line. It would just try each key in order, so new keys can be added to the end. However, keep a list of known keys built in as well; this would allow it to fall back or re-create keys.ini if the file is missing or corrupt.
Right now it determines the version of the MKB and based on that decides which of the 2 currently known processing key and corresponding uv numbers to use. So there could/should be some backup functionality here indeed. Need to experiment a bit.

no, it is installed. version 0.9.8b.

I get the "EC_KEY_new" error once, and then it continous with the "ioctl" error. I have to reconnect the drive, to get the "EC_KEY_new" error again.
Unmounting and mounting the drive, is not enough.

the log is:

...

regards qub
Haven't gotten a clue what goes wrong here. I'll try to find out more about what could be causing this. In any case it shouldn't continue and just exit reporting the error, so this could be a bug.
For the record, I'm using 0.9.8e (latest version available in my distro without building from source).

About the reconnecting, this is something I've noticed aswell during testing. This happens when drive authentication fails. According the AACS spec this is drive behaviour to be expected when authentication fails. I've always been able to reset this by ejecting the disc and inserting it again.

Hi Zotty

please write log into $HOME or somthing. not current dir.

thanks.
-qub
How about $HOME by default and the ability to specify an optional different directory? Place decrypthd in your bin directory and keep the log stuff out of the root stuff.

jackelmatador
7th June 2007, 19:15
So I get the same error trying to play planet earth or king kong, I think I have something wrong with FFMPEG, but I don't know what. I tried it with FFMPEG installed from the synaptic manager, and by trying to compile the latest greatest svn then install

root@main:~# /home/stephan/decrypthd /dev/scd0 /media/KING_KONG/ FEATURE_1.EVO -o | mplayer -demuxer mpegps -vc ffvc1 -
MPlayer 2:1.0~rc1-0ubuntu9 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (Family: 6, Model: 15, Stepping: 6)
CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not open config files /root/.lircrc and /etc/lirc//lircrc
mplayer: No such file or directory
Failed to read LIRC config file ~/.lircrc.

Playing -.
Reading from stdin...
demux: File doesn't contain the selected audio or video stream.
MPEG: Missing video stream!? Contact the author, it may be a bug :(


Exiting... (End of file)

jackelmatador
7th June 2007, 19:29
Ok I update my Mplayer (I thought I already did that, guess not) so that got video working but audio is not working for King Kong=(, as already stated may happen. Planet Earth works perfectly!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Also I guess this might be known but I have to do this from root, not even sudo works. Is that what qubic meant by log into home?

qubic
7th June 2007, 21:41
Also I guess this might be known but I have to do this from root, not even sudo works. Is that what qubic meant by log into home?

no. There is a logfile called "decrypthd.log" in the current working directory. This file should be written in $HOME. Which is the home directory of the user.


--qub

qubic
7th June 2007, 21:50
Haven't gotten a clue what goes wrong here. I'll try to find out more about what could be causing this. In any case it shouldn't continue and just exit reporting the error, so this could be a bug.
For the record, I'm using 0.9.8e (latest version available in my distro without building from source).


I have been trying to update to the latest. From source. No matter what, it compiles as 64-bit. I don't have a clue how to compile it to 32-bit.
Can anybody help?

Zotty, could you please compile it statically. :thanks:

--qub

Zotty
7th June 2007, 22:52
Also I guess this might be known but I have to do this from root, not even sudo works. Is that what qubic meant by log into home?
The reason you need root for this is that some (or maybe all) discs are authored with about the worst rights you can get. You can't even fully see what's on the disc without root rights. And no fileaccess means no decrypting.
If I'm not mistaken the kernel is responsible for granting access to devices and it can't just grant access without valid rights. Would be a mess if this could easily be circumvented. The downside is that this restriction is kind of annoying in our situation. But the problem is caused by the way the discs are authored.
Would be nice if this can be solved though.

PS, working towards a weekend release...

jackelmatador
8th June 2007, 00:31
Another option would be to make library of this like libcss. I haven't looked at how that one works, but the idea might be a potential possibility.

However just image this would work. How about adding total menu functionality aswell. Would be nice to have complete playback and not only the movie itself. Just pop in the disc, navigate the menu (subtitles, audiotracks, scne selection, extra's, etc.) and have fun for the coming 2 hours.


Don't tease us, that would be an unbelievable achievement!

jackelmatador
8th June 2007, 12:59
So I guess my computer is not powerful enough to stream the HD DVD. I just tested for like ten seconds earlier on Thursday, and then tonight I went to actually watch the whole show and nothing but garbage. It seems that my Core 2 Duo E6600, 2 GB of Ram, 7900 GS 256MB Nvidia card, and two 500GB 7200rpm Raid 0 hard drives EXT3 portioning, just doesn't cut it. Is there some option I did not include when I compiled Mplayer? I configured it with xvmc (doesn't matter for this), ssse3, and everything else autodetected.

Here is the error I get from mplayer

************************************************
**** Your system is too SLOW to play this! ****
************************************************

Too many video packets in the buffer: (4096 in 8279842 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

qubic
9th June 2007, 11:27
So I guess my computer is not powerful enough to stream the HD DVD. I just tested for like ten seconds earlier on Thursday, and then tonight I went to actually watch the whole show and nothing but garbage. It seems that my Core 2 Duo E6600, 2 GB of Ram, 7900 GS 256MB Nvidia card, and two 500GB 7200rpm Raid 0 hard drives EXT3 portioning, just doesn't cut it. Is there some option I did not include when I compiled Mplayer? I configured it with xvmc (doesn't matter for this), ssse3, and everything else autodetected.

Here is the error I get from mplayer

************************************************
**** Your system is too SLOW to play this! ****
************************************************

Too many video packets in the buffer: (4096 in 8279842 bytes).
Maybe you are playing a non-interleaved stream/file or the codec failed?
For AVI files, try to force non-interleaved mode with the -ni option.

Hi Jackel

I get the same output, but only on some movies. I have a "AMD Sempron 3400+, 2GB ram, nvidia 6200 128mb TC card.
Under windows XP, I got only some sync problems.

regards qub

Zotty
9th June 2007, 12:33
I've seen it aswell on a rare occasion, however I haven't been able to put my finger on it. The too many video packets only happens when I play the 2nd part of a movie (e.g. feature_2.evo). So far I've assumed this has something to do with mplayer's demuxing stuff or how the movie was cut in half during authoring. Also noticed that switching demuxer can solve it, but introduces it for the evo that played well with the other demuxer.

One thing I do know for sure is that decrypthd only outputs 2048 at a time, which is exactly 1 packet. Seeing VC-1 playback is relatively new and streaming it like this is apparently the first time ever attempted, these could very well be 'glitches' in mplayer. It's certainly not the first :rolleyes:

Try playing with '-demuxer lavf' and see what happens.

qubic, does this mean you've got the openssl part working now?

Zotty
9th June 2007, 13:01
Don't tease us, that would be an unbelievable achievement!

I've been thinking a bit about this and came to the conclusion this would be a massive undertakement. First of all it would require understanding mplayer's code, which is compact and huge. The decryption part would need to be integrated or provided through a library, including ARF decryption. The disc needs to be accesible through hddvd:// or something like that. So far it's doable.

On a HD DVD disc there are a lot of different parts that need to be processed/parsed. Key files, advanced elements such as images, animations, fonts, music, etc.. And these are all protected. Then you'd also need to parse XML files, make an ECMA script interpreter and put this all together.
Now only the raw material is available and needs to be put to good use. Building menu's and be able to display them with user interaction, the selection of different languages and so on, all integrated with the underlying mplayer code. And there's probably more, which I haven't even thought of.
In any case this would require months of coding if not longer. And don't forget this will be done in spare time since most of us have/need jobs to feed themselves. All in all a very cool idea, but at this time far from being reality.
It would be very nice if there ca be some sort of cooperation between various programmers to realise this. This wouldn't be a simple patch, so this can't be simply dumped into mplayer's dev tree. Probably a seperate source repository would be needed where various people could work on a combined sourcetree. At least to begin with.

qubic
9th June 2007, 19:30
qubic, does this mean you've got the openssl part working now?

No. These was decrypted from windows/wine.

--qub

jackelmatador
10th June 2007, 02:20
Zotty no worries on the mplayer plugin, that is why I was very surprised.
Hey Qub,
From what I have read the drivers NVIDIA supplies for windows is much better. They supposedly do fun stuff like actually sending VC-1 frames to the video card to be processed. I know in Linux only MPEG1/2 is done this way through XvMC.

I think once I figure out how to make the video play acceptably (-lavf is a little better) I might write a little script that just plays the biggest EVO files available. The only tough part would be to make sure they play in the right order, for now it seems all movies have some sort of numerical suffix.

XAvAX
10th June 2007, 07:02
Perhaps a way to implement it without requiring root permissions would be to make a daemon "backend" that runs as root and reads the files, only to pass them (without preprocessing, so that the userpriv part can be reniced individually) to a "client" running with user privileges, which does the actual decryption? In theory, this could also enable:

Multiple users accessing the disc
No need to be root
Individual config files (default drive location, fallback VUK's if implemented)

Maybe, eventually, we can wrangle someone who understands FUSE to implement a sort of "pseudo-filesystem", like eCryptFS, which acesses the mountpoint, and creates a sort of "translated" filesystem in a directory that decrypts files dynamically on access - this is essentially what eCryptFS does, so it's feasible, and it might even be possible with existing code since AACS uses AES and there are already several programs, including this one, which can handle subset-diference. In theory, this could make that menus and extras concept possible.

Whap me over the head if I'm being too blue-sky, but does anyone know a filesystems person?

Also, I found a post on vger.kernel.org talking about adding a uid=ignore/gid=ignore option to mount for UDF, dated to March 4 2006. Try it and see if it helps.

unixfs
10th June 2007, 11:22
I didn't test this software because I don't have a drive, anyway I have a couple of hints and requests:
- adding -demuxer mpegps isn't necessary (it will only detect the mux format faster) and as already observed by others it isn't even the best option available
- -demuxer lavf -correct-pts may playback smoother
- hddvd:// would require a stream reader module in mplayer (look at stream/ directory) which in turn would require a reader library that all other softwares may use, such as libdvdread that provides access to single titles without bothering with menus, stills and so on
- playing single files _will_ break multi-angle movies, just like playing single VOB of multi-angle dvds _does_ break today, thus a library is the only way to go for the future.

Now the requests, solicited by you: may you release the source code, please? Possibly to some plain ftp/http server (e.g. not rapidshare and co).
Thanks very much for your work!

Zotty
11th June 2007, 20:00
A little later than planned (was busier than expected), but here it is;
The source: decrypthd_src_20070611.rar (http://www.sendspace.com/file/43oodq)
And the binary: decrypthd_bin_20070611.rar (http://www.sendspace.com/file/lequ4p)

Changelog:
- Simultanious save to file while watching (use <output dir> -o)
- CMAC AES (for Volume ID verification)
- Code cleanup
- Resets AGIDs so it's no longer needed to manually reset the drive

Zotty
11th June 2007, 20:14
Also, I found a post on vger.kernel.org talking about adding a uid=ignore/gid=ignore option to mount for UDF, dated to March 4 2006. Try it and see if it helps.
Tried your suggestion, but unfortunately no change when adding adding it to fstab (user,defaults,uid=ignore,gid=ignore).


- adding -demuxer mpegps isn't necessary (it will only detect the mux format faster) and as already observed by others it isn't even the best option available
During playback of files from harddisk this is indeed not necessary as autodetection works fine. But it doesn't work when streaming. Don't know why, but without demuxer it just outputs some text, but no video. It seems detection doesn't work properly when streaming.

- playing single files _will_ break multi-angle movies, just like playing single VOB of multi-angle dvds _does_ break today, thus a library is the only way to go for the future.
Are there any multi-angle HD DVD's out there? Haven't seen any yet.

Now the requests, solicited by you: may you release the source code, please? Possibly to some plain ftp/http server (e.g. not rapidshare and co).
Thanks very much for your work!
See my previous post ;) Unfortunately I've only got webhosting that's linked to my real name. And I'd rather not use that one due to potential 'trouble'.

qubic
11th June 2007, 23:42
A little later than planned (was busier than expected), but here it is;
The source: decrypthd_src_20070611.rar (http://www.sendspace.com/file/43oodq)
And the binary: decrypthd_bin_20070611.rar (http://www.sendspace.com/file/lequ4p)

Changelog:
- Simultanious save to file while watching (use <output dir> -o)
- CMAC AES (for Volume ID verification)
- Code cleanup
- Resets AGIDs so it's no longer needed to manually reset the drive

Hi Zotty

This is great. But I get this fare:

[root@dhcppc0 decryptHD]# make
g++ -c -o src/decrypthd.o src/decrypthd.cpp -I.
src/utils/file.hpp:6: error: conflicting declaration ‘typedef long long unsigned int uint64_t’
/usr/include/stdint.h:56: error: ‘uint64_t’ has a previous declaration as ‘typedef long unsigned int uint64_t’
make: *** [src/decrypthd.o] Error 1
[root@dhcppc0 decryptHD]#


openssl was configured with this:

./config shared --prefix=/usr -BN_LLONG

regards qub

Zotty
12th June 2007, 07:44
The typedef in file.hpp is no longer needed, due to stdint being used now.

Try replacing:

#include <string>

typedef unsigned long long uint64_t;

class File


with:

#include <string>
#include <stdint.h>

class File


That should solve the conflicting declaration. Will also fix this in the code over here.

BENtheTEN
16th July 2007, 17:39
Hi there

I've got a problem using decrypthd. I'm always getting the following message in the log:
*** Starting decryption of PEVOB_1.EVO ***
Dumping to stdout
Getting key number from /media/CONSTANTINE_HD/HVDVD_TS/PEVOB_1.EVO
Needed key is
No keynumber. Aborting!

### Exception: HDDecrypter: No keynumber. Aborting! ###

I tried the source and binary version.
Is there anything I do wrong? Am I supposed to put a Key somewhere?

My System is 32bit Debian SID, external xbox drive

Thanks
Ben

PS: dumphd worked flawlessly with all my HD DVDs using exactly this drive

BENtheTEN
30th July 2007, 10:55
Hi
I "solved" my problem by replacing

ifEvobFile.read((char*)u8Header, sizeof(u8Header));

return u8Header[0x3E] - 1; // note: we start at 0, while keynumber starts at 1


with
ifEvobFile.read((char*)u8Header, sizeof(u8Header));

return u8Header[0x3E]; // note: we start at 0, while keynumber starts at 1


but I have no idea why it works.

Regards
Ben

BENtheTEN
6th September 2007, 21:03
hi

did I miss something or is there really no improved decrypdhd version? like watching blu-rays on the fly.
I'm not happy ripping every disk and watching it this way. It's very time and disk space intensive.
Unfortunately I'm not a (good) coder, so I can't improve it by myself.


Best Regards
Ben

pardus
31st October 2007, 15:01
A little later than planned (was busier than expected), but here it is;
The source: decrypthd_src_20070611.rar (http://www.sendspace.com/file/43oodq)
And the binary: decrypthd_bin_20070611.rar (http://www.sendspace.com/file/lequ4p)

Changelog:
- Simultanious save to file while watching (use <output dir> -o)
- CMAC AES (for Volume ID verification)
- Code cleanup
- Resets AGIDs so it's no longer needed to manually reset the drive

Would you mind opening a Google Code project so we could get the source easily. Sendspace links are dead now. Thanks.

pensivepuppy
3rd November 2007, 15:03
Can someone re-post the source code, or send me a copy. The sendspace links are no longer valid.

bshep
3rd November 2007, 16:59
for the permissions problem you could try the umask= option.

If I remember correctly if you set it to umask=000 all files will have full permisions (rwxrwxrwx).

I think this only works if the FS has no specific permsions, not sure how UDF is structured so it may or may not work.

v1rtu0s1ty
4th November 2007, 03:36
I should have not bought the Toshiba HD-A2 player. I should have just saved more money for the xbox hddvd drive. :(

Awesome tool! I will try it one of this days! :)

natronicus
7th November 2007, 18:59
Can't locate the src files anywhere, but I located the compiled bin here:

http://files.linux.ru/index.php?dir=HDD-CD-DVD/DecryptHD/11062007/

Can anyone (Zotty?) provide a more legitimate source for this? I'd like to add streaming support to my linux media box. It's probably safe, but I'm not excited about downloading random, compiled bin files from russian websites and sticking them in /bin.

Wilbert
7th November 2007, 21:52
http://rapidshare.com/files/68150910/decrypthd_src_20070611.rar.html

pensivepuppy
12th November 2007, 04:24
Here is a new program named hddvdfs which is based on decrypthd. It's a filesystem (using FUSE) that mounts the files using decrypthd behind the scenes as a filter for the data. This way the EVO files can be accessed as regular files, not just as streams.

http://www.sendspace.com/file/2k48vg

So far this is only available as a patch to the decrypthd source code.

pensivepuppy
14th November 2007, 19:17
Here is an updated version of hddvdfs with a few bug fixes:

hddvdfs_src_20071114.rar (http://www.sendspace.com/file/3a4w0j)

The changes are:

* Fix file descriptor leak in HDDrive class.

* Only try to decrypt .EVO files under HVDVD_TS. This should mean that
.MAP and other non-EVO files under HVDVD_TS are now read correctly.

* Fix a possible core dump when closing regular (non-encrypted) files.

Hddvdfs is a front-end for decrypthd that mounts an HD-DVD, using
decrypthd as a filter for the data. In this way the files on the
HD-DVD can be accessed like regular files instead of only accessing them
as streams.

Zotty
14th November 2007, 20:34
Very nice addition :D

I just finished itegrating the previous version into the latest source. The structure has changed a bit, so easier said than done. But I guess I'll have some new updates to reintegrate. No patching in one less step into making this work for everyone. Hopefully I can do a testrun tonight to see how hddvdfs works.

Anyways, just wanted to let you guys know I'm back.

Zotty
15th November 2007, 22:46
Well time for an update long overdue. It has the HDDVDFS patch included (huge thanks to pensivepuppy). Been playing around with it a bit and man it's sweet. It allows for jumping through the movie which wasn't possible using streaming. If you can use FUFE, I can highly recommend it.

Changelog:
- Made drive, harddisk and HDDVDFS version
- Keys/certificates/etc are replacable
- Rewritten stream decryption code
- Bug fixes
- Problably more which I don't remember

Source: DecrypHD v0.3 source (http://rapidshare.com/files/69983256/decrypthd_v0.3.tar.bz2.html)
Binaries: DecrypHD v0.3 binaries (http://rapidshare.com/files/69985655/decrypthd_v0.3_bin.tar.bz2.html) (P4 optimized)

Please note that the key database hasn't been updated in a long time. Will update it soon. Also MKB v4 discs are not supported yet since it still hasn't been cracked publicly.

Adub
18th November 2007, 06:31
Holy Crap! Your still alive, Zotty!?

I thought you were dead! Nice way to come back from the grave my friend, and thanks alot for the new additions!

Zotty
18th November 2007, 13:06
Yeah well it's kinda hard to exterminate me ;) Main reason for my absense was a new job on the other side of the country (and the consequent movement). I took enough time to get things on track and settling in.

But that's done now, so I plan on spending more time on getting rid of that pile-o-aacs-junk. And there's much to be done, although not directly related to decryptHD The biggest problem we (=the world) have got is the lack of host data, new keys and the way to aquire them. You probably already know this stuff, but it can't hurt to write down once more:
Till now we've been using the old PowerDVD host data (certificate, private key, etc.), but it has been revoked. Not to mention that using a certificate of another program is not the solution. So unless you've got a xbox360 drive supporting the instant-authentication-hack, you're more or less doomed for now (without using additional tools).

Then there's MKB v4. Slysoft has been doing a lot of good work there, but alas, they've also stated they will not release their results to prevent the competition for using their technique / make AACS LA's life more difficult. Also a large group of HD buyers have windows who just use AnyDVD and have no need for alternative programs.

What does this mean for us? They've got a point not releasing their findings, but it makes our live more difficult. We've got non AACS related jobs (well most of us do ;)) and don't have the same time and resources to get where Slysoft is right now. And the later makes it harder to get information since less people see requests for new information. The more people you can reach, the more information you can gather. And with a database of almost every title out there it would maybe, just maybe be possible to deduce a common key.

Related to this, I've been thinking of reimplementing using seperate Volume Keys when playing a real disk. Right now it uses MKB v1 and v3 processing keys when reading from disk, but that renders watching MKB v4 disk impossible, even if you have a Volume Key.

Another ting that stands decent playback in the way at this time is audio support.I've been playing around with Mplayer's E-AC3 patch and there's about a 10 seconds delay between video and audio. That renders watching more or less pointless. But it si something I can't do anything about at this time.

Anyways, since this will not happen over night, I'll just focus on the things that can change a bit sooner. Atm I'm working on adding decryption for all encrypted files on disk. That way using HDDVDFS there is no trace left of AACS and you just see normal (and decrypted) files. And offcourse the usual bugfixes/improvements.

bcrabl
18th November 2007, 23:14
Instead of cracking MKBv4, couldn't somebody crack the AnyDVD HD database (since every version of AnyDVD HD comes full with a full set of the key database)?

Guest
19th November 2007, 05:57
couldn't somebody crack the AnyDVD HD...Forum rule 6: "No warez, cracks, ..."

Adub
19th November 2007, 07:14
And if we did that, it would only be temporary, as I am sure the AnyDVD guys know how to prevent their database from being cracked, as it is there job to do the opposite. And it doesn't help the community move forward, as personal experimentation and discovery would.

Edit: Oh, and Zotty, I have a very high respect for you now. You speak the truth. In the coming years, as I learn the ins and outs of programming and it's extraneous subjects, I will do everything in my power to help this community, whether it is decryption, audio/video encoding/filtering, or any other subject contained with in the ever expanding universe that is this community.

Zotty
28th November 2007, 00:43
Version v0.4 is here, this time mainly code improvements and updates for the HDDVDFS part. It now includes ACA and XPL file decryption. Also is the host keys/certificate are not found, it uses an internal backup copy. This also means that if you have newer hostdata, the internal ones will be overruled.

Changelog
v0.4 - 2007/11/28
- Added ACA file decryption
- Added XPL AACS header stripping
- Rewrote logging code
- Improved error handling
- Improved utility usability
- Improved filesystem code
- HDDVDFS now detects files independant of case
- Renamed classes to better reflect their purpose
- External certificate/keys are used to overrule the internal ones
- Minor bug/leak fixes throughout the code

Binaries: http://rapidshare.com/files/72754455/decrypthd_v0.4_bin.tar.bz2.html
Source: http://rapidshare.com/files/72754566/decrypthd_v0.4_src.tar.bz2.html

Just a remark about ACA and XPL files: the final filesize is smaller than the original one due to decryption/stripping. I haven't figured out yet how I can tell FUSE to use the new size when reading the first time. This can sometimes lead to padding at the end to fill up the space. Read the file again and the size is updated correctly (and without padding).

And Merlin7777, just keep practicing with programming. It's the best way to learn. Besides we all learn new things every day ;)

Adub
28th November 2007, 01:07
Will do man! You rock!

Thanks for the update by the way.

asdx
16th December 2007, 00:50
you rock Zotty, free software / open source is the way to go :)

i have a question, can all this stuff be implemented into a library like libdvdcss so players could use that and then decrypt movies on the fly? just like mplayer/ffmpeg/libdvdcss does with encrypted DVDs.

thanks for your hard work and for release it as FOSS :)

leftkidney
25th December 2007, 03:02
Yup, that's the idea.

maybe the dvd fab people could learn from this

FREE is always better no matter what

yea there is a free ver but it does nothing really

leftkidney
25th December 2007, 03:09
Zotty, we need a Windoz version :D

as much as I hate to say this I agree with you

but if it is hard to do then there is no reason why people cant use linux, I mean really this is kinda a niche thing as it is so linux shouldnt be a problem

Zotty
25th December 2007, 13:59
i have a question, can all this stuff be implemented into a library like libdvdcss so players could use that and then decrypt movies on the fly? just like mplayer/ffmpeg/libdvdcss does with encrypted DVDs.
Yes that would certainly be possible. I'll have a look into this. See also below.

but if it is hard to do then there is no reason why people cant use linux, I mean really this is kinda a niche thing as it is so linux shouldnt be a problem
Most parts of the code should be working under Windows. It just requires some minor Windows specific stuff since for example Visual Studio doesn't support stdint.h and MinGW (haven't tested VS yet) doesn't know the 64-bit versions of the functions I use for getting directory functionality.

A major problem could be hddvdfs. This is based on FUSE which is part of the Linux kernel. I have no idea if there's something similair under Windows and if so how to implement it. Nor do I have the ability (and interest) to test it properly. I've only got Linux with Windows running using VMware. This allows me to use Visual Studio, but does not offer a good way for playing HD discs. If someone feels like diving into this, feel free to do so. I'll provide help where I can.

I'm thinking of using CMake. Would give some better control over installed packages such as openSSL and it becomes easy to use the GNU make tools under Linux and vcproj files under Windows.

Update:
Gave it a spin today and it's a bit more work than expected. Installed the MS platform SDK and VS updates (which took ages...) and the result was not that bad. CMake shouldn't be a problem (got most working, just need additional tweaks to get it all right), but I totally forgot about the IOCTL calls used to communicate with the drive. Also the filesystem stuff isn't recognised by VS. So for Windows these part need to be rewritten. On the other hand openssl and stdint was solved within 5 mins, so that's good.
Final thought is that compiling it under Windows has a very low priority for me. I've also started working on some other HD DVD stuff which is much more fun to do and doesn't exist yet for Linux (e.g. a HDi player). To be blunt, Windows users have PowerDVD and AnyDVD, so I'd much rather spend my spare time making something new on a platform that has no decent HD DVD support yet.

asdx
30th December 2007, 01:26
Final thought is that compiling it under Windows has a very low priority for me. I've also started working on some other HD DVD stuff which is much more fun to do and doesn't exist yet for Linux (e.g. a HDi player). To be blunt, Windows users have PowerDVD and AnyDVD, so I'd much rather spend my spare time making something new on a platform that has no decent HD DVD support yet.

Thanks Zotty, I can't wait to see more of your work, keep up your excellent work :)

you rock!

natronicus
2nd January 2008, 18:44
Any idea what the difficulty level would be to get this working for blu-ray?

The PS3 linux guys have accelerated graphics partially working; it would be nice to be able to play blu-ray discs on a PS3 under linux with mplayer + a decyptHD plug in.

N

v1rtu0s1ty
2nd January 2008, 21:13
Hi Zotty,

Will the dual LG BluRay/HDDVD internal drive work?

Thanks,

V

Zotty
2nd January 2008, 23:11
Any idea what the difficulty level would be to get this working for blu-ray?

The PS3 linux guys have accelerated graphics partially working; it would be nice to be able to play blu-ray discs on a PS3 under linux with mplayer + a decyptHD plug in.

N
Don't think it'll be too hard to do. From what I've seen/read the basic idea is to take a differently named AACS file (MKB_RO.inf instead of MKBROM.AACS) and some bits in the drive code. But I've never tested this due to the lack of a real blu-ray drive. But I could whip up some code that 'might' be working.

Hi Zotty,

Will the dual LG BluRay/HDDVD internal drive work?

Thanks,

V
Haven't got a clue, but I'm guessing it will. What it does is read files of the disc, just like it would read normal files (except they are encrypted offcourse). If you can access the files from your filemanager/console/whatever, it will work.
At least for HD DVD that is. For Blu-ray, see above.

Btw, on a sidenote; I've discovered a bug with discs using Title Key 0 (for example Batman Begins) resulting in a error that no valid key was found. An update should be released soon.

v1rtu0s1ty
2nd January 2008, 23:14
Cool! Should I be worried though with my system? It's only Athlon 64 3000+. I don't know if it can handle real HDDVD movie. I can play 1080p trailers though but from what I was told, the 1080p trailers are just 5mb bitrate.

Zotty
2nd January 2008, 23:26
Well I'm no expert on current CPU's and their processing power (used to be but that was years ago...), but my gut says it's a close call. Decryption is constant as it just requires a stream of encrypted data without actually processing it's contents (no motion vectors and stuff like that). It requires less power than let's say PDVD if I'm not mistaken, so maybe you could compare with some results based on such a setup.
The real killer is high bitrates in the movie itself. This can shoke your system quite a bit. Also the used audio codec can suck up power. DD5.1 is fine, but using E-AC3 I've noticed the amount of power needed goes up noticably.

Been using my server's core2duo 6400 without any problems. Same goes for the laptop which has a T7300 (mobile core2duo). Both with onboard Intel X3100 graphics. Only bottleneck I've noticed so far is the Xbox360 drive. It maxes out at around 10MB/s. Reading discs through USB isn't one of Linux's best features.

v1rtu0s1ty
2nd January 2008, 23:29
Well I'm no expert on current CPU's and their processing power (used to be but that was years ago...), but my gut says it's a close call. Decryption is constant as it just requires a stream of encrypted data without actually processing it's contents (no motion vectors and stuff like that). It requires less power than let's say PDVD if I'm not mistaken, so maybe you could compare with some results based on such a setup.
The real killer is high bitrates in the movie itself. This can shoke your system quite a bit.

Been using my server's core2duo 6400 without any problems. Same goes for the laptop which has T7300. Both with onboard Intel X3100 graphics. Only bottleneck I've noticed so far is the Xbox360 drive. It maxes out at around 10MB/s. Reading discs through USB isn't one of Linux's best features.

Awesome. Looks like I will have to invest on better cpu. It's good too for me to upgrade since I will also be able to do CRT projector blending as well. It's like hitting 2 birds with one stone. :D

Thanks again!

Zotty
2nd January 2008, 23:36
edit:
Here's a list I found (based on windooz and pdvd):

AMD
AMD Athlon 64 FX-60 (2.6 GHz)
AMD Athlon 64 FX-62 (2.8 GHz)
AMD Athlon 64 X2 3800+ (OC @ 2.4 GHz)
AMD Athlon 64 X2 4200+ (2.2 GHz)
AMD Athlon 64 X2 4400+ (2.2 GHz)
AMD Athlon 64 X2 4600+ (2.4 GHz)
AMD Athlon 64 X2 4800+ (2.4 GHz)
AMD Athlon 64 X2 5000+ (2.6 GHz)
AMD Athlon 64 X2 5200+ (2.6 GHz)
AMD Athlon 64 X2 5400+ (2.8 GHz)
AMD Athlon 64 X2 5600+ (2.8 GHz)
AMD Athlon 64 X2 6000+ (3.0 GHz)
AMD Opteron 175 (2.2GHz)
AMD Opteron 180 (2.4GHz)
AMD Opteron 185 (2.6GHz)
AMD Turion 64 X2 TL-60 (2 GHz)

Intel
Intel Pentium EE 840 (3.2 GHz)
Intel Pentium EE 955 (3.4 GHz)
Intel Pentium D 945 (3.4 GHz)
Intel Pentium D 950 (3.4 GHz)
Intel Pentium D 960 (3.6 GHz)
Intel Core Duo T2500 (2 GHz)
Intel Core Duo T2600 (2.16 GHz)
Intel Core Duo T2700 (2.33 GHz)
Intel Core 2 Duo E6300 (1.8 GHz)
Intel Core 2 Duo E6400 (2.13 GHz)
Intel Core 2 Duo E6600 (2.4 GHz)
Intel Core 2 Duo E6700 (2.66 GHz)
Intel Core 2 Duo E6800 (2.93 GHz)

panicbutton
8th January 2008, 06:18
Btw, on a sidenote; I've discovered a bug with discs using Title Key 0 (for example Batman Begins) resulting in a error that no valid key was found. An update should be released soon.

Hi, first I'd like to thank everyone, especially the coders, for their work. This is awesome and totally appreciated.

I found this bug too, with the Matrix HD-DVD .EVO files. Here's the patch I used to fix it, seems right from other comments in the code, and my other discs still decrypt ok. This was using version 0.4.

--- original/src/hddvdfs.cpp 2007-11-27 19:28:38.000000000 -0600
+++ decrypthd_v0.4_src/src/hddvdfs.cpp 2007-12-29 23:29:19.000000000 -0600
@@ -275,7 +275,7 @@

// get needed key number
int iKeyNumber = self->m_disc->GetKeyFromEVOB(fullPath);
- if (iKeyNumber == 0) {
+ if (iKeyNumber < 0) {
std::cerr << "No key for this file" << std::endl;
retval = -EACCES;
}

Thanks again for all the work on this project.

- Panicbutton

Zotty
8th January 2008, 21:25
Exactly, that's all there is to it. Same goes for the EVOB and ACA decrypter. Or place it deeper inside to catch them all at once.

PS, currently doing some final testing on libaacs ;)

Zotty
8th January 2008, 23:25
Version 0.5 is online!

It now uses CMake to build and install. This is a bit different compared to the conventional build system. So here's a quick howto:

Assuming you're doing this from the console:
- Unpack package and go into dir
- ccmake . (including the dot)
- make
- make install

Source should be build and those binaries are installed in /usr/local/bin. The lib itself can be found in /usr/local/lib. It does not install anything else like includes since I don't consider those final yet. So if you want to make your own app, you'll have to place the includes somewhere yourself.
Feedback is offcourse highly appreciated. There's also a doxygen file for building the documentation. This does not mean I've documented everything yet :rolleyes:

Next will be proper documenting, some further cleanups (there are still things in the code I consider a bit ugly), a C interface so it's more portale and an attempt at adding blueray support.

Links:
sourcecode at http://www.decrypthd.org (http://www.decrypthd.org/)
binaries (http://rapidshare.com/files/82329549/libaacs_v0.5_bin.tar.bz2.html)

Changelog
v0.5 - 2008/01/08
- Fixed bug where Title Key 0 resulted in an invalid key exception
- Split into libaacs and seperate tools
- Fixed memoryleaks
- Processingkeys are internal again
- Added CMake build system

TheMatrixx
9th January 2008, 19:15
Hi Zotty!

Nice to meet you... I'm watching the evolution of your software for a while now and I am impressed, it's a very nice piece of software. Anyway, I was wondering if you would like to have a full website for your project. Let me know ASAP and I will give it to you a few minutes :)

www.DecryptHD.org sounds good to you?

DWells55
9th January 2008, 20:15
This doesn't really affect me since I'm not (at the moment at least) using a Linux distro as my primary OS or an owner of an HD DVD drive, but I felt like telling you that this is awesome work. Especially for people with HTPCs using a Linux based OS. Keep up the great work and good call making it open source :)

Zotty
10th January 2008, 22:53
Hi Zotty!

Nice to meet you... I'm watching the evolution of your software for a while now and I am impressed, it's a very nice piece of software. Anyway, I was wondering if you would like to have a full website for your project. Let me know ASAP and I will give it to you a few minutes :)

www.DecryptHD.org sounds good to you?
Love to :) But what are the possibilities? Would like to store the releases (bin and source), the documentation and subversion if possible. With subversion others can upload code aswell, which would be great for adding functionality, bugfixing, BRD support, win32 support and so on. It's the one thing I've been missing and uploading it to familliar sites like sourceforge might cause problems due to the controversial nature of the code.

Btw, apparantly my buildsystem missed the CMakelists.txt file in the include dir. If anyone runs into trouble becuase if this, here it is. I'll include it in the new release.
include/CMakelists.txt (http://rapidshare.com/files/82810619/CMakelists.txt.html)

TheMatrixx
11th January 2008, 02:40
Well... http://www.decrypthd.org

We will talk in private about the details.

It has Subversion installed ;)

Zotty
11th January 2008, 23:23
Sweet! Let's see if we can get this thing going in the right direction.

Thanks for getting it up and running so quick. Guess my weekend is booked now ;)

uberjay
15th January 2008, 21:24
This is fantastic work, thanks. :)

Anyone aware of efforts to implement hd-dvd menu support in a free library? (something like libdvdnav)

Zotty
15th January 2008, 21:58
This is fantastic work, thanks. :)

Anyone aware of efforts to implement hd-dvd menu support in a free library? (something like libdvdnav)

As far as I know there's noone (publicly) working on a HDi (=the HD DVD menu system) player. So I started my own a while back :p
http://img407.imageshack.us/img407/6171/hditestir3.th.png (http://img407.imageshack.us/my.php?image=hditestir3.png)
Although it already looks a bit like a real engine, it's far from being complete. But don't expect anything on this soon from me. It seems easy, but it's much more complex than you'd think.... lots of parsing, interpreting and guessing. It's basicly your typical Microsoft mashup. Take a couple of W3C standards, strip them, take a script language, put it in a blender and call it your own proprietary language. Which is probably also the reason why we haven't seen anything on the subject yet. If anyone knows of persons working on this, please do let us know!

Btw, http://www.decrypthd.org is up and running, so the latest source can be gotten from SVN. I'm still adding text to it, but that doesn't affect the code.
If anyone encounters a bug, there's a ticket system that eveyone can use without registration. So feel free to add one. Also if anyone feels inclined to help out coding, let me know and we can work out the details of getting you SVN access.

qubic
26th January 2008, 02:24
Hi Zotty

Now that all the new HD sound formats works like a charme, I wanted to take a look at your program again.

My system is a fedora 7. OpenSSL 0.9.8b is installed by default. But somehow ec.h is not installed.
I installed the latest source. No matter what, it's installed in /usr/local/openssl, so I tried to copy it to the right places.

Now I get this compiler error:

/usr/lib64/ccache/c++ -fPIC -shared -Wl,-soname,libaacs.so -o libaacs.so "CMakeFiles/aacs.dir/aacs.o" "CMakeFiles/aacs.dir/aacs_crypto.o" "CMakeFiles/aacs.dir/acafile.o" "CMakeFiles/aacs.dir/arfile.o" "CMakeFiles/aacs.dir/crc32.o" "CMakeFiles/aacs.dir/evobfile.o" "CMakeFiles/aacs.dir/file.o" "CMakeFiles/aacs.dir/filesystem.o" "CMakeFiles/aacs.dir/hddrive.o" "CMakeFiles/aacs.dir/ioctl.o" "CMakeFiles/aacs.dir/mediakeyblock.o" "CMakeFiles/aacs.dir/rijndael.o" -L/root/decrypthd/libaacs/src/common -Wl,-Bstatic -lcommon -Wl,-Bdynamic -lssl -lcrypto -Wl,-rpath,/root/decrypthd/libaacs/src/common
/usr/bin/ld: /root/decrypthd/libaacs/src/common/libcommon.a(logger.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/root/decrypthd/libaacs/src/common/libcommon.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [src/libaacs/libaacs.so] Error 1
make[2]: Leaving directory `/root/decrypthd/libaacs'
make[1]: *** [src/libaacs/CMakeFiles/aacs.dir/all] Error 2
make[1]: Leaving directory `/root/decrypthd/libaacs'
make: *** [all] Error 2
[root@dhcppc0 libaacs]#

I'm a bit stock here. Hope you can help.

regards qub

qubic
26th January 2008, 03:03
Hi Zotty

I'm just looking at your binary.
Somehow it's locked to a specific version of libstdc++?!?

/usr/lib/libaacs.so: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/lib/libaacs.so)

is there a reason for this?

I have version 4.1.2 installed. Can't it be used?

regards qub

Zotty
26th January 2008, 11:59
Hi Zotty

Now that all the new HD sound formats works like a charme, I wanted to take a look at your program again.

My system is a fedora 7. OpenSSL 0.9.8b is installed by default. But somehow ec.h is not installed.
I installed the latest source. No matter what, it's installed in /usr/local/openssl, so I tried to copy it to the right places.

Now I get this compiler error:

I'm a bit stock here. Hope you can help.

regards qub

I think I know what's causing this, but I have no idea how to fix this yet. A quick search revealed this explanation: http://www.gentoo.org/proj/en/base/amd64/howtos/index.xml?part=1&chap=3
I checked and verified, that libcommon and the tools do not build with the mentioned -fPIC flag, while the library itself does. It might not mean much to you, but it could be the explantion I need to fix this. It could also be related to the compiler version you're using. See below.

On the ec.h thing, it might have something to do with you building it from source, while mine was just installed from my distro's pool. In other words; /usr/local/include/ vs /usr/include/. Looking into this.

What do you get if you run 'pkg-config openssl --cflags'?

Hi Zotty

I'm just looking at your binary.
Somehow it's locked to a specific version of libstdc++?!?

is there a reason for this?

I have version 4.1.2 installed. Can't it be used?

regards qub
The main cause is probably that your system is different than mine. When using binaries the code was compiled on a system (read mine) that has certain versions of certain libraries, libstdc++ in this case. This creates dependancies that may not exist on other systems (read yours) and thus execution fails due to dependancy errors.
There's little you can do about these kind of errors, except for upgrading. In this case libstdc++ is part of GCC, so updating your GCC might do the trick. And if you update you compiler, why not have another go at compiling the source aswell. It is plausible this affects your above compile problem aswell.

Just curious, what version of GCC are you using (or is it the same as libstc++ 4.1.2)? Using 4.2.3 myself.

On a side note for other readers: here's a short howto on getting the latest code (and fixes) from SVN: http://www.decrypthd.org/wiki/BuildLatest. And for those blueray users reading this, there's also (untested) code in the repository that might already play back BR ;)

Iskondi
29th January 2008, 20:02
Hey Zotty,

Been following this thread for awhile now and I'm having either the exact same two issues as Qubic or very very similar. (Though I'm running on Centos 5.1 64bit) When I initially try and compile I get the ec.h file missing, then I throw on the "full source" for openssl and I get:

/usr/bin/c++ -fPIC -shared -Wl,-soname,libaacs.so -o libaacs.so "CMakeFiles/aacs.dir/aacs.o" "CMakeFiles/aacs.dir/aacs_crypto.o" "CMakeFiles/aacs.dir/acafile.o" "CMakeFiles/aacs.dir/arfile.o" "CMakeFiles/aacs.dir/crc32.o" "CMakeFiles/aacs.dir/evobfile.o" "CMakeFiles/aacs.dir/file.o" "CMakeFiles/aacs.dir/filesystem.o" "CMakeFiles/aacs.dir/hddrive.o" "CMakeFiles/aacs.dir/ioctl.o" "CMakeFiles/aacs.dir/mediakeyblock.o" "CMakeFiles/aacs.dir/rijndael.o" -L/root/Desktop/libaacs/src/common -Wl,-Bstatic -lcommon -Wl,-Bdynamic -lssl -Wl,-rpath,/root/Desktop/libaacs/src/common
/usr/bin/ld: /root/Desktop/libaacs/src/common/libcommon.a(util.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/root/Desktop/libaacs/src/common/libcommon.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [src/libaacs/libaacs.so] Error 1
make[2]: Leaving directory `/root/Desktop/libaacs'
make[1]: *** [src/libaacs/CMakeFiles/aacs.dir/all] Error 2
make[1]: Leaving directory `/root/Desktop/libaacs'
make: *** [all] Error 2

If I try and run the binary I get /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by /usr/lib/libaacs.so) and if I rpm -qa |grep libstdc I see I'm running 4.1.2 (Now you already explained that and it totally makes sense which is why I was focusing on the compile)

If I run the command you'd asked Qubic to run I get -I/usr/kerberos/include
Annnd I'm running gcc 4.1.2

Thanks for all your efforts Zotty, I'm sure I'm just missing something.

Iskondi

Zotty
29th January 2008, 21:22
Hey Zotty,

Been following this thread for awhile now and I'm having either the exact same two issues as Qubic or very very similar. (Though I'm running on Centos 5.1 64bit) When I initially try and compile I get the ec.h file missing, then I throw on the "full source" for openssl and I get:

...


Ok, this is fixed. Some more stuff I found about this is that as a general rule it is not "portable" to link a static library into a
shared one. However, on most linux systems this is allowed. 64-bit systems do not allow this. And since you're using 64-bit this might be the smoking gun.


If I run the command you'd asked Qubic to run I get -I/usr/kerberos/include
Ok, the include is now properly (and dynamicly) added to the makefiles at configure time. That should solve the include file error once and for all... My OpenSSL never had any compiler flags, so I never took any notice... guess I should have :rolleyes:

edit: both are now available through SVN

Iskondi
30th January 2008, 20:15
Hey Zotty,

Thanks again for the quick turn around on that fix! Now I get a different error and I'm sorry if my lack of compiling skills are making me ask stupid questions :-)

/usr/bin/c++ -fPIC -I/root/libaacs/include -DMARKUP_STL -o src/common/CMakeFiles/common.dir/sqlitevolumekeyloader.o -c /root/libaacs/src/common/sqlitevolumekeyloader.cpp
/root/libaacs/src/common/sqlitevolumekeyloader.cpp: In member function ‘virtual bool SQLiteVolumeKeyLoader::FindVolumeKey(const std::string&)’:
/root/libaacs/src/common/sqlitevolumekeyloader.cpp:72: error: ‘sqlite3_prepare_v2’ was not declared in this scope
make[2]: *** [src/common/CMakeFiles/common.dir/sqlitevolumekeyloader.o] Error 1
make[2]: Leaving directory `/root/libaacs'
make[1]: *** [src/common/CMakeFiles/common.dir/all] Error 2
make[1]: Leaving directory `/root/libaacs'
make: *** [all] Error 2

Thanks again,

Iskondi

Zotty
30th January 2008, 22:19
There's no such thing as stupid questions, only stupid developers who don't have it 100% worked out yet ;)

It's something I'm working on for the next release. Try installing libsqlite3-dev. In the end it should be optional, but right now it's a work in progress that shouldn't affect normal working (except compiling in this instant).

uberjay
31st January 2008, 00:49
Man... I'm eagerly awaiting progress on the MKB v4 front. Alternatively, anyone interested in some industrial espionage to retrieve the master keys from the AACS-LA headquarters? (I'm joking... ;)

I just picked up Stardust, which sadly has a version 4 MKB, and is thus unreadable using the current hddvdfs.

A cool idea I was thinking about:

Integrating dvdfs (a fuse-based decrypting filesystem for DVDs) with hddvdfs, to get closer to a full AnyDVD solution on Linux. I know most software had the DVD decryption support built into it these days, but I think it would be pretty cool to centralize the decryption logic. Maybe in my copious amounts of free time...

Zotty
31st January 2008, 22:56
Yeah MKB v4 and hddvdfs is a problem. The reason I'm working on a sqlite database is to install a keydb as shared data in /usr/local/share or /usr/share. That would allow for applications like hddvdfs to have a central place to read keys from. Using cfg or xml files can still be used, but a key database makes more sense.
For MKB versions with a known processing key that one can be used and newer MKBs switch to the keydb. Or maybe for all MKB versions since the processing key approach only works with the Xbox drive hack. Thinking this up as I type...
Only difficulty is that it would render adding keys by hand undoable. So that would let's say require a dedicated app that auto detects an newly inserted disc, auto calcs the hash, extracts the movie title and only requires the vuk to be inserted manually.

That just leaves one problem unsolved.. .how to extract new vuks under Linux. Right now all solutions to do this only work under Windows if I'm not mistaken. Sniffing powerdvd drive communication and so forth. Since Linux has no official HD player app, there's nothing to sniff/bash.

Getting the root key would be amazing, but don't count on it. I work at a company that uses root keys to derive other keys from and if the AACS LA root key is protected in any similair way, there's no way we'll be getting the root key without someone getting into really serious trouble...

About combining css and aacs into one fuse filesystem. Nice idea!

skygod
3rd February 2008, 02:13
Would those windows apps run under a vmware player?

vmconverter and vmplayer are free and work really well.

Adub
3rd February 2008, 02:55
I second the css + aacs fuse filesystem idea! It would really make linux more attractive for lots of dvd/hddvd rippers.

NeonMan
3rd February 2008, 03:38
dvdfs works fine (I've made a post about it months ago), merging that project with decrypthd will allow it to develop further.
Yours is a very nice program, I hope it will be, with some others, the definetly blow to AACS

The project site -> http://home.jspenguin.org:81/dvdfs/
it compiles and works on debian (>=etch) i386 and amd64

Inventive Software
3rd February 2008, 04:46
So... does this work on all the current crop of HD-DVDs? Or are the MKBv4 discs currently out?

KenD00
3rd February 2008, 06:39
Currently, only AnyDVD HD can do MKBv4, even MKBv3 does not work if you don't have the XBox 360 HD-DVD drive :(.

:rolleyes:

Iskondi
15th February 2008, 23:55
Hey Zotty, been awhile since I could look into this, I'm not sure where to get libsqlite3-dev for centos5.1. Can you point me in the right direction?

Thanks!

Iskondi

Zotty
16th February 2008, 00:07
Weeeell, actually I stripped the sqlite stuff again. It was not usefull at this time and only added an extra dependency. If you have the latest SVN version it should no longer be used.

Iskondi
16th February 2008, 00:15
Well shoot, I just grabbed the latest and built it as described here: http://www.decrypthd.org/wiki/BuildLatest and I run into the same error... Unless I'm misreading it and it is different... Running on Centos 5.1 64bit

/root/libaacs/src/common/sqlitevolumekeyloader.cpp: In member function âvirtual bool SQLiteVolumeKeyLoader::FindVolumeKey(const std::string&)â:
/root/libaacs/src/common/sqlitevolumekeyloader.cpp:73: error: âsqlite3_prepare_v2â was not declared in this scope
make[2]: *** [src/common/CMakeFiles/common.dir/sqlitevolumekeyloader.o] Error 1
make[2]: Leaving directory `/root/libaacs'
make[1]: *** [src/common/CMakeFiles/common.dir/all] Error 2
make[1]: Leaving directory `/root/libaacs'
make: *** [all] Error 2

And daaaamn you respond fast :-)

Iskondi

Zotty
16th February 2008, 00:19
Hmmmz, looking into it right now!

Was just pure luck since I just posted in another topic about the xbox drive firmware and checked if someone replied yet ;)

edit:
Looks like you're right. Fixing it.

edit 2:
fixed and commited to SVN!

Iskondi
16th February 2008, 00:51
Well that made it get a LOT farther! However, I'm still running into issues... I hate to keep taking up your time but now I see this...

Linking CXX executable decryptevob
cd /root/libaacs/tools/evobdecrypter && /usr/local/bin/cmake -P CMakeFiles/decryptevob.dir/cmake_clean_target.cmake
cd /root/libaacs/tools/evobdecrypter && /usr/bin/c++ -fPIC "CMakeFiles/decryptevob.dir/decrypthd_drive.o" "CMakeFiles/decryptevob.dir/evobdecrypter.o" -o decryptevob -rdynamic -L/root/libaacs/src/libaacs -L/root/libaacs/src/common -laacs -Wl,-Bstatic -lcommon -Wl,-Bdynamic -lssl -lcrypto -Wl,-rpath,/root/libaacs/src/libaacs:/root/libaacs/src/common
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_KEY_free'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_KEY_set_group'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_KEY_get0_group'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_POINT_free'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_KEY_set_public_key'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `ECDSA_do_sign'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_KEY_new'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `ECDSA_SIG_new'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_POINT_new'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_GROUP_new_curve_GFp'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_POINT_set_affine_coordinates_GF2m'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_POINT_mul'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EVP_ecdsa'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `ECDSA_SIG_free'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `ECDSA_do_verify'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_POINT_set_affine_coordinates_GFp'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_GROUP_set_generator'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_KEY_set_private_key'
/root/libaacs/src/libaacs/libaacs.so: undefined reference to `EC_POINT_point2bn'
collect2: ld returned 1 exit status
make[2]: *** [tools/evobdecrypter/decryptevob] Error 1
make[2]: Leaving directory `/root/libaacs'
make[1]: *** [tools/evobdecrypter/CMakeFiles/decryptevob.dir/all] Error 2
make[1]: Leaving directory `/root/libaacs'
make: *** [all] Error 2

Iskondi

Zotty
16th February 2008, 01:04
Looks like it can't find to openssl libs to link against, even though there's a "-lssl -lcrypto" in there... I did change the makefiles to use a seperate script to detect openssl. Maybe I've borked it again... also looking into this...

Iskondi
16th February 2008, 01:24
Sorry Zotty, it could be something on my side, but I thought if it made it through the configure aspect that I was good... Perhaps I'm still missing something?

Iskondi

addisor
16th February 2008, 18:27
Wow I think this is what I am looking for. Am I right to think I would would need UDF 2.5 for this to work? I've got a Pioneer Blu-Ray drive. Being a Ubuntu man, I'll prob wait for Hardy Heron (due April 2008) which has kernel 2.6.24-5.8 that i think has UDF built in. Any advice or suggestions on install?

qubic
16th February 2008, 19:08
Hi Zotty

I got the binary working. It's running really good.

So I wanted to compile it. But get this error:

In file included from /root/decrypthd/libaacs/src/common/Markup.cpp:11:
/root/decrypthd/libaacs/include/Markup.h: In member function ‘void CMarkup::ElemPos::ClearVirtualParent()’:
/root/decrypthd/libaacs/include/Markup.h:311: error: ‘memset’ was not declared in this scope
/root/decrypthd/libaacs/include/Markup.h: In member function ‘bool CMarkup::TokenPos::Match(CMarkup::MCD_CSTR)’:
/root/decrypthd/libaacs/include/Markup.h:358: error: ‘strncasecmp’ was not declared in this scope
/root/decrypthd/libaacs/include/Markup.h:359: error: ‘strchr’ was not declared in this scope
/root/decrypthd/libaacs/include/Markup.h:361: error: ‘strncmp’ was not declared in this scope
/root/decrypthd/libaacs/include/Markup.h:362: error: ‘strchr’ was not declared in this scope
/root/decrypthd/libaacs/src/common/Markup.cpp: In static member function ‘static std::string CMarkup::UnescapeText(CMarkup::MCD_CSTR, int)’:
/root/decrypthd/libaacs/src/common/Markup.cpp:447: error: ‘strtol’ was not declared in this scope
/root/decrypthd/libaacs/src/common/Markup.cpp: In static member function ‘static std::string CMarkup::UTF8ToA(CMarkup::MCD_CSTR, int*)’:
/root/decrypthd/libaacs/src/common/Markup.cpp:749: error: ‘wctomb’ was not declared in this scope
/root/decrypthd/libaacs/src/common/Markup.cpp: In static member function ‘static std::string CMarkup::AToUTF8(CMarkup::MCD_CSTR)’:
/root/decrypthd/libaacs/src/common/Markup.cpp:780: error: ‘mbtowc’ was not declared in this scope
make[2]: *** [src/common/CMakeFiles/common.dir/Markup.o] Error 1
make[2]: Leaving directory `/root/decrypthd/libaacs'
make[1]: *** [src/common/CMakeFiles/common.dir/all] Error 2
make[1]: Leaving directory `/root/decrypthd/libaacs'
make: *** [all] Error 2
[

could it be my version of cmake? I'm using 2.4.6-4.


--qub

mihanson
3rd June 2008, 03:40
Hmmm... Zotty, what happened to the website? Everything has seemed to disappear.

bb10
19th July 2008, 21:40
Yeah, where did it go?

robegue
12th August 2008, 10:18
Hello guys,

I just discovered the existence of dectypthd and this makes me so happy!
I've searched a lot over the net before finding this thread; it seems that this amazing tool is not very famous yet.
I'll diffuse the news through all the channels I know...


But it's 6 months that Zotty is disappeared, and the site is down... this scares me a lot, anybody has news?

Adub
13th August 2008, 20:56
One, quit yelling. That's what the font tells me.

Two, Zotty was on just a day ago. Look at his profile next time before exploding into a post. I am sure he will answer in the next few days.

Oopho2ei
14th August 2008, 19:56
Zotty has probably just abandoned the project. Only very few people here can reverse engineer the proprietary white-box attack-resistant aes implementations being used and extract the secret device keys. Those stories of entire families being slaughtered because someone posted a key on the internet are just not true. I have read about this quite often and it's sad people believe such things. Without new keys people simply stop working on their programs. Now that we have new processing keys we will hopefully see some progress again. :)