“Real” raw access of flash memory cards?

6

2

I have a 16GB microSDHC card that apparently was nuked by the phone (a friend's phone, not sure which, but I can find out): while taking pictures, it suddenly could no longer access/recognize the card. I was with her when it happened. We immediately switched off the phone, and didn't try to format the card or anything.

Using an SD-CardReader and Ubuntu, the device could still be recognized, and the complete 16GB could be read via dd without errors. However, 99% of the dd-dump were just zerobytes, although the card previously contained several GB of data. Only a very small fraction still contained data, and these fragments were scattered throughout the 16GB.

For example, the card originally contained a FAT32 file system. However, now the boot sector and partition table were zeroed out, as well as the first FAT copy, and most of the data. Curiously, the 2nd FAT copy was intact, as well as the root directory. I found (only) three partial JPGs in the dd-dump, and the interesting thing is the Exif-data from these JPGs suggests they were taken just before the card crashed.

So my questions are as follows:

  • Instead of using dd, which relies on the Linux usb mass storage drivers recognizing (and interpreting) the device, is there some other way to access even lower levels of information of the flash card (i.e., truly reading out the chip contents, instead of what usb_storage sees? Some form of FTL, JFFS etc.?)?
  • Was the data truly erased, or just tagged as "dirty" somewhere? It would be physically impossible for a phone to really overwrite 16GB of memory within seconds. So maybe there is a way to read out the real data ? Or is this generally only possible by dismantling the card and directly accessing the NAND(?)-device via specialized hardware?

I'd appreciate any pointers whatsoever - as my friend isn't really using computers beside her phone, she never bothered to ever copy any images from it to a safer place, so several hundred photos of friends&family would be lost :-/

Wolfram

Posted 2012-04-09T20:04:24.737

Reputation: 161

@grawity: That sounds suspiciously like an answer :-). Care to post it as such? – sleske – 2016-03-05T21:43:13.260

I don't really have a clue as to the real problem here but I've got a recommendation. The other day my wife switched on our digicam and was told it couldn't access the sd card inside. I tried inserting the card into my MacBook - wasn't recognized. Then I tried with the old XP PC and a card reader - same result.

After searching the Internet I came across http://recoverfab.com/. Sent the card there by mail, got receipt confirmation three days later and recovery confirmation another three days later. Worked a charm.

– Marcel Stör – 2018-10-30T09:39:09.163

2With SD cards, usb_storage is as low as you can get without physically opening the card and connecting to the chips. The card controller won't allow direct access otherwise (unlike, for example, the old xD cards). – user1686 – 2012-04-09T20:08:33.097

Answers

1

There is no standard or "built-in" way to tell an SD card to give you the raw NAND data.

This is speculation, but the microcontroller in SD cards probably implements some sort of Physical-Block-Address to Logical-Block-Address mapping, in order to do wear leveling. This PBA to LBA table is probably stored on NAND just like the actual data, is relatively small, probably keeps track of free blocks, and could indeed be overwritten in seconds.

is there some other way to access even lower levels of information of the flash card

If you desolder the NAND or solder external wires to it, find out what type of NAND it is, and rig some sort of interface to your PC you can dump the raw contents. You are facing a difficult reverse engineering task even after doing this as the format of the data is probably unique to the microcontroller on the SD card, and I couldn't imagine where you'd even begin to look for that information.

You may find this interesting, but probably not very useful. It seems that that SD cards have the equivalent of SCSI "Vendor Specific Commands" that are used to update firmware on the SD microcontroller. So theoretically it would be possible to upload a custom or modified SD microcontroller firmware that responds differently to read/write requests. Still, you'd only get to the same point described above. I don't know of any SD microcontroller custom firmwares or projects that actually exist.

LawrenceC

Posted 2012-04-09T20:04:24.737

Reputation: 63 487