Post Reply

[TOOL] [MOD] [v1.3.0] [WIN/LINUX/MAC] Change boot logo (and other images...)

26th May 2014, 04:20 PM   |  #1  
OP Senior Member
Flag Göd
Thanks Meter: 668
 
1,108 posts
Join Date:Joined: Nov 2011
More
Change your boot logo, remove padlock and redesign fastboot layout with a simple tool.

Instructions:

  1. Download the tool from here or from attachments
  2. Run start.bat if you are using windows, run the start script if you are a llinux or mac user and extract the bootloader.imgdata.img file from the stock folder, follow the instructions on the screen.
  3. You will find the editable images in the "images" folder after the extraction.
  4. Use any tool to modfy the images or to create new ones.
  5. Make sure the image format is a 24 bit uncompressed windows bitmap bmp file and the dimension is not higher than 1080x1920;
  6. Edit pos.txt in the "images" folder for positioning your images.
  7. Build your new imgdata.img and flash the flash-me.zip in recovery.


About pos.txt file strucure:
First column: image name in imgdata.img
Second column: X_posisitonxY_position from the top left corner of your screen. X_position means how many pixels right form the left of the screen. Y_position means how many pixel down from the top of the screen.
See the picture:
 

Quote:

boot 281x868
charger 415x765
unlocked 504x1750
start 0x100
bootloader 0x100
recovery 0x100
poweroff 0x100
fastboot_op 0x400
oem_unlock 0x0
unlock_yes 0x1300
unlock_no 0x1300
downloadmode 300x890

If .bat does not work:
  1. First report the error to me.
  2. You can run imgdata.exe in cmd.
  3. Navigate where imgdata.exe is in cmd.

To extract imgdata.img type this:
Code:
imgdata.exe extract <path to imgdata.img> <path to output folder>
To build imgdata.img type these commands
Code:
imgdata.exe build <path to input folder> <path to output folder>
copy .\dummy.zip ..\flash-me.zip /Y
.\7za.exe a ..\flash-me.zip <path to output folder>/new-imgdata.img
Imgdata.exe command list:
 
Quote:

imgdata.exe extract <imgdata file> <output folder>
imgdata.exe build <extracted images> <output folder>
imgdata.exe 16bit <image file>
imgdata.exe preview [option] <extracted images> <output folder>

preview options:

locked-boot
unlocked-boot
charger
fastboot-start
fastboot-bootloader
fastboot-recovery
fastboot-poweroff
oem-unlock-yes
oem-unlock-no
downloadmode
all


Notes:
  1. Do not delete the images, preview and custom folders.
  2. If you want to make sure everything is okay, then extract the recently build imgdata.img (new-imgdata.img). If you see the same pictures then it is okay. Dont use md5 or crc checks on the images for checking are they the same, because some infos missing from the header of the extracted images (like pixel/meter, number of colors end etc...) and some editors likes to put random datas in the gap bytes between the lines.
  3. I am not responsible if you brick your device.
  4. If the building or extracting fails at some point or the program ends up in endless loop, then please report me and send me the images and pos.txt file for fixing.
  5. To remove an image just replace it with a same sized only black image.
  6. Save bmp files to 16bit then save them again to 24 bit to make imgdata smaller at a little cost of quality loss.
  7. Windows XP users have to install .net framework 3.5 to make the bat file work.

Custom images:
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16
17 18 19 20 21 22
23 24 25 26 27 28
29


Change log
 
1.3.0
Quote:

Linux and mac support.
Start.bat now adds C:\Windows\System32 and C:\Windows\SysWOW64 to the path environment variable if they are missing.
For imgdata binary: 16bit switch now checks the input file to determine is it a valid bmp file.

1.2.1

Quote:

16 bit conversion: does in one step when you open an image with gimp then save it as 16 bit then reopen and save it as 24 bit.
the original image will get "o-" tag to the begining of its name

1.2.0
Quote:

Preview function.
Option for flash with adb or fastboot.
Added more-space.img to the custom folder. I removed padlock, fastboot background, downloadmode screen and I minimalized fastboot screen and oem unlock screen to gain more space for custom boot logos.

1.1.1
Quote:

Support for Gimp

1.1.0
Quote:

Built from reworked code.

1.0.1
Quote:

Added file size check for new-imgdata.img

1.0.0
Quote:

First public version



Sources
https://github.com/bitdomo/imgdata

History
 
When you enter download mode a kernel gets loaded it is at the laf partition, during the boot process the google logo is skipped. I flashed a twrp recovery to laf partition just for fun. I booted up twrp from laf and I was surprised that I still see the booting picture of the download mode. I started looking for where that image is stored. It turned out it is not in the aboot partition. There is a partition called imgdata. It looks like the images needed by bootloader are stored there. I managed to understand the structure of the imgdata partition. There are 12 images in raw format on imgdata.

Quote:

  1. boot
  2. charger
  3. unlocked
  4. start
  5. bootloader
  6. recovery
  7. poweroff
  8. fastboot_op
  9. oem_unlock
  10. unlock_yes
  11. unlock_no
  12. downloadmode

The structure


Partition header

Quote:

DATA1: 8 byte string. It says IMGDATA!. It is similar to the begining of boot.img and recovery.img that says ANDROID!
DATA2: I don't know.
DATA3: Number of images. It is 12.
8 bytes of 0: I dont know the purpose of that

Image headers

Quote:

DATA4: 16 byte string. Tells the name of the image.
DATA5: image width in pixel
DATA6: image height in pixel
DATA7: X position of the image in pixel
DATA8: Y position of the image in pixel
DATA9: it tells where is the begining of the picture on imgdata
DATA10: size of the image

This pattern goes on, from DATA4 to DATA10.

The origin is the top left corner of the screen. Look at the picture.


The first image is at 0x0400, and after that point there are only images.

Currently I have no idea how these images formated. I tried to use ffmpeg to convert these images into png, but the output was just a mess.
If we find out how to edit these pictures then we could customize our beloved "Google" boot logo.


Update

I have made an excell chart about the image headers and extracted all the 12 images. There is a little gap between images to fit the 512byte of block size on the partition. You will find image files with that additional gap and without of it and my chart in this link. The imgdata.img I used is from the KRT16M to KOT49E ota update.
Attached Files
File Type: zip no-padlock.zip - [Click for QR Code] (300.8 KB, 147 views)
File Type: zip stock.zip - [Click for QR Code] (328.6 KB, 210 views)
File Type: rar imgdata-tool-v120.rar - [Click for QR Code] (1.35 MB, 36 views)
File Type: rar imgdata-tool-v121.rar - [Click for QR Code] (1.36 MB, 32 views)
File Type: zip imgdata-tool-v130.zip - [Click for QR Code] (4.31 MB, 205 views)
Last edited by bitdomo; 10th June 2014 at 08:10 PM.
The Following 62 Users Say Thank You to bitdomo For This Useful Post: [ View ]
27th May 2014, 12:37 AM   |  #2  
Paradoxxx's Avatar
Recognized Contributor
Flag Nimes
Thanks Meter: 5,474
 
4,753 posts
Join Date:Joined: Aug 2008
Donate to Me
Interesting post, and very well made.

Glad some people are still looking into hacking this bad boy up.

Good job, subscribed.

Envoyé de mon Nexus 5 en utilisant Tapatalk
The Following 2 Users Say Thank You to Paradoxxx For This Useful Post: [ View ]
27th May 2014, 12:15 PM   |  #3  
OP Senior Member
Flag Göd
Thanks Meter: 668
 
1,108 posts
Join Date:Joined: Nov 2011
More
I managed to decode the structure of the images. It consist of 4 bytes of chunks.

First byte: countnumber
Second byte: R value
Third byte: G value
Fourth byte: B value

Example:

05 00 00 00 02 FF FF FF

05: countnumber = 5
00 00 00: RGB value = black

02: countnumber
FF FF FF: RGB value = white

So from the top left corner of your screen you would see 5 black pixels then 2 white pixels.

I wrote a C program which converts these raw images to bmp images. So my guessing was right about the Image headers in the first post.

I will later post that program with an option to convert bmp files to raw files.

If you want to write your own program then here are a few hint:

BMP stores pixel values in BGR order while the pixels stored in RGB order in the raw file.

BMP picture starts from bottom left corner while the raw file starts from top left corner.

In a BMP file the size of a pixel row in bytes has to be multiple of 4. Lets say you have 2x1 bmp picture. (width x height, column x row) . You have 2 pixels.
Each pixel stored on 3 bytes (BGR). 2*3=6.
6%4 = 2 so you have to add two more bytes to the row, then 8%4 will be = 0.

Tapatalk-kal küldve az én Nexus 5-el
The Following 14 Users Say Thank You to bitdomo For This Useful Post: [ View ]
28th May 2014, 08:50 PM   |  #4  
OP Senior Member
Flag Göd
Thanks Meter: 668
 
1,108 posts
Join Date:Joined: Nov 2011
More
IT WORKS!

https://www.youtube.com/watch?v=UMKgpVVjLgI

I have just finished with the imgdata builder/extractor app, but before I share it with you all I want to make some tests and debugs to make sure everything works perfectly.
The Following 15 Users Say Thank You to bitdomo For This Useful Post: [ View ]
28th May 2014, 09:53 PM   |  #5  
Paradoxxx's Avatar
Recognized Contributor
Flag Nimes
Thanks Meter: 5,474
 
4,753 posts
Join Date:Joined: Aug 2008
Donate to Me
Quote:
Originally Posted by bitdomo

IT WORKS!

https://www.youtube.com/watch?v=UMKgpVVjLgI

I have just finished with the imgdata builder/extractor app, but before I share it with you all I want to make some tests and debugs to make sure everything works perfectly.

Good job dude. This is what I call true development.

EDIT : Change the title, I'm trying to make it to front page as a news

EDIT 2 : Just checked the imgdata rar, so basically we could even change the tiny "unlocked" logo at the bottom of the booting screen?

Last edited by Paradoxxx; 28th May 2014 at 11:26 PM.
The Following 2 Users Say Thank You to Paradoxxx For This Useful Post: [ View ]
28th May 2014, 09:56 PM   |  #6  
simms22's Avatar
Recognized Contributor
BROOKLYN!
Thanks Meter: 21,585
 
25,963 posts
Join Date:Joined: Jun 2009
Quote:
Originally Posted by bitdomo

IT WORKS!

https://www.youtube.com/watch?v=UMKgpVVjLgI

I have just finished with the imgdata builder/extractor app, but before I share it with you all I want to make some tests and debugs to make sure everything works perfectly.

+1(out of thanks)
neat
The Following User Says Thank You to simms22 For This Useful Post: [ View ]
28th May 2014, 10:10 PM   |  #7  
CRIME INC.'s Avatar
Senior Member
Flag HENDERSONVILLE
Thanks Meter: 1,952
 
3,226 posts
Join Date:Joined: Jan 2011
More
Man this is awesome!! Good job bro

Sent from my HAMMERHEAD
28th May 2014, 10:51 PM   |  #8  
Senior Member
Flag Peel, Isle of Man
Thanks Meter: 141
 
863 posts
Join Date:Joined: Jan 2012
More
Great work well done mate
29th May 2014, 12:51 AM   |  #9  
markusf21's Avatar
Senior Member
Flag LaPorte, IN
Thanks Meter: 207
 
456 posts
Join Date:Joined: Aug 2011
More
Great work dude, I've been waiting for this

Sent from my OmniROM toting Nexus 5
29th May 2014, 01:06 AM   |  #10  
OP Senior Member
Flag Göd
Thanks Meter: 668
 
1,108 posts
Join Date:Joined: Nov 2011
More
Quote:
Originally Posted by Paradoxxx

Good job dude. This is what I call true development.

EDIT : Change the title, I'm trying to make it to front page as a news

EDIT 2 : Just checked the imgdata rar, so basically we could even change the tiny "unlocked" logo at the bottom of the booting screen?

To "EDIT": What should be the new title?
To "EDIT2": Yes we could, and many other pictures.

All the images we can edit is in the attachments.
Attached Files
File Type: rar images.rar - [Click for QR Code] (337.0 KB, 70 views)
Last edited by bitdomo; 29th May 2014 at 01:11 AM.

The Following 2 Users Say Thank You to bitdomo For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Nexus 5 Themes and Apps by ThreadRank