Fwd: Lookie lookie, faster code.

From: Carey Lening (carey@tstonramp.com)
Date: Tue Mar 13 2001 - 23:35:30 PST


>Date: Tue, 13 Mar 2001 12:07:43 -0800
>Subject: Lookie lookie, faster code.
>From: "Karee Swift" <clening@zdnetmail.com>
>To: dvd-discuss@eon.law.harvard.edu
>CC: carey@tstonramp.com
>
>I swear this is going to be a competition, efdtt.c, is now the shortest
>piece of dvd circumvention to date :) Another 7 line wonder, created
>by Charles Hannumm, is a mere 442 bytes. Its now the .sig of my email
>file I think.. Thank the register for this gem.
>
>
>http://www.theregister.co.uk/content/4/17568.html
> 13 March 2001
> Updated: 18:05 GMT
>
>
> Tiny C code bests seven-line DVD decoder
> By: Tony Smith
> Posted: 13/03/2001 at 18:03 GMT
>
>Coder Charles H Hannum has created the smallest program
>capable of decoding a Content Scrambling System (CSS) DVD file,
>beating last week's seven-line Perl shell script 442 bytes to 472
>excluding newline bytes).
>
>Hannum's C program, called efdtt, is no slouch, either. The
>programmer claims it can "descramble in excess of 21.5MBps" -
>faster than the DVD spec. allows for. The speed comes "without
>even particularly trying to optimise the I/O. This makes it pretty
>insignificant compared to the rest of the decoding process" = in
>other words, it's quick enough not to impede the MPEG 2 decode
>operation which turns the data into a moving image.
>
>Apparently, the latter may be a problem with qrpff, the Perl CSS
>descrambler written by Keith Winstein and Marc Horowitz, and
>posted on Carnegie Mellon University professor David Touretzky's
>DSS Descrambler Gallery Web site. Winstein and Horowitz' code
>was capable of supporting realtime decode and playback, but we're
>told the output was occasionally jerky.
>
>Hannum's code should allow smooth playback.
>
>Both scripts do what the controversial DVD-on-Linux utility DeCSS
>does - and demonstrate how simple CSS, the DVD standard's
>copyright protection mechanism, is to decode. The Motion Picture
>Association of America has been pretty successful in repressing the
>distribution of DeCSS, viewing it as a threat to movie industry
>copyright - and movie industry profits.
>
>"So what's the MPAA gonna do now?" Touretzky asks. "This code
>is small enough to put on a cocktail napkin. Commit to memory. Knit
>into a scarf. Whatever. It cannot be suppressed." ®
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>___________________________________________________________________
>To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
>all in one place - sign up today at http://www.zdnetonebox.com

Perl is amazing...

Usage:
qrpff 153 2 8 105 225 /mnt/dvd/VOB_FILE_NAME | extract_mpeg2 | mpeg2_dec -

#!/usr/bin/perl -w
# 531-byte qrpff-fast, Keith Winstein and Marc Horowitz <sipb-iap-dvd@mit.edu>
# MPEG 2 PS VOB file on stdin -> descrambled output on stdout
# arguments: title key bytes in least to most-significant order
$_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map{$_%16or$t^=$c^=(

$m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t^=(72,@z=(64,72,$a^=12*($_%16
-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h
=5;$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$
d=unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d>>12^$d>>4^
$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9,$_=$t[$_]^
(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval





This archive was generated by hypermail 2b29 : Fri Apr 27 2001 - 23:14:11 PDT