Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
View Poll Results: Was this Guide useful?
Yes, I tried it and it woks. 5 55.56%
Yes, its useful but I haven't used it yet. 4 44.44%
No, I tried it and it does not work 0 0%
No, its not useful and I haven't tried it. 0 0%
Voters: 9. You may not vote on this poll

 
Post Reply+
Tip us?
 
ksubedi
Old
(Last edited by ksubedi; 31st July 2011 at 11:49 PM.)
#1  
ksubedi's Avatar
Recognized Developer - OP
Thanks Meter 1069
Posts: 270
Join Date: Nov 2010
Location: Boulder, CO, US

 
DONATE TO ME
Talking [GUIDE] Lost Part7Backup File, What to do now? [RESTORE IMEI]

You just rooted your Mytouch 4g using gfree. But for some reason you want to get back to stock again and unroot the device and lock the bootloader (s-on). If you used gfree, the only method would be to restore ur partition 7 backup file. But what if you dont have that file or if you lost it?

Lets start off by talking about partition 7 first. Partition 7 is the seventh partition on your emmc chip where all the device specific data like imei number are stored. It also contaiins a flag which control's the s-on/off status of the bootloader. Gfree patches the flag and makes your bootloader show "s-off" which is basically unlocking the bootloader. gfree automatically backup's your partition7 image file to your sd card which is named part7backup-xxxxxxx.bin . This file is the image or copy of your original parititon 7 where everything is stored. Gfree makes this backup so that you can restore it to stock if you need it later.

Ok so you lost it, what now? you could just get someone else's part7bin file from xda or somewhere else and replace ur's. But whats the problem with that? your imei number will be replaced with their and there will be 2 phones with the same imei on the same network. And according to what i have learnt, this is illegal. So how do u fix this? Well, there is a way, but what i am going to explain below will help you restore the imei of your phone to your own by using someone else's part7backup file.

PLEASE NOTE THAT CHANGING IMEI NUMBER TO SOMEONE ELSE'S IMEI IS ILLEGAL AND IS CONSIDERED A CRIME. PLEASE USE YOUR OWN IMEI NUMBER AND DO NOT POST YOUR PARTITION7BACKUP FILE IN PUBLIC! I TAKE NO RESPONSIBILY IF YOU BRICK OR DAMAGE YOUR PHONE BY USING THE STEPS BELOW. IT WORKED FOR ME SO IT SHOULD WORK FOR YOU AS WELL.


You will need to do some hex editing in order to do this, and every step is REQUIRED, if you dont follow every step carefully, you might BRICK your phone and no one but yourself will be responsible for that.

Instructions:

Warning : THIS MIGHT ERASE ALL YOUR DATA

1) Make up your mind to do some hardcore hacking with your phone (jk its not hardcore)

2) Get a hex editor, i would recomment 30 day trial of 010 editor. Get it here : http://www.sweetscape.com/download/d...010editor.html

3) Install it. Now dowload the attached part7.zip file and extract part7.bin file (DO NOT REPLACE THIS PART7 BIN FILE DIRECTLY YOU MIGHT BRICK YOUR PHONEE!! This file has the imei number removed)

4) Now right click the extracted part7.bin file and open with 010 editor (Or open the file with any other hex editor).



5) 010 Editor will pop up, scroll down till you get to address 0600h



5) As you can see on the image above, the 14 ++++++++++++++ bytes are where your imei number will go. I replaceed the original imei on the part7bin file with ++++++++++++++ for security reasons.

6) Get the original IMEI number of your phone from the back of your battery or from your phone's box if you have one.

7) Type it in notepad or somewhere and copy the first 14 numbers out of 15. The last number is automatically generated and is called imei check number. It is generated automatically using luhn algorithm.

DO NOT USE ANY OTHER IMEI NUMBER THAN YOUR OWN, ITS ILLEGAL! AND DO NOT PUT RANDOM NUMBERS IT MIGHT BRICK YOUR DEVICE!!



8) Go to 010 editor, select the 14 + signs, and right click them, and paste the copied imei.





9) The first 14 digits of your IMEI should be in yellow letters now.

10) Press CTRL+S to save the file.

11) Connect your phone, and put the edited part7.bin file on your sdcard.

12) If you are running stock ROM which is already rooted, skip to step 17

13) Download this file : http://www.megaupload.com/?d=V4NAODYZ
(You are about to restore your phone to stock rom, because we will need to push the part7bin file to your phone, and to do so emmc power cycling is necessary. Most other kernel's dont support modules needed to power cycle emmc. So you will need to use PD15IMG.zip method to get back to stock if you arent on it already.)

14) Put it on your sdcard.

15) Power down your phone and hold your volume down + power button till you get into a white screen with some stuff on it.

WARNING : DOING THE NEXT STEP WILL ERASE ALL YOUR DATA!

16) Press power to get into boorloader mode. Wait till it scans the PD15IMG.zip file. Then press volume up when asked. Wait till it completes and restarts into your stock rom.

17) Download Visionary from here : http://android.modaco.com/topic/3203...ne-click-root/ and install it on your phone.

18) Turn on usb debugging and temp-root the phone using visionary if not rooted already.

19) Install adb drivers and install android sdk : follow instructions here if you havent already : http://forum.xda-developers.com/showthread.php?t=928370

20) Connect your phone to pc, and change usb mode to "Charge Only". (!IMPORTANT)

21) Now download the gfree.zip file attached and extract it somewhere.

22) If you are on windows vista and up, hold down shift button and right click on the extracted gfree folder. Choose open command window here. (if not on win 7 or vista, open cmd and navigate to the folder).



23) Type the following in the command window as it is, do not change anything if you dont know what you are doing.

Quote:
adb push gfree /data/local
adb shell
24) Now you should see a $ sign in the front. Type the following, press enter and press allow on your phone's screen when asked.

Quote:
su
25) You should see a # sign now instead of $. Now use the follwing commands:

Quote:
cd /data/local
chmod 777 gfree
./gfree -f
dd if=/sdcard/part7.bin of=/dev/block/mmcblk0p7
reboot
26) Your phone will reboot now. And if everything worked perfect, you will see your original imei. To check this open dialer and type *#06# . If you get original imei, then you're done, you will have stock rom with original imei and everything. Enjoy

This was definitely not a easy task, but after working on it for whole night and risking my phone (i could have bricked it), i finally got mine working. Now you can root and do everything else. But just dont forget to save the original part7backup file in safe place if you use gfree again Peace

I TAKE NO RESPONSIBILITY WHAT SO EVER IF ANYTHING GOES WRONG WITH YOUR PHONE! USE AT YOUR OWN RISK.

MODS: I could make an easy part7bin generator for windows, but i am not sure if that would be illegal or if i would be allowed to publish that on xda. Please guide me on this. I am sure an generator would make a lots of things easier.
Attached Files
File Type: zip gfree.zip - [Click for QR Code] (573.2 KB, 725 views)
File Type: zip part7.zip - [Click for QR Code] (36.4 KB, 840 views)
Devices: Nokia 1600 -> Sony Ericsson K660i -> Nokia X3 -> BlackBerry Pearl 8120 -> Samsung Feature Phone -> myTouch 3G -> myTouch Slide 3G -> Motorola Defy -> HTC HD2 -> Samsung Galaxy S Vibrant -> myTouch 4g -> Nexus S -> Nexus One -> HTC HD2 -> G2 -> Sensation 4g -> LG Optimus 3D -> HTC One S -> Nexus 4




Follow Me On Twitter
or Check My Blog http://wireshock.com
The Following 9 Users Say Thank You to ksubedi For This Useful Post: [ Click to Expand ]
I2IEAILiiTY Old
#2  
Guest
Thanks Meter
Posts: n/a
Quote:
Originally Posted by ksubedi View Post
You just rooted your Mytouch 4g using gfree. But for some reason you want to get back to stock again and unroot the device and lock the bootloader (s-on). If you used gfree, the only method would be to restore ur partition 7 backup file. But what if you dont have that file or if you lost it?

Lets start off by talking about partition 7 first. Partition 7 is the seventh partition on your emmc chip where all the device specific data like imei number are stored. It also contaiins a flag which control's the s-on/off status of the bootloader. Gfree patches the flag and makes your bootloader show "s-off" which is basically unlocking the bootloader. gfree automatically backup's your partition7 image file to your sd card which is named part7backup-xxxxxxx.bin . This file is the image or copy of your original parititon 7 where everything is stored. Gfree makes this backup so that you can restore it to stock if you need it later.

Ok so you lost it, what now? you could just get someone else's part7bin file from xda or somewhere else and replace ur's. But whats the problem with that? your imei number will be replaced with their and there will be 2 phones with the same imei on the same network. And according to what i have learnt, this is illegal. So how do u fix this? Well, there is a way, but what i am going to explain below will help you restore the imei of your phone to your own by using someone else's part7backup file.

PLEASE NOTE THAT CHANGING IMEI NUMBER TO SOMEONE ELSE'S IMEI IS ILLEGAL AND IS CONSIDERED A CRIME. PLEASE USE YOUR OWN IMEI NUMBER AND DO NOT POST YOUR PARTITION7BACKUP FILE IN PUBLIC! I TAKE NO RESPONSIBILY IF YOU BRICK OR DAMAGE YOUR PHONE BY USING THE STEPS BELOW. IT WORKED FOR ME SO IT SHOULD WORK FOR YOU AS WELL.


You will need to do some hex editing in order to do this, and every step is REQUIRED, if you dont follow every step carefully, you might BRICK your phone and no one but yourself will be responsible for that.

Instructions:

Warning : THIS MIGHT ERASE ALL YOUR DATA

1) Make up your mind to do some hardcore hacking with your phone (jk its not hardcore)

2) Get a hex editor, i would recomment 30 day trial of 010 editor. Get it here : http://www.sweetscape.com/download/d...010editor.html

3) Install it. Now dowload the attached part7.zip file and extract part7.bin file (DO NOT REPLACE THIS PART7 BIN FILE DIRECTLY YOU MIGHT BRICK YOUR PHONEE!! This file has the imei number removed)

4) Now right click the extracted part7.bin file and open with 010 editor (Or open the file with any other hex editor).



5) 010 Editor will pop up, scroll down till you get to address 0600h



5) As you can see on the image above, the 14 ++++++++++++++ bytes are where your imei number will go. I replaceed the original imei on the part7bin file with ++++++++++++++ for security reasons.

6) Get the original IMEI number of your phone from the back of your battery or from your phone's box if you have one.

7) Type it in notepad or somewhere and copy the first 14 numbers out of 15. The last number is automatically generated and is called imei check number. It is generated automatically using luhn algorithm.

DO NOT USE ANY OTHER IMEI NUMBER THAN YOUR OWN, ITS ILLEGAL! AND DO NOT PUT RANDOM NUMBERS IT MIGHT BRICK YOUR DEVICE!!



8) Go to 010 editor, select the 14 + signs, and right click them, and paste the copied imei.





9) The first 14 digits of your IMEI should be in yellow letters now.

10) Press CTRL+S to save the file.

11) Connect your phone, and put the edited part7.bin file on your sdcard.

12) If you are running stock ROM which is already rooted, skip to step 17

13) Download this file : http://www.megaupload.com/?d=V4NAODYZ
(You are about to restore your phone to stock rom, because we will need to push the part7bin file to your phone, and to do so emmc power cycling is necessary. Most other kernel's dont support modules needed to power cycle emmc. So you will need to use PD15IMG.zip method to get back to stock if you arent on it already.)

14) Put it on your sdcard.

15) Power down your phone and hold your volume down + power button till you get into a white screen with some stuff on it.

WARNING : DOING THE NEXT STEP WILL ERASE ALL YOUR DATA!

16) Press power to get into boorloader mode. Wait till it scans the PD15IMG.zip file. Then press volume up when asked. Wait till it completes and restarts into your stock rom.

17) Download Visionary from here : http://android.modaco.com/topic/3203...ne-click-root/ and install it on your phone.

18) Turn on usb debugging and temp-root the phone using visionary if not rooted already.

19) Install adb drivers and install android sdk : follow instructions here if you havent already : http://forum.xda-developers.com/showthread.php?t=928370

20) Connect your phone to pc, and change usb mode to "Charge Only". (!IMPORTANT)

21) Now download the gfree.zip file attached and extract it somewhere.

22) If you are on windows vista and up, hold down shift button and right click on the extracted gfree folder. Choose open command window here. (if not on win 7 or vista, open cmd and navigate to the folder).



23) Type the following in the command window as it is, do not change anything if you dont know what you are doing.



24) Now you should see a $ sign in the front. Type the following, press enter and press allow on your phone's screen when asked.



25) You should see a # sign now instead of $. Now use the follwing commands:



26) Your phone will reboot now. And if everything worked perfect, you will see your original imei. To check this open dialer and type *#06# . If you get original imei, then you're done, you will have stock rom with original imei and everything. Enjoy

This was definitely not a easy task, but after working on it for whole night and risking my phone (i could have bricked it), i finally got mine working. Now you can root and do everything else. But just dont forget to save the original part7backup file in safe place if you use gfree again Peace

I TAKE NO RESPONSIBILITY WHAT SO EVER IF ANYTHING GOES WRONG WITH YOUR PHONE! USE AT YOUR OWN RISK.

MODS: I could make an easy part7bin generator for windows, but i am not sure if that would be illegal or if i would be allowed to publish that on xda. Please guide me on this. I am sure an generator would make a lots of things easier.
I thought there was hope for me until I saw how long this was...maybe a vid for those uncertain?

Sent from my HTC Glacier using XDA Premium App
 
j0e_ahm
Old
#3  
j0e_ahm's Avatar
Senior Member
Thanks Meter 15
Posts: 141
Join Date: Jul 2011
Location: Anaheim, CA
Nice work. thanks for this.
ROM Creamed Glacier Beta 5.0
Kernel DARKSIDE v13-ICS BETA

Phone HTC Glacier / MT4G (S-OFF)
Radio 26.13.04.19_M
hboot Engineering 85.2007
Recovery 4EXT Recovery Touch v1.0.0.3 Beta 2
Notes Bad Screen and bad emmc chip
 
VolcanicSkunk
Old
#4  
VolcanicSkunk's Avatar
Senior Member
Thanks Meter 161
Posts: 801
Join Date: Apr 2010
Location: Ohio
This is awesome! Great work! I hope I never have to try this out!

Sent from my HTC Glacier using XDA Premium App
 
encrypti0n
Old
(Last edited by encrypti0n; 1st August 2011 at 06:37 PM.) Reason: typos
#5  
Senior Member
Thanks Meter 3
Posts: 114
Join Date: Jun 2010
Location: Glendora
Cant you just flash the PD15IMG, then once you have stock (but still have s-off) get visionary and temp root, then:

ON YOUR PC or Terminal Emulator
(YOU NEED gfree)
Unzip gfree_06.zip to a place on your computer/sdcard. Open a terminal or command window, navigate to where the files are on your computer/phone, and type:
$ adb push gfree /data/local/tmp/gfree
$ adb shell chmod 777 /data/local/tmp/gfree
gfree should now be in your phone at /data/local/tmp
IN THE ROOT SHELL (in the first terminal/command) : Now run:
# /data/local/tmp/gfree -s on -c T-MOB010
# sync
Remove the PD15IMG.zip and the tools from the phome:
# rm /sdcard/PD15IMG.zip
# rm /data/local/tmp/gfree
Disconnect your phone from USB and power it down.
Boot into hboot by holding <Vol-Down> while powering on.

Similar method worked on my G2 when i needed it back to stock/ lost my part7.bin
 
ksubedi
Old
#6  
ksubedi's Avatar
Recognized Developer - OP
Thanks Meter 1069
Posts: 270
Join Date: Nov 2010
Location: Boulder, CO, US

 
DONATE TO ME
Quote:
Originally Posted by I2IEAILiiTY View Post
I thought there was hope for me until I saw how long this was...maybe a vid for those uncertain?

Sent from my HTC Glacier using XDA Premium App
Well its might look difficult but if you follow through the tutorial, it is really easy. And i have no plans for video right now but if i get a lot of requests, ill make one


Quote:
Originally Posted by encrypti0n View Post
Cant you just flash the PD15IMG, then once you have stock (but still have s-off) get visionary and temp root, then:

ON YOUR PC or Terminal Emulator
(YOU NEED gfree)
Unzip gfree_06.zip to a place on your computer/sdcard. Open a terminal or command window, navigate to where the files are on your computer/phone, and type:
$ adb push gfree /data/local/tmp/gfree
$ adb shell chmod 777 /data/local/tmp/gfree
gfree should now be in your phone at /data/local/tmp
IN THE ROOT SHELL (in the first terminal/command) : Now run:
# /data/local/tmp/gfree -s on -c T-MOB010
# sync
Remove the PD15IMG.zip and the tools from the phome:
# rm /sdcard/PD15IMG.zip
# rm /data/local/tmp/gfree
Disconnect your phone from USB and power it down.
Boot into hboot by holding <Vol-Down> while powering on.

Similar method worked on my G2 when i needed it back to stock/ lost my part7.bin
Well yes, this method will work if you havent replaced your part7bin with another one found on xda already. But if you have replaced it, like i did, you will have to hex edit the part7bin to restore your imei number. But thanks for pointing it out
Devices: Nokia 1600 -> Sony Ericsson K660i -> Nokia X3 -> BlackBerry Pearl 8120 -> Samsung Feature Phone -> myTouch 3G -> myTouch Slide 3G -> Motorola Defy -> HTC HD2 -> Samsung Galaxy S Vibrant -> myTouch 4g -> Nexus S -> Nexus One -> HTC HD2 -> G2 -> Sensation 4g -> LG Optimus 3D -> HTC One S -> Nexus 4




Follow Me On Twitter
or Check My Blog http://wireshock.com
 
crawler9
Old
#7  
crawler9's Avatar
Senior Member
Thanks Meter 47
Posts: 403
Join Date: Mar 2010
Location: Kettering, Ohio

 
DONATE TO ME
Thanks for this, ksubedi. I wonder how many people were using the same IMEI from the file posted in the unroot thread I used long ago. Other than the IMEI, are the part7.bin files identical?
If I or anyone else has helped you, please click thanks!

My current devices:
  • myTouch 4G- Android Revolution HD
  • Toshiba Thrive 10" 16GB- DaleNet IMM76D.01.000072314 Deodexed Stock Rooted ROM (US ICS 4.0.4)
Join Dropbox?
Join Minus?
 
eqjunkie829
Old
#8  
eqjunkie829's Avatar
Senior Member
Thanks Meter 430
Posts: 1,366
Join Date: Apr 2011
Location: West Jordan, UT

 
DONATE TO ME
I lost my part7backup file from a bad SDcard awhile ago and I would like to at least have the file ready incase i need to return or exchange the phone. Can i follow steps 2-10 to get the file and just not do any additional steps?
 
XxKOLOHExX
Old
#9  
XxKOLOHExX's Avatar
Senior Member
Thanks Meter 12
Posts: 3,112
Join Date: Aug 2009
Location: Hawaii
OMG Thanks dude so much --

I thought I wouldn't ever get my phone back to S-On haha Now I can get the real update for my phone (2.3.4)

Thanks again
T-Mobile Mytouch 4G
Rom : CM7 [Hourlies]
Recovery : CWM 3.0.0.5
Twitter : http://twitter.com/XxKOLOHExX
 
maymui
Old
#10  
Junior Member
Thanks Meter 0
Posts: 17
Join Date: Apr 2010
Hi,
Does it matter if the other Part7backup is from a phone with a different RUU/Radio?

 
Post Reply+
Tags
gfree, hboot, imei, mt4g, unroot
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...