[INFO] Moto G IMEI=0

ol_st

Member
Aug 2, 2014
41
6
28
So, this is the tale:

- Tried to go back to stock (I had CM), but I failed hard.
- Went back to CM, no signal, WTF.
- Did a "fastboot getvar all", doesnt show IMEI
- Boot to CM, of course, *#06# shows an empty IMEI
- Said to myself, you ****ed up pal.
- Read thousand posts, tried almost everything.
- I give up, I have a ****ing tablet.
- Then I read this pal in the forum with similar case, he said "I flashed stock rom without sim card on"
- I thro, why the hell not? this **** is dead anyway.
- I download "exactly" the same stock rom for my phone, before I flashed a different version.
- **** works, my IMEI is back and I cant believe it.

Since then (1 week) has been working as normal.
Can you describe step-by-step.
 

betatan

Member
Aug 6, 2013
10
2
0
Copiapo
Your model of the phone (mine is xt1033 dual), the reason, why you lost IMEI (I made `erase all`), and how you recovered the stock.
I haven an xt1032, the .bat that came with the firmware had an "erase all", it was a .tar.gz file, ready to flash.

Correct firmware was a xml.zip file, only containing .bin and .img files, and I used mfastboot to flash them manually one by one. I did all of this without the SIM card inserted.
 

lost101

Inactive Recognized Contributor
May 30, 2008
7,434
9,328
0
If they are write protected then why can fastboot erase all erase it?
I'm not sure 'write-protected' is the correct term. The partitions are only accessible in fastboot mode. And because of that you are limited in your options of how you access them. No way to back up, no way to restore.
 

lost101

Inactive Recognized Contributor
May 30, 2008
7,434
9,328
0
Then why not flash a custom bootloader that allows access to those specific partitions.
The partitions are already accessible to current bootloader. The problem is that therefore you can only use fastboot commands. Look at the full list of fastboot cmds, and you will appreciate why this is so limiting.
 

skyguy126

Senior Member
Sep 17, 2014
454
110
43
github.com
The partitions are already accessible to current bootloader. The problem is that therefore you can only use fastboot commands. Look at the full list of fastboot cmds, and you will appreciate why this is so limiting.

That's all true but with a NAND dump we can modify the partition and do a fastboot flash. In this case modify the imei located in the partition. I'm not talking about retrieving the partition via fastboot.
 

lost101

Inactive Recognized Contributor
May 30, 2008
7,434
9,328
0
No custom bootloader exists and making one may require significant effort and possibly a reward.
 

skyguy126

Senior Member
Sep 17, 2014
454
110
43
github.com
Ok this is probably a n00b reply but today I flashed cm12 on my xt1032 and I was just messing around when I came across /proc/config To my surprise there was an imei folder there. I opened it up and it contained 3 files, raw, ASCII, and type. I opened up the ASCII file and sure enough it had my imei. Has this been discovered already and is it of any help?

Edit: there's another folder called "all" and inside it is a file (new and raw) with (what I think) are physical NAND locations. Under [imei:str] there are 15 of these things; [0x3Y]

The Y is a number in between 1 and 10.
 
Last edited:

ol_st

Member
Aug 2, 2014
41
6
28
Ok this is probably a n00b reply but today I flashed cm12 on my xt1032 and I was just messing around when I came across /proc/config To my surprise there was an imei folder there. I opened it up and it contained 3 files, raw, ASCII, and type. I opened up the ASCII file and sure enough it had my imei. Has this been discovered already and is it of any help?

Edit: there's another folder called "all" and inside it is a file (new and raw) with (what I think) are physical NAND locations. Under [imei:str] there are 15 of these things; [0x3Y]

The Y is a number in between 1 and 10.
I found this information without flashing to cm12: the folder /proc/config/imei consists several files, 'ascii' file contains my imei (only one). The strings in the file 'new' you have found are the hex-digits of your imei.

I have to add, that I can see my imei by choosing 'Bar code' in bootloader menu.

Question: why this information is not accessible?

PS I tried to wite imei using QPST and found that the NV is READONLY.... :(
 
  • Like
Reactions: japoina92

skyguy126

Senior Member
Sep 17, 2014
454
110
43
github.com
Is there a way to make it writeable? Can someone tell me how to do a NAND dump because I'm pretty sure it will help with this issue. We can modify the imei partition and reflash it through fastboot.
 
Last edited:

skyguy126

Senior Member
Sep 17, 2014
454
110
43
github.com
In the post below, I detail all partitions available and how to dump them. It is suspected that the actual 'imei partition' is not on this list because it is not available in Android, and can be only flashed to (and not dumped) via fastboot mode. I hope you can prove otherwise.


I believe there are more partitions than what you indicated. Go to /proc/partitions and open it with a text editor. Are the other partitions dumped the same way via the dd command?

EDIT: the link you gave me did not work. The output is:
Code:
dd: /sdcard/Partitions/DDR.img: No such file or directory
 
Last edited:

bludotos

Member
Aug 7, 2013
39
6
0
Yup, messed up imei. Shows in bootloaders barcode but not in "fastboot getvar all" and in the android settings. Also noticed my serial number is wrong.

Sent from my XT1032 using XDA Free mobile app
 

rootr

Senior Member
Oct 31, 2014
89
123
0
Srinagar
zeeshanhyder.com
Yup, messed up imei. Shows in bootloaders barcode but not in "fastboot getvar all" and in the android settings. Also noticed my serial number is wrong.

Sent from my XT1032 using XDA Free mobile app
Hello. If "fastboot erase all" messed up your imei then there is no way to get it back. Trust me i have spent a considerable time to retrieve it back. First all as i have mentioned earlier and with lost101, we agreed on the following:

1. fastboot erase all deletes IMEI
2. The following partitions are erased with above command: hob,dhob,fsc,modemst1,modemst2,fsg
3. fsg,modemst1,modemst2 are restored when flashing stock rom but not hob,dhob,fsc which implies IMEI is stored in one of those.
4. modem requests for read/write permission to dhob and hob on bootup further strengthening theory.
5. These partitions do not get mounted on bootup only in fastboot. So unless you have custom bootloader that can access these partitions in boot mode, there is probably no way to get IMEI back.

But, if you messed up your radio and your IMEI is "Unknown", then there is very much chance to get back your IMEI. Just flash compatible radio. This case happens mostly when flashing cyanogens or other custom firmwares. As you can read on other posts people flashed their stock back and hence their IMEI is restored which actually was never erased and was there the whole time.

Lastly, trying to write IMEI with NV writing method such as DFS or any other tool will not bring back IMEI as it doesnt really write anything. IMO NV_550 variable which holds IMEI in most devices is useless in MotoG as i checked with DFS, it gave error unknown variable meaning MOTO G does not support it.

Hope that helps. :)
 
  • Like
Reactions: lost101