Boot/Recovery repack utils for WINDOWS

Search This thread

michfood

Senior Member
Oct 29, 2009
216
320
NO MORE LINUX OR CYGWIN NEEDED!!!
...now it`s easy as 123...
Boot.img structure should be the same as shown here http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

1. For MTK (chineese) phones - use MTK_unpack.bat (MTK_pack.bat)
2. For android standart phones - use STD_unpack.bat (STD_pack.bat)

To unpack: - drag boot.img (recovery.img) to unpack.bat ("unpack.bat boot.img" in command line)
- will be created "boot" ("recovery") folder with unpacked ramdisk inside - you can make changes and:
To pack back: - drag output folder ("boot" or "recovery") to pack.bat
- will be created new_image.img

I did this successfully on Lenovo A789 MTK6577 - it 100% works fine.
I`ve repack boot and recovery for phones listed below - but have no possibility to check out on the phone - so any volunteers appreciated...
- Samsung Galaxy S i9001, Galaxy III, Note II
- HTC Desire V sense 4

Not work with:
- Samsung Galaxy Note I, Tab I

But be careful - make backup and be ready to flash bricked phone with your flash utility.

UPD. v4 - win8 x64 support
 

Attachments

  • 111.jpg
    111.jpg
    44.2 KB · Views: 20,725
  • 222.jpg
    222.jpg
    32.9 KB · Views: 18,559
  • 333.jpg
    333.jpg
    33.3 KB · Views: 17,551
  • 4444.jpg
    4444.jpg
    13.7 KB · Views: 11,915
  • ALL_phones_Boot_Recovery_repack_util_for_WINDOWS.rar
    2.5 MB · Views: 32,736
  • ALL_phones_Boot_Recovery_repack_util_for_WINDOWS_v2.rar
    2.5 MB · Views: 70,465
  • Boot_Recovery_Repack_Util_v4_win7-8_x64.rar
    2.5 MB · Views: 40,675
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Yeoh michfood, good job man...
thumbup.gif


i've been hunting up & down for something similar so that fellow xda member will be able to port compatible MT65xx cwmr to their device in Windows without the need of cygwin... :laugh:

Would you like to KANG my Android Kitchen plugins script here... :fingers-crossed:
 

michfood

Senior Member
Oct 29, 2009
216
320
Yeoh michfood, good job man...
thumbup.gif


i've been hunting up & down for something similar so that fellow xda member will be able to port compatible MT65xx cwmr to their device in Windows without the need of cygwin... :laugh:

Would you like to KANG my Android Kitchen plugins script here... :fingers-crossed:

glad to hear smth like that :victory:
hope it`ll helps to make some things easily
but TWRP is much better for me for a while

and I`ve my own kitchen to work around with apks and jars and all firmware at all - odex and deodex them, but I didn`t translate it to english yet http://forum.china-iphone.ru/viewtopic.php?f=31&t=19708
 
Last edited:

yuweng

Senior Member
Feb 5, 2012
1,172
4,226
Wow, i didn't know you are a
worthy.gif
Master Shifu...

Hope you do get it translated to english so that the world will benefit from your hard work too...
salute.gif
 

_polimorph_

Senior Member
Jan 23, 2012
556
1,125
Jibou, Transilvania
Thanks for the tool, it's compact and fast to work with.
Now at my first attempt to decompile it doesn't find some file and the ramdisk folder inside boot remains empty:

Code:
[total hits/matching patterns/non-matching patterns]
[298/1/0] bin\off2.txt
1 files checked, 1 changed.

- pagesize        - 2048
- size of image   - 7232000 byte
- ram_disk offset - 3272704

- split kernel...
3268608 bytes copied.
- extract ram_disk.gz...
3959296 bytes copied.
- unpack ram_disk.gz...
- unpack ram_disk.cpio...
[B]The system cannot find the file specified.[/B]
- copy source F:\Porting\ALL_phones_Boot_Recovery_repack_util_for_WINDOWS\boot.img to unpacked folder (to keep source image)...
Press any key to continue . . .
 
  • Like
Reactions: nik60

michfood

Senior Member
Oct 29, 2009
216
320
Smth. went wrong... can You give me your boot?
I have to say one thing - not ALL boot can be unpacked - some phones have they own boot structure - it is not correspond to this: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images - so my utility cannot process them.

For example it is Samsung Note (1) Samsung Galaxy Tab (1)... maybe other.


ps _polimorph_ - by the way... I have an interesting idea.
after unpacking gz archive - You should receive a file without extension in /boot folder - usually it is named "ram_disk" - and after that, my script uses it as source cpio archive to extract.
BUT! if in your boot this file was named "rmdisk" for example - script will stop after gz extraction - because were is no right-named cpio file to decompress.

this is easy to check
 
Last edited:

michfood

Senior Member
Oct 29, 2009
216
320
Alex93917
the structure of stock ROM for i9003 is:



and (!) my utility works fine with normalboot.img - but not (!) with boot.bin - it`s different part of ROM

 
Last edited:

bigrammy

Senior Member
Apr 8, 2011
2,962
2,592
huddersfield
Now Allowed to Post

NO MORE LINUX OR CYGWIN NEEDED!!!
...now it`s easy as 123...
Boot.img structure should be the same as shown here http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

1. For MTK (chineese) phones - use MTK_unpack.bat (MTK_pack.bat)
2. For android standart phones - use STD_unpack.bat (STD_pack.bat)

To unpack: - drag boot.img (recovery.img) to unpack.bat ("unpack.bat boot.img" in command line)
- will be created "boot" ("recovery") folder with unpacked ramdisk inside - you can make changes and:
To pack back: - drag output folder ("boot" or "recovery") to pack.bat
- will be created new_image.img

I did this successfully on Lenovo A789 MTK6577 - it 100% works fine.
I`ve repack boot and recovery for phones listed below - but have no possibility to check out on the phone - so any volunteers appreciated...
- Samsung Galaxy S i9001, Galaxy III, Note II
- HTC Desire V sense 4

Not work with:
- Samsung Galaxy Note I, Tab I

But be careful - make backup and be ready to flash bricked phone with your flash utility.

UPD. v2 - fixed some bags with STD unpack/pack

Hi michfood!
A massive thanks for this fantastic recovery and for all your help getting it to work on my MTK6575 GB v2.3.6 device :angel:

I was not allowed to post here earlier because I was a noob but i am sure you have helped many people without knowing it. Please Please keep up the great work us noob's :confused: would be toltally lost without you. :good:

Regards bigrammy.
 

bigrammy

Senior Member
Apr 8, 2011
2,962
2,592
huddersfield
uboot & nvram backup mtd is it possible?

Hi michfood,

Could I call upon you for help once again :eek:
TWRP is without any doubt the best most user friendly recovery :good:
It works flawlessly on my Zopo zp300+ MT6577 Android 4.0.4 (ICS) :good:

With the help you provided me already TWRP also works great on my HDC A9300 MT6575 Android v2.3.6 (GB) :D
I was wondering if I we could get TWRP to backup uboot & nvram on the mtd version like it does on emmc version :confused:

I am unsure of the difficulty in doing this or is it a matter of simply editing a few lines of text. :confused:
Could you please advice once again which file's script's I need to edit etc :eek:

Here are the mtd partitions again from my device for your info.

adb shell
$ cat /proc/mtd
cat /proc/mtd
dev: size erasesize name
mtd0: 00040000 00020000 "preloader"
mtd1: 000c0000 00020000 "dsp_bl"
mtd2: 00300000 00020000 "nvram"
mtd3: 00020000 00020000 "seccnfg"
mtd4: 00060000 00020000 "uboot"
mtd5: 00500000 00020000 "boot"
mtd6: 00500000 00020000 "recovery"
mtd7: 00120000 00020000 "secstatic"
mtd8: 00060000 00020000 "misc"
mtd9: 00300000 00020000 "logo"
mtd10: 000a0000 00020000 "expdb"
mtd11: 12700000 00020000 "system"
mtd12: 03c00000 00020000 "cache"
mtd13: 07f20000 00020000 "userdata"

Hope you can help :fingers-crossed:

Thanks. bigrammy
 

michfood

Senior Member
Oct 29, 2009
216
320
I suppose it`s better to ask such question in TWRP thread.
Possibly You can achieve that with changing smth. like vold.fstab.
But possibly not - because it may need to change source codes and recompile again whole recovery binary
 

bigrammy

Senior Member
Apr 8, 2011
2,962
2,592
huddersfield
I suppose it`s better to ask such question in TWRP thread.
Possibly You can achieve that with changing smth. like vold.fstab.
But possibly not - because it may need to change source codes and recompile again whole recovery binary

Thanks for your reply :good:
So not quite so easy then :eek: I thought it maybe a bit more complicated but I had to ask :laugh:
I will post the question over on the TWRP thread as you suggest to see if anyone there can help :fingers-crossed:

Thanks again michfood for your help & hard work on this tool :angel:

Regards. bigrammy :cowboy:
 

Ghostfreak NB

Senior Member
Aug 11, 2012
4,591
2,858
Mumbai
Experts,
Can you give any idea on Xperia boot structures!
Pls!
And would this work on Xperia 2011 series!
If not,why?

Sent from my MT11i using xda premium
 

cmoegele

Senior Member
Jun 4, 2008
185
42
I have problems to repack recovery.img for my Tegra3 device.

The script always say : access denied, pack rmdisk to cpio..., after this file not found , error unsupported page size0,....
Last try was simply repack the successfully unpacked folder. but fails :(

Any Idea ?

Best regards

cm
 
Last edited:

michfood

Senior Member
Oct 29, 2009
216
320
I have problems to repack recovery.img for my Tegra3 device.

The script always say : access denied, pack rmdisk to cpio..., after this file not found , error unsupported page size0,....
Last try was simply repack the successfully unpacked folder. but fails :(

Any Idea ?

Best regards

cm
which OS You use to? I hope it`s not win8? There are known problems with admin`s permissions
 

SiNtEnEl

Senior Member
Jun 23, 2007
112
69
which OS You use to? I hope it`s not win8? There are known problems with admin`s permissions

Windows 7 locks the rmdisk folder so the script will fail.
Exec: %~dp0bin\chmod og=xr rmdisk
Then Cd rmdisk will give:

Access is denied.

- pack rmdisk to cpio...
/usr/bin/find: `./rmdisk': Permission denied
28482 blocks
The system cannot find the file specified.

- pack rmdisk.cpio to gzip...

- make new image...
The system cannot find the file ../pagesize.txt

- pagesize

error: unsupported page size 0
The system cannot find the file specified.
- done.

Press any key to continue . . .
 

Top Liked Posts

  • There are no posts matching your filters.
  • 169
    NO MORE LINUX OR CYGWIN NEEDED!!!
    ...now it`s easy as 123...
    Boot.img structure should be the same as shown here http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

    1. For MTK (chineese) phones - use MTK_unpack.bat (MTK_pack.bat)
    2. For android standart phones - use STD_unpack.bat (STD_pack.bat)

    To unpack: - drag boot.img (recovery.img) to unpack.bat ("unpack.bat boot.img" in command line)
    - will be created "boot" ("recovery") folder with unpacked ramdisk inside - you can make changes and:
    To pack back: - drag output folder ("boot" or "recovery") to pack.bat
    - will be created new_image.img

    I did this successfully on Lenovo A789 MTK6577 - it 100% works fine.
    I`ve repack boot and recovery for phones listed below - but have no possibility to check out on the phone - so any volunteers appreciated...
    - Samsung Galaxy S i9001, Galaxy III, Note II
    - HTC Desire V sense 4

    Not work with:
    - Samsung Galaxy Note I, Tab I

    But be careful - make backup and be ready to flash bricked phone with your flash utility.

    UPD. v4 - win8 x64 support
    7
    Yeoh michfood, good job man...
    thumbup.gif


    i've been hunting up & down for something similar so that fellow xda member will be able to port compatible MT65xx cwmr to their device in Windows without the need of cygwin... :laugh:

    Would you like to KANG my Android Kitchen plugins script here... :fingers-crossed:
    5
    Yeoh michfood, good job man...
    thumbup.gif


    i've been hunting up & down for something similar so that fellow xda member will be able to port compatible MT65xx cwmr to their device in Windows without the need of cygwin... :laugh:

    Would you like to KANG my Android Kitchen plugins script here... :fingers-crossed:

    glad to hear smth like that :victory:
    hope it`ll helps to make some things easily
    but TWRP is much better for me for a while

    and I`ve my own kitchen to work around with apks and jars and all firmware at all - odex and deodex them, but I didn`t translate it to english yet http://forum.china-iphone.ru/viewtopic.php?f=31&t=19708
    4
    Wow, i didn't know you are a
    worthy.gif
    Master Shifu...

    Hope you do get it translated to english so that the world will benefit from your hard work too...
    salute.gif

    :eek: i`m just modest user of chineese phone - and while I`ve making it better - I`ve made some scripts - a lot of things i`ve got from this forum
    3
    Smth. went wrong... can You give me your boot?
    I have to say one thing - not ALL boot can be unpacked - some phones have they own boot structure - it is not correspond to this: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images - so my utility cannot process them.

    For example it is Samsung Note (1) Samsung Galaxy Tab (1)... maybe other.


    ps _polimorph_ - by the way... I have an interesting idea.
    after unpacking gz archive - You should receive a file without extension in /boot folder - usually it is named "ram_disk" - and after that, my script uses it as source cpio archive to extract.
    BUT! if in your boot this file was named "rmdisk" for example - script will stop after gz extraction - because were is no right-named cpio file to decompress.

    this is easy to check