How-to: Backup and restore your IMEI / MEID / EFS Data
THIS SHOULD NO LONGER BE USED.
PLEASE SEE THIS THREAD FOR RECOVERING YOUR IMEI - http://forum.xda-developers.com/show....php?t=1802024
I tried flashing AOKP on my S3 yesterday and had my IMEI value set to zero, a rare(ish) error that some users have been running into with AOKP and the unofficial Cyanogen builds for this phone. If your IMEI is lost and you don't have a backup, your phone is basically toasted. So, I had to get my phone replaced which wasn't much trouble.
After speaking with invisiblek we determined a way to back up the EFS partition (which is where the IMEI and MEID is stored).
You need to do this on a rooted phone, it's been tested only with root66. You need USB debugging on and adb on your computer.
dd if=/dev/block/mmcblk0p11 of=/sdcard/efs.sbn
adb pull /sdcard/efs.sbn
DD is a linux utility that can be used to copy data from point a to point b and many, many ways. What we did here is copied the EFS partition to a single file (and then copied it to your PC). The efs.sbn file was about 13.6mb, but I've heard reports as low as 10mb. We can reverse this process to restore as well:
adb push efs.sbn /sdcard/efs.sbn
dd if=/sdcard/efs.sbn of=/dev/block/mmcblk0p11
This time we wrote the backup file to the EFS partition. After doing this you need to dial *2767*3855# to re-provision your phone.
My experience: When installing AOKP, my IMEI was replaced with most of my MEID, even after reverting my rom to root66. (This causes mobile data not to work). After restoring my backup and provisioning, I regained full functionality of my data and phone. I haven't had a chance to try this with a phone where the IMEI is set to 0, but I think it's safe to assume this would fix that as well.
I would HIGHLY recommend
making a backup before doing anything to your phone. Making a backup is read-only is poses no chance of something going wrong.
EDIT: For clarification: If your IMEI is already messed up, this will NOT get it back. You need a backup from BEFORE it was corrupted.