[nzlug] Identifying fake SD cards
Robert Coup
robert.coup at onetrackmind.co.nz
Fri Sep 22 12:42:06 NZST 2006
Vik Olliver wrote:
> I think I've been sold a "fake" 1 GB SD card.
>
> What I need is a tool that will test the device and spot where duplicate
> sectors map in. This will allow me to go to the retailer with proof.
> Otherwise, I'm liable to get the "oh it's your PC" response, or "it
> formats OK to 1GB", neither of which are helpful.
>
> Just formatting or running a bad sector test does not detect sector
> wraparound on cunningly crafted fakes.
>
Hmm... if I hadn't left my last job i'd have hundreds of lines of
SD-card-testing-code and the docs and resources to go with it... :(
Why not write a script to raw-write the sector's address to each sector,
then read it back and compare? You should be able to do this by
accessing the raw block device. SD cards will always support sector
sizes of 512 bytes (and thats the minimum). But the actual physical NAND
erase blocks are more like 32*512=16KB (or bigger, up to around 64KB).
So, if its just got one flash chip wired where there should be two, you
only have to look at every 128MB (a 1GB card will be either 4x256 or
2x512 parts, or maybe 8x128). If it has a controller thats deliberately
cheating in a more complicated way then you may need to look at every 16KB.
Or the easier option (but not as cool): copy a CD ISO on then back off,
then compare MD5s... that should work anywhere, even under windows on
the PC in the shop.
I hate to say it but maybe you should buy from someone reputable like
flashcards.co.nz :)
Rob :)
More information about the NZLUG
mailing list