summaryrefslogtreecommitdiffstats
path: root/dvdauth.c
diff options
context:
space:
mode:
authorlgb <lgb@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-20 14:32:09 +0000
committerlgb <lgb@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-20 14:32:09 +0000
commitcd663cd2f2ce800ad12918a33f030b85574bdfb8 (patch)
tree54f27a591b6678f7b2ab35df97b3900e41db58a5 /dvdauth.c
parentea0d313e21bd1e711db76c47f830996f6d8e36ae (diff)
downloadmpv-cd663cd2f2ce800ad12918a33f030b85574bdfb8.tar.bz2
mpv-cd663cd2f2ce800ad12918a33f030b85574bdfb8.tar.xz
command line requested DVD key support for Arpi :)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@547 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'dvdauth.c')
-rw-r--r--dvdauth.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/dvdauth.c b/dvdauth.c
index da6832c58a..cd3dcb94aa 100644
--- a/dvdauth.c
+++ b/dvdauth.c
@@ -23,6 +23,8 @@
char *dvd_device=NULL;
unsigned char key_disc[2048];
unsigned char key_title[5];
+unsigned char *dvdimportkey=NULL;
+int descrambling=0;
#include <linux/fs.h>
@@ -59,6 +61,30 @@ static void reset_agids ( int fd )
}
+int dvd_import_key ( unsigned char *hexkey )
+{
+ unsigned char *t=key_title;
+ int digit=4,len;
+ bzero(key_title,sizeof(key_title));
+// printf("DVD key: %s\n",hexkey);
+ for (len=0;len<10;len++) {
+// printf("-> %c\n",*hexkey);
+ if (!*hexkey) return 1;
+ if (*hexkey>='A'&&*hexkey<='F') *t|=(*hexkey-'A'+10)<<digit;
+ else if (*hexkey>='0'&&*hexkey<='9') *t|=(*hexkey-'0')<<digit;
+ else return 1;
+ if (digit) digit=0; else {
+ digit=4;
+ t++;
+ }
+ hexkey++;
+ }
+ if (*hexkey) return 1;
+ printf("DVD key (requested): %02X%02X%02X%02X%02X\n",key_title[0],key_title[1],key_title[2],key_title[3],key_title[4]);
+ descrambling=1;
+ return 0;
+}
+
int dvd_auth ( char *dev , int fd )
{
@@ -99,6 +125,8 @@ int dvd_auth ( char *dev , int fd )
}
close(devfd);
+ printf("DVD title key is: %02X%02X%02X%02X%02X\n",key_title[0],key_title[1],key_title[2],key_title[3],key_title[4]);
+ descrambling=1;
return 0;
}