DecloQing Copy Protection

by Pack Rat Sam

I am not a music pirate.  I am a Canadian though (Hi Mom !), so all those nasty DMCA rules don't (currently) apply to me.

I own a few hundred CDs, all (100 percent legally) ripped and encoded.  I don't even own a stereo system, just my computer.  (Keeping my computer up to date enough to play the latest games is plenty expensive enough as it is!)  When I buy a new CD, the first thing I do when I get it home is drop it into my computer, rip all the tracks, and encode to MP3.

Imagine my horror when I bought a disc that told me:

"This audio CD is protected by SunnComm [TM] MediaCloQ [TM] Ver 1.0.  It is designed to play in standard Audio CD players only and is not intended for use in DVD players."

And sure enough, if I put the disc into my drive, all my ripping program could see was a bunch of data tracks.  I had to beg, plead, and borrow to use somebody else's portable CD player just to listen to one disc.

How MediaCloQ Works

MediaCloQ supposedly "protects" audio CDs in two ways:

1.)  Deliberate errors are introduced into the audio datastream so that ripping programs introduce pops and clicks into the ripped data.  Normal CD players have circuitry designed to cope (more or less) with corrupt data, such as caused by scratched discs, so they can interpolate the missing data with the listener none the wiser.

2.)  The tracks are marked as data tracks so that a computer won't recognize them as audio.  All of the audio data is still there, laid out on the disc exactly as you would expect, except that you can't pick a track and select "Play."  Somehow this didn't seem (to me at least) any more of a protection than that little "Copy Protected" bit that all CD rippers already ignore.  If you could just point your ripper at all the right sectors, all the audio data is sitting pretty right there for you, absolutely naked and unencrypted.

This cannot qualify as a "protection" device, because CD-ROM drives are designed to read raw sectors from a disc.  The only thing preventing ripping programs from extracting information from data tracks is that the data stored in non-audio tracks is not normally audio, and you wouldn't want to risk blowing your speakers by piping random noise through them!

cdparanoia

My favorite CD ripper under Linux has got to be cdparanoia, licensed under the GPL (its home page is www.xiph.org/paranoia).  This program was already designed to deal with the scratched CDs, so protection method one above is already dealt with effectively.  The only thing left to work around is the data versus audio bit.  Here's a few code snippets from cdparanoia, with the offending lines marked:

From cdparanoia-III-alpha9.8/main.c:

line : code

 899 : switch(cdda_open(d)){
 ...
 908 : default:
 909 : report("\nUnable to open disc.");
*910 : exit(1);
 911 : }

Function cdda_open returns "-403" if it cannot locate any audio tracks on the disc, which causes cdparanoia to die here.

 line : code

 1010 : for(i = track1; i <= track2; i++)
 1011 : if(!cdda_track_audiop(d, i)){
 1012 :   report("Selected span contains non audio tracks. Aborting.\n\n");
*1013 : exit(1);
 1014 : }

This section of the code is similar, except that here it is verifying, one-by-one, that each of the tracks you're trying to rip is marked as audio.  Any data tracks in the bunch and cdparanoia dies.  Bypass both of the lines marked *, and cdparanoia will happily read any sector on any disc, whether marked as data or audio.

The patch below adds a command-line option "-M" to do just that.

--- main.c.orig   Sat Aug 11 16:52:25 2001
+++ main.c        Sat Aug 11 16:52:31 2001
@@ -586,5 +586,5 @@
 }

-const char *optstring = "escCn:o:O:d:g:S:prRwafvqVQhZz::YXWBi:Tt:";
+const char *optstring = "escCn:o:O:d:g:S:prRwafvqVQhZzM::YXWBi:Tt:";

struct option options [] = {
@@ -662,4 +662,5 @@
  int query_only=0;
  int batch=0, i;
+ int MediaCloQ=0;

/* full paranoia, but allow skipping */
@@ -791,4 +792,7 @@
  sample_offset=atoi(optarg);
  break;
+ case 'M':
+ MediaCloQ = 1;
+ break;
  default:
    usage(stderr):
@@ -906,4 +910,7 @@
  case 0:
    break;
+ case -403:
+   if(MediaCloQ)
+     break:
  default:
    report("\nUnable to open disc."):
@@ - 1008,4 +1015,5 @@
  int i;

+ if(!MediaCloQ)
    for(i = track1; i<= track2; i++)
      if(!cdda_track_audiop(d, i)) {
Return to $2600 Index