Finding the start address of GZ is pretty easy using the file signature (magic number) but the end address is a little bit more difficult and requires a trial and error approach. When trying to find the end of compressed kernel, there are two likely errors you might run into. This post is aimed to help provide fix these errors. I'm using boot.img-zImage from tecno CXair as an example here but it's applicable to others as well
Two possible errors encountered while trying to decompress kernel using 7zip
There are some data after the end of the payload data
Unexpected end of data
How to fix 7zip kernel decompression error messages
Open the file using HXD
As usual, we'll search for the hex-value "6D 65 64 69 61 74 65 6B 2C 4D 54" , remember this is not the end address of GZipped kernel but it's the closest point we'll use in order to get the real end address
Now we'll start selecting / highlighting and cutting items from this point (you can paste into a new file so as not to misplace what you cut), save the file and try extracting using 7zip
If you get the error message "There are some data after the end of the payload data", then it means you still need to remove more values from the end of the file
But if you get the error message "Unexpected end of data", then it means you've removed more than you should have. Simply undo and try to remove less than what you removed previously
This post was last modified: 29-03-2019, 03:27 PM by X3non.