Log in

View Full Version : Adding AACS to libdvdcss?


Accident
15th October 2008, 09:39
What is the current status on AACS decryption of BD and HDDVD? I recently added patches to libdvdread to enable the reading of UDF 2.50 images, so that I can access BDMV/STREAM/00001.m2ts and play those decrypted BD5 ISOs.

I have been tempted to further look at adding AACS to libdvdcss, even if only "simple support" (perhaps so that you have to manually supply the keys).

It doesn't directly have to be in libdvdcss of course, but all the dynamic loading library work in libdvdread has already been done.

I'm keeping a keen eye on the "Finally handling BD+" thread in here as it is exactly my hobby, but done in Java. But hopefully, other solutions will come from it.

Oopho2ei
15th October 2008, 11:09
What is the current status on AACS decryption of BD and HDDVD?
It is all fully documented and working if you have the necessary (high order) keys. KenD00 is maintaining both aacskeys (needed to calculate the low order keys from the high order keys; open source) and DumpHD (performs the actual decryption of the content material with the low order keys; KenD00 promised to make the source code public but hasn't done it yet :sad:).

I'm keeping a keen eye on the "Finally handling BD+" thread in here as it is exactly my hobby, but done in Java. But hopefully, other solutions will come from it.
Other people have written their own implementations but these are not available to the public (yet?). The lack of support for unsigned integers in java forces us to obfuscate the code to work around the various problems which arise as we only use unsigned integers. On the other hand the code runs on every architecture which is supported by sun/java which is a big plus.
The project desperately needs developers which are willing to make their code public. We currently have only one developer (schluppo) who maintains the java implementation. It's the first time he/she writes a program in java and the code is in a bad shape. I have temporary stopped my research to help to improve the source code but i am no experienced java programmer either.

We have a svn repository at assembla.com where we could upload the source code (any programming language) of your implementation. :script:

Accident
15th October 2008, 11:26
Oopho2ei:

I've been reading your forum, reminds me of the good old 8-bit days and the reverse engineering I did back then. Anyway, I know nothing of java at all, but I certainly know C, and assembler.All my sources are OpenSource, and I must admit it is very tempting, but I am not sure where to start, or if the reference docs that you have done (?) that I would need are easy to get/read/understand. I know DVD and CSS fairly well (..now) but BD is new.

Oopho2ei
15th October 2008, 12:04
Oopho2ei:

I've been reading your forum, reminds me of the good old 8-bit days and the reverse engineering I did back then. Anyway, I know nothing of java at all, but I certainly know C, and assembler.All my sources are OpenSource, and I must admit it is very tempting, but I am not sure where to start, or if the reference docs that you have done (?) that I would need are easy to get/read/understand. I know DVD and CSS fairly well (..now) but BD is new.
I have replied to this post here (http://forum.doom9.org/showthread.php?p=1196640#post1196640).

Accident
15th October 2008, 12:29
Superb, thanks, I shall do some reading...

Accident
17th October 2008, 15:00
I had a spare hour this afternoon, so I thought I would play a little.

I have not added many instructions yet, but I do wonder if LHI should not leave the lower 16 bits untouched, rather than set to 0? Anyway, it does very little but:


[dlx] initialised VM (PC=00001000)
[dlx] svm size 0007ECE4 (519396)
[dlx] loaded core 'dat/BDSVM/00000.svm'
[dlx] setPC (00001000 -> 00001000)
[dlx] 00001004 (I=2C): J (PC += 0000040): 00001044 = 00001004 + 0000040
[dlx] 00001048 (I=2F): BNEZ(PC += FFFFFFFC if R0 ): 00001048 += 0 if 0
[dlx] 0000104C (I=2F): BNEZ(PC += FFFFFFFC if R1 ): 0000104C += 0 if 0
[dlx] 00001050 (I=2F): BNEZ(PC += FFFFFFFC if R2 ): 00001050 += 0 if 0
[dlx] 00001054 (I=2F): BNEZ(PC += FFFFFFFC if R3 ): 00001054 += 0 if 0
[dlx] 00001058 (I=2F): BNEZ(PC += FFFFFFFC if R4 ): 00001058 += 0 if 0
[dlx] 0000105C (I=2F): BNEZ(PC += FFFFFFFC if R5 ): 0000105C += 0 if 0
[dlx] 00001060 (I=2F): BNEZ(PC += FFFFFFFC if R6 ): 00001060 += 0 if 0
[dlx] 00001064 (I=2F): BNEZ(PC += FFFFFFFC if R7 ): 00001064 += 0 if 0
[dlx] 00001068 (I=2F): BNEZ(PC += FFFFFFFC if R8 ): 00001068 += 0 if 0
[dlx] 0000106C (I=2F): BNEZ(PC += FFFFFFFC if R9 ): 0000106C += 0 if 0
[dlx] 00001070 (I=2F): BNEZ(PC += FFFFFFFC if R10): 00001070 += 0 if 0
[dlx] 00001074 (I=2F): BNEZ(PC += FFFFFFFC if R11): 00001074 += 0 if 0
[dlx] 00001078 (I=2F): BNEZ(PC += FFFFFFFC if R12): 00001078 += 0 if 0
[dlx] 0000107C (I=2F): BNEZ(PC += FFFFFFFC if R13): 0000107C += 0 if 0
[dlx] 00001080 (I=2F): BNEZ(PC += FFFFFFFC if R14): 00001080 += 0 if 0
[dlx] 00001084 (I=2F): BNEZ(PC += FFFFFFFC if R15): 00001084 += 0 if 0
[dlx] 00001088 (I=2F): BNEZ(PC += FFFFFFFC if R16): 00001088 += 0 if 0
[dlx] 0000108C (I=2F): BNEZ(PC += FFFFFFFC if R17): 0000108C += 0 if 0
[dlx] 00001090 (I=2F): BNEZ(PC += FFFFFFFC if R18): 00001090 += 0 if 0
[dlx] 00001094 (I=2F): BNEZ(PC += FFFFFFFC if R19): 00001094 += 0 if 0
[dlx] 00001098 (I=2F): BNEZ(PC += FFFFFFFC if R20): 00001098 += 0 if 0
[dlx] 0000109C (I=2F): BNEZ(PC += FFFFFFFC if R21): 0000109C += 0 if 0
[dlx] 000010A0 (I=2F): BNEZ(PC += FFFFFFFC if R22): 000010A0 += 0 if 0
[dlx] 000010A4 (I=2F): BNEZ(PC += FFFFFFFC if R23): 000010A4 += 0 if 0
[dlx] 000010A8 (I=2F): BNEZ(PC += FFFFFFFC if R24): 000010A8 += 0 if 0
[dlx] 000010AC (I=2F): BNEZ(PC += FFFFFFFC if R25): 000010AC += 0 if 0
[dlx] 000010B0 (I=2F): BNEZ(PC += FFFFFFFC if R26): 000010B0 += 0 if 0
[dlx] 000010B4 (I=2F): BNEZ(PC += FFFFFFFC if R27): 000010B4 += 0 if 0
[dlx] 000010B8 (I=2F): BNEZ(PC += FFFFFFFC if R28): 000010B8 += 0 if 0
[dlx] 000010BC (I=2F): BNEZ(PC += FFFFFFFC if R29): 000010BC += 0 if 0
[dlx] 000010C0 (I=2F): BNEZ(PC += FFFFFFFC if R30): 000010C0 += 0 if 0
[dlx] 000010C4 (I=2F): BNEZ(PC += FFFFFFFC if R31): 000010C4 += 0 if 0
[dlx] 000010C8 (I=30): LHI (R0 = 0000 << 16): 00000000 = 00000000 << 16
[dlx] 000010CC (I=19): ADDI(R29 = R29 + 115C): 4444 = 0 + 4444
[dlx] 000010D0 (I=30): LHI (R0 = 0000 << 16): 00000000 = 00000000 << 16
[dlx] 000010D4 (I=19): ADDI(R28 = R28 + 1000): 4096 = 0 + 4096
[dlx] 000010D8 fetch D7BD0000 (I=35); UNKNOWN
[dlx] released VM (PC=000010D8)


Amusing way to ensure the registers are all initialised to 0.

Oopho2ei
17th October 2008, 16:08
I have not added many instructions yet, but I do wonder if LHI should not leave the lower 16 bits untouched, rather than set to 0?
The player i have this information from loads the Instruction into a register. Then the register is shifted 16 bits to the left and the result is copied into to the target register.

Amusing way to ensure the registers are all initialised to 0.
You will see thousands of instructions which do nothing but testing the player implementation. If you find yourself stuck in an infinite loop then at least one of the tests has failed. ;)

You should post your results in our thread because this is off topic here and the moderators don't like that. :thanks:

derbeDeus
17th October 2008, 16:08
I have not added many instructions yet, but I do wonder if LHI should not leave the lower 16 bits untouched, rather than set to 0?
no, it is correct; like LUI on MIPS, paired with ADDIU usually.

Accident
17th October 2008, 23:33
Thanks. I will move to the other threads, I just didn't want to pollute it.

Oopho2ei
26th October 2008, 00:09
Have you thought about putting your code under GPL? I know there are probably patent issues but as far as i understand this the product has to fulfill all the claims of a patent in order to infringe it. If at least one of the claims is not fulfilled there should be no issue with patent infringement. Has anyone deeper knowledge of these legal issues? Is it possible to split the code in several standalone programs from different authors to circumvent patent claims?

Have there been such issues with CSS in the past?