Help - Search - Members - Calendar
Full Version: Secure ripping on OS X
Hydrogenaudio Forums > CD-R and Audio Hardware > CD Hardware/Software
sbooth
I've hacked together a command-line ripper for OS X that basically:
  1. Reads a contiguous set of sectors one at a time off of a CD and saves them to a temporary file
  2. Re-reads the same set of sectors and saves them to a different file
  3. Compares the two files sector by sector (2352 bytes at a time)
  4. Writes matching sectors to a third file, and zeroes out non-matching sectors
  5. Prints out any differences it finds

This is the beginnings of Legg's method outlined in this thread.

This was more of a proof of concept than anything. And here is the interesting part- I am unable (in my short testing cycle) to get different read results! It makes no sense to me. First I tried ripping just a single track a few times. When this failed to cause any problems, I ripped a ton of sectors (207943 to be exact). I got this:

CODE
Using cdrom /dev/rdisk2
Ripping sectors 0 to 207942 (207943 total)
Performing first read
Performing second read
Comparing two reads


Maybe I need to try with some old scratched-up CDs, but nonetheless I was surprised. I don't quite see how not even one byte could be different in two files this large that were read off a cd using ioctl().

CODE
-rw-------    1 me        wheel  489081936 Mar 22 15:32 riposx2GhmbA.rip
-rw-------    1 me        wheel  489081936 Mar 22 15:28 riposxQrOeHx.rip


I'll be happy to share the code if anyone wants to take a look at it.

Would reading the sectors one at a time cause any different result than reading a larger chunk? I imagine that, regardless of the read size, the drive will fill its buffer in anticipation of further reads.
kl33per
Drive caching perhaps?
kritip
Doubtful its drive caching. Pressuming a sector is 2352 bytes and 1024 bytes to a KB etc then the large rip of 207943 sectors gives:

CODE

(207943 x 2352) /1024 /1024 = 466.4 MB


At least i think i worked that out correctly, feel free to tell me i got it all wrong lol smile.gif


I guess its just not a very scratched disc smile.gif If you PM the code, if it's C or Java, or send a ppc binary, then i could try it on some of my VERY scratched discs lol. I swapped my drive for a Pioneer K06 drive in my powerbook the other day, so may have different results.

Cheers,

Kristian

//edit -- try running md5 check on both the files to double check they are the same.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.