1. Use a hex editor and load your .bin file containing the logo
2. Search for first occurrence of the string "PNG" and look for hex 89 before it, then position your cursor there (
\89PNG is a PNG header or start of image)
3. Go 15 bytes backward and the next
4 octets is size of image; if you check the filesize of the extracted PNG from original .bin, this value will be here
4. Use a image editor and shrink your image down to less than original size (one way to do this is to convert to JPG, saved with lower compression level and convert back to PNG until the size is less than original PNG filesize)
5. Put the 4 octets representing the size of your new image at position in step 3
6. Use a hex editor and open your new PNG image, copy entire data into buffer
7. Go to start of image of original .bin (from step 2) and paste overwrite not insert
8. Make sure the octets after new image until end of old image is 0's (since your new data should be less than original data)
Never change any data beyond the size of original image. This step is optional and just made it cleaner but not needed since the size of PNG image is already specified from step 5.
Here is example of what I did:
original .bin
Code:
Please Login or Register to see the links
modified .bin
Code:
Please Login or Register to see the links
Hint:
C4DC0100 -> 0001DCC4 = 133,337 bytes = size of original bitmap
1ED60100 -> 0001D61E = 120,350 bytes = size of new bitmap
My hex editor is HxD
The end tag for PNG is
IEND<4 octets>, such as
original .bin
Code:
Please Login or Register to see the links
modified .bin
Code:
Please Login or Register to see the links
So each PNG is \89PNG...<data>...IEND<4 octets> but you only need to know that if there are more than one images in .bin

The 4 octets after IEND is CRC32 for PNG
Bookmarks