Spam (madbodger) wrote,
Spam
madbodger

  • Mood:
  • Music:

data recovery

A while back, a friend of mine had his laptop drive lose a head right after his son was born. That drive had the only copies of the baby pictures. Ordinary disk recovery tools were flummoxed by having a large chunk of the filesystem gone. So I wrote some tools to recognize and recover contiguous files from raw data.

I started with some code I found on the web to recover JPEG files. It didn't work very well. It turns out that this code simply assumed that a certain byte sequence meant the end of a JPEG file. While it is the JPEG end-of-data sequence, that combination of bytes can occur elsewhere in the file, and it turns out that his camera happened to put that sequence in the JPEG header, resulting in all of the files from that camera being truncated.

So I coded up a smarter version, which actually understands the JPEG format. I also wrote code to find PDFs (he's a graphic artist, and Illustrator uses PDF format) and find PhotoShop documents. These programs recovered the majority of his lost files, including most of the baby pictures.

They're also useful for recovering data from corrupted or errantly reformatted or deleted Compact Flash cards and so forth. I'm making the source code available for others to use. JPEG tool: findjpeg2.c; PDF tool: findpdf.c; PhotoShop tool: findpsd.c.

Subscribe

  • Turntable reminiscences

    My first record player was a cheap red and white plastic affair with which I could play my stack of bright yellow 78s. It was the kind that had a…

  • Fixing a Kodak Carousel slide projector

    I was going through old family slides with the old family slide projector and noticed the focus motor was running continuously. I did some quick…

  • Old-style Polaroid photography

    One day, fizzgig and I were shopping at a knickknack store and found chromed resin casts of old cameræ. We remarked how they would fit our…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 10 comments

  • Turntable reminiscences

    My first record player was a cheap red and white plastic affair with which I could play my stack of bright yellow 78s. It was the kind that had a…

  • Fixing a Kodak Carousel slide projector

    I was going through old family slides with the old family slide projector and noticed the focus motor was running continuously. I did some quick…

  • Old-style Polaroid photography

    One day, fizzgig and I were shopping at a knickknack store and found chromed resin casts of old cameræ. We remarked how they would fit our…