Skip to main content

[SCRIPTS] Unpack / repack MT65xx/MT83xx boot.img, recovery.img or logo.bin

If you are looking for a way to easily unpack / repack boot.img, recovery.img or logo.bin from your MediaTek device, don't look any further. Here you can find my own Perl scripts.

Scripts were first based on the ones available onAndroid-DLS WiKi, but are now highly modified in order to work with specific MTK boot and recovery images. The scripts fully work with every image from all known MediaTek SoC:
  • MT6516
  • MT65x3 (MT6513 and MT6573)
  • MT65x5 (MT6515 and MT6575)
  • MT6577
  • MT65x2 (MT6572, MT6582 and MT6592)
  • MT6589
  • MT83xx (MT8377 and MT8389)
  • MT6595

The most up to date version of the scripts is always available at my public github repository:bgcngm/mtk-tools. Scripts require Perl v5.14+ to be installed and were fully tested under Ubuntu 12.04 as well as Windows 7 x64 (using Cygwin).

Please don't just leech the files and go away. You can easily say thanks just by pressing "Thanks" button.
Unpack script usage:
Code:
Usage: unpack-MTK.pl <infile> [COMMAND ...]
  Unpacks boot, recovery or logo image

Optional COMMANDs are:

  -info_only
    Display boot or recovery image information only
     (useful to check image information without unpacking)

  -kernel_only
    Extract kernel only from boot or recovery image

  -ramdisk_only
    Extract ramdisk only from boot or recovery image

  -force_logo_res <width> <height>
    Forces logo image file to be unpacked by specifying image resolution,
    which must be entered in pixels
     (only useful when no zlib compressed images are found)

  -invert_logo_res
    Invert image resolution (width <-> height)
     (may be useful when extracted images appear to be broken)
Repack script usage:
Code:
Usage: repack-MTK.pl <COMMAND ...> <outfile>

COMMANDs are:

  -boot [--more_verbose] <kernel> <ramdisk-directory>
    Repacks boot image

  -recovery [--more_verbose] <kernel> <ramdisk-directory>
    Repacks recovery image

  -logo [--no_compression] <logo-directory>
    Repacks logo image
Version history:
  • modified to work with MT6516 boot and recovery images (17-03-2011)
  • included support for MT65x3 and eliminated the need of header files (16-10-2011)
  • added cygwin mkbootimg binary and propper fix (17-05-2012)
  • included support for MT65xx logo images (31-07-2012)
  • fixed problem unpacking logo images containing more than nine packed rgb565 raw files (29-11-2012)
  • re-written logo images file verification (29-12-2012)
  • image resolution is now calculated and shown when unpacking logo images (02-01-2013)
  • added colored screen output (04-01-2013)
  • included support for logo images containing uncompressed raw files (06-01-2013)
  • more verbose output when unpacking boot and recovery images (13-01-2013)
  • kernel or ramdisk extraction only is now supported (13-01-2013)
  • re-written check of needed binaries (13-01-2013)
  • ramdisk.cpio.gz deleted after successful extraction (15-01-2013)
  • added rgb565 <=> png images conversion (27-01-2013)
  • code cleanup and revised verbose output (16-10-2014)
  • boot or recovery is now extracted to the working directory (16-10-2014)
  • unpack result is stored on the working directory, despite of the input file path (17-10-2014)
  • added support for new platforms - MT6595 (thanks @carliv) (29-12-2014)
  • minor code cleanup and revised information output for boot and recovery images (29-12-2014)
  • make scripts more future-proof by supporting even more args (30-12-2014)
  • continue repacking even if there's no extra args file (01-01-2015)
  • more verbose output when repacking boot and recovery images (02-01-2015)
  • added new cmdline option for eventual debugging when repacking boot and recovery images (02-01-2015)

Credits:
  • Android-DLS for the initial scripts
  • starix (from forum.china-iphone.ru) for the decryption of logo.bin files structure
  • carliv (from forum.xda-developers.com) for new platform support and new binaries

Editing .rgb565 raw files
There may be other ways for doing this, but here's a short info that will help you to edit .rgb656 raw files found inside MTK logo images.
  • Download and install Paint.NET
  • Download the attached plugin and copy the RGB565.dll file to the folder: "C:\Program Files\Paint.Net\FileTypes"
  • Open the .rgb565 file and enter image height and width

Information:

The plugin will allow read and write support to the RGB565 or RAW565 format. This format is used by the Android platform for the initial boot screen of the device. It will also allow you to open a BMP, PNG, JPG or other image and save it as a RGB565 file.

RGB565 is simply the raw pixel data of a bitmap file. It does not contain any header information and does not contain the dimensions of the image. The only thing that is known is the total number of pixels. When opening a .rgb565 file, the user must specify the height and width of the image, which is the resolution of your device's screen.
Just as an example, for a device with a 540 x 960 screen, the .rgb565 file for that device will have 518400 pixels. The size of the file in bytes will be twice the number of pixels, i.e. 1036800 bytes.

ATTACHMENT 

Popular Posts

[ROM][6.0.1]Full Advance 6.0.1 For I9000

Full Advance 6.0.1

Samsung Galaxy S (i9000)

Full Advance is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. Full Advance does still include various hardware-specific code, which is also slowly being open-sourced anyway.


Code:
#include
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
* Submitting bug reports on unofficial builds is the leading
* cause of male impotence.
*/
Installation Instruc…

LolliFox v.1.9.1 BETA For MT6572

In LolliFox v.1.8 BETA Changes in the new version:
* The status bar at the gallery
* Refinement style dialer settings
* Corrections in the SMS / MMS
* Refinement calendar
* Contact icon on the left
* Materialization FM-Radio
* Materialization Downloads
* The materialization of the File Manager
* Light engineering theme menu
* BatteryMeterView with android 4.4
* English version is back
* Fixed VPN
* minor fixes In the full version:
* Fixed GPS
* Updated Google Play 5.3.5
LolliFox v.1.9 BETA Changes in the new version:
* Added Some Apps like, «Sim Toolkit», «Taskmanager», «Root Explorer»
* Materialization gallery
* Materialization calendar
* Materialization hours
* List of changes in the settings
* Removed the section «Safety information» from the Settings — About phone
* Fixed navigation bar
* Fix file manager
* Fixed synchronization of contacts and calendar
* Minor fixes graphics system
* Small changes in the settings
* Minor changes in the application of hours
* Many small edits in m…

[ROM][5.1.1]Full Advance 5.1.1 For I8190

Full Advance 5.1.1
Samsung Galaxy S3 Mini

Full Advance is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. Full Advance does still include various hardware-specific code, which is also slowly being open-sourced anyway.


Code:
#include 
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
* Submitting bug reports on unofficial builds is the leading 
* cause of male impotence.
*/
Installation Instructions


Coming from 5.1.1 o…

IOS 8 Rom For MT6572

IOS 8 Rom


Features


Rom Version: 4.2.2 With Root 
- ODEX 
- Prerooted with SuperSU 
- Playstore 
- Android 4.2.2 with iOS8 skin on top  - Multilanguage Indonesia Ready Guys - Duel 3G - Include GAPPS  - Smooth - Original iPhone Lockscreen iOS 6 8 - Slide To Unlock - Slide To Power Off - Siri - Iris Recents Apps - Compass - Notification Center - Touch ID And Passcode To Lock Phone - ICloud - Typical Transition Effect iOS 8 - Gesture Offscreen shorcuts - Touch ID Simulation - Support Smart Eye Scroll And Smart Pause - Apple Bootanimation - Comes With Apple Bootup Logo, Can Be Activate With * # 0066 # - Similar Anyway Deh equally authentic  - And Many More Guys Download ScreenShots:



Full Advance 5.1.1 For I9000

                       Full Advance 5.1.1

                                                     Samsung Galaxy S (i9000)

On Xda








Full Advance is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. Full Advance does still include various hardware-specific code, which is also slowly being open-sourced anyway.


Code:
#include
/*
 * Your warranty is now void.
 *
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about features included in this ROM
 * before flashing it! YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 *
 * Submitting bug reports on…

Xperia Kitkat Custom Rom For MT6572

1) Super Smooth, Super Fast & Stable. 2) Xperia Z Look 3) Air Gesture Enabled (Working) 4) Pre Rooted. 5) Better Gaming Performance. 6) 100% Bugless ( I am using this ROM) 7) Xperia Album, Walkman, Social Life and many more APK pre Installed. 8) Android Version 4.4.2 KITKAT
Download Link : [Click Here]

Patch For Disabling Navbar : [Click Here] Lets See Some Screenshot:

Ultra Lollipop Rom For MT6572

*Upto 250 mb free using whatsapp
*best gaming ROM ever
*gapps excluded 
*lollipop call
*Apollo music
*new browser 
*camera works 
*Fully lollipop themed
*Size only 162 MB

Lightest Rom
Smooth and Stable










Download link


Credits;

Nehal Battulwar
Siong