Sunday, May 9, 2010

File recovery from SD cards

I have had some very bad luck with SD cards and micro SD cards in the past. This is probably caused by build-quality of the cards i buy: normally I just get the cheapest I can find off www.dealextreme.com. As well as that, I never take good care of my gadgets, so when they do finally give up the ghost, i blame it on bad design on the manufacturers part. On more than one occasion I have taken a good few pictures with my digital camera, only for the camera to report that the card has "cannot be accessed". Normally when this happens, I have found that its just a dodgy connection between the contacts on the micro SD card and the camera. By ejecting the micro-SD adapter and the micro-SD  card from the from the adapter and putting the whole lot back together again, Ive got the camera to read the camera again. However, sometimes even this has failed to work. In these situations, the problem was normally caused by a corrupted file-system on the card. When you plug these cards into a PC or Mac using a card reader, the OS will tell you that the "Disk is not formatted" or "The disk is not initialised".  Ive had some pretty good success with Data recovery software such as "Data Rescue II" at recovering the photos off these drives.

Now, a few days ago I was asked by a mate to have a look at a SD card that wouldnt talk to his camera. "Grand", I thought, "Il just use some file recovery software to get the photos back". Unfortunately, It wasnt that easy. The card couldnt be read by either my own camera or my SD card reader. On my Mac, it showed up as a 1Mb drive that couldnt be read or even formatted using Disk Utility. Ubuntu couldnt mount it, and neither could windows. Since i had nothing to loose, i decided to try something a little more drastic.

SD cards and USB flash drives are usually consist of two main chips: The Flash chip that contains the data, and a controller chip to do the communicating between the flash chip and the PC/device. Sometimes the controller chip can get damaged, resulting in an unreadable card, even though the actually data on the flash chip is fine. A few usb flash drive and SD card recovey websites offer file recovery by removing the flash chip from the device and reading the chip directly using an chip reader (http://www.sd-flash.com/ http://www.ssddfj.org/papers/SSDDFJ_V1_1_Breeuwsma_et_al.pdf).
A chip reader was out of my budget, so I thought i could try and use a old USB flash drive. If i remove the old flash chip from the usb drive and replace it with the chip from the SD card, hopefully I can read the data again.

Removing the chip from the SD card was easier than you might think. The pitch of the TSOP flash chip is too small to solder each leg off individually, Instead, you can just flood the whole side of the chip with solder, and gently lift the chip up. The legs can then be cleaned from excess solder using solder braid. A similiar method is used for soldering the chip to the USB flash drives pcb. You just place the chip onto to footprint taken up by the old chip. Then, carefully solder one corner leg on each side of the chip into its correct position. Flood each side of the chip with solder. Then, remove the excess solder using the solder braid. Finally, check each leg of the chip and make sure that there are no visible solder connections between the neighbouring legs.

Unfortunately, even after all this, the flash chip could still not be read by my laptop. Similarly to before, it showed up as a 8mb drive that could not be mounted/formatted on my Mac. From what i could see my soldering was fine, so my only conclusion is that either the flash chip itself is damaged, or else the controller chip on my usb drive wasnt compatible with the larger capacity flash chip on the SD card (1Gb and 4Gb respectively).

Wednesday, May 5, 2010

UPC Free Internet Givaway Extravaganza

About two years ago, I first heard about a few smart UK folks getting free interwebs off their cabling providers on the techwatch forums. At the time I thought it was a pretty nifty thing to try out here in Eire when i got the time. However, I forgot about this potential research project until I happened to come across a cheap NTL cable modem for sale.

The cable modem I bought was a Motorola surfboard 5101e. I made a JTAG cable using the schematic shown here: http://i43.tinypic.com/15wnsk7.jpg, although you can also use the much simplier one http://img255.imageshack.us/img255/4128/sb5100webstarblackcatou7.png (you can even omit the resistors if you want) or buy one for cheap off ebay http://cgi.ebay.co.uk/Blackcat-JTAG-CABLE-MOTOROLA-SURFboard-SB5100-SB5101_W0QQitemZ330423060795QQcmdZViewItemQQptZPCC_Modems?hash=item4ceebfc93b. At the mo mine looks like the cat made it, but give me a week or two and il make a proper one.

I connected it all up, installed "JTAG utility 1.3 by ToM" on the PC, and flashed with haxorwarellrev39-LITE.bin (available in the downloads section of www.sbhacker.net), using the flashing directions that came with the file.

When it said "flashing complete", I rebooted the modem, went to 192.168.100.1, and was happy-out to be greeted with the haxorware web gui.

So I conected the modem up to the "Tv" socket on the "NTL" labelled socket on the wall, and rebooted the modem. After searching for a bit (have a look in the top right corner of the web gui or the overview page for the modems status), it completed the following one after the other:

Acquire Downstream Channel Done
Obtain Upstream Parameters Done
Upstream Ranging Done
Establish IP Connectivity Done
Retrieve Time of Day Done
Negotiate security Done
Receive configuration Done
Register connection Done
Cable modem status Operational

However, further down the page, i noticed that the Configuration file that the device recieved was called "cm_unknown.bin". So I went to the Addresses page of the webgui, and bumped up the mac address of both the ethernet and the HFC by two places i.e "HFC: 34:34:34:34:34:34" became "HFC 34:34:34:34:34:36". I then clicked on save and reboot.

After doing this three times, The modem eventually received a "cm_express.bin" configuration file. Then i unplugged the ethernet from my PC, waited a bit, plugged it back in, and noticed that the PC got a new IP address. Then I was able to connect to the internet.

Im currently downloading at around 1mb (i.e, i get a full 700mb iso in about 5min) I tried bumping up the HFC mac address a few times, and managed to get a "cm_starter.bin" configuration file, but didnt notice any change in speed. I didnt spend much time messing around with this, but Il still look into getting higher speeds. There is probably some configuration file for businesses or high-end connections that should let me do that. Il keep you updated

For good general information on how Cable internet works and how to hack it look for the "Haynes Cable Modem Manual" on google. Just to note, when they say that you have to swap mac addresses with someone else on a different network segment, this isnt the case with UPC ireland as they seem to have less security as the NTL England.

Getting Meteor MMS, Data and Bluetooth tethering to work on an IPhone 2g

Getting my iphone to work properly on Meteor has turned out to be a huge pain in the behind. When i first received the iphone (about 18 months ago), i spent a good 2-3 hours trying everything from editing config files, rebooting the phone, etc. etc. to try and get it to talk to the meteor MMS and data servers. Eventually I did get the data working, only to be stung by meteors really expensive pay-as-you-go data plan at the time: 99c a day for a few megabytes. So I disabled EDGE with bossprefs and gave up....

However, a few things have changed lately that made me give it another go. First off, meteor announced a new PAYG package: Free meteor-meteor texts as well as 250mb data a month. 250mb is pretty poor, but for random browsing and push email, it should hopefully be adequate. Secondly, getting it to work on your iphone 2g has become alot easier on a iphone OS 3.1.2: No SSHing SCPing or editing config files is needed. So i decided to give it a shot:

  1. Fire up Cydia and go to "Manage->Sources->Edit->Add" and add this repository: hxxp://cydia.iphonemod.com.br/ (replace the "xx" with "tt").
  2. Click on "Done" and click on the iphonemod repository
  3. Install "iPhone 2G: Tethering, MMS, bluetooth profile"
  4. Restart your iphone
  5. Go back into Cydia and install the "Meteor Carrier Bundle"
  6. Exit Cydia, go into "Settings->Network->Cellular Data Network-> Reset Settings"
  7. Go to "network->settings->internet tethering" and click to enable it.
  8. Restart the iphone again.
MMS or Data still wouldnt work for me. However, after messing around for a while, I noticed that EDGE was still disabled in the app Bossprefs. So i enabled it and restarted the phone yet again. Finally, edge was working. When i connected the phone up to my MacBook by the usb cable, tethering was also working. However, MMS was not. That required another few steps:

  1. Go into "Settings->Messeges" and click on "MMS Messaging" to disable it.
  2. Go back into "Settings->Messeges" and click on "MMS Messaging" to enable it again
Woohoo, finally, MMS was working. You can test it out for yourself by sending yourself a picture message using the new camera icon in the message composer. Im not a fan of MMS tbh, 30cent a message is too spicy for my student pockets, but for drunken mates pictures or faking music festival wristbands (more on that later), it could prove useful.

Still to do:  Folks on T Mobile over in the Americas are reporting that they are able to get free data by changing their data APN address to a proxy compatible with the carrier network. I will have to try and see if this works on any of the irish carriers.

Stay frosty.