rom1nux / mtkimg Goto Github PK
View Code? Open in Web Editor NEWUnpack/Repack boot.img, recovery.img and logo.bin for Mediatek CPU based devices
License: GNU General Public License v3.0
Unpack/Repack boot.img, recovery.img and logo.bin for Mediatek CPU based devices
License: GNU General Public License v3.0
Hi, tested with MT6753 boot.img but not work.
Reading image header (596 bytes)...
Image header :
Signature : ANDROID!
Kernel size : 6073742 bytes
Kernel load address : 0x40008000
Ramdisk size : 668615 bytes
Ramdisk load address : 0x44000000
Second stage size : 0 bytes
Second stage load address : 0x40F00000
Tags address : 0x4E000000
Page size : 2048 bytes
Product name : 'R01'
Command line : 'bootopt=64S3,32N2,32N2'
ID : 3085318B142507317BB7CF5F72E880F368694BA2
Image layout :
Bloc Offset Pages Size (bytes)
------------------------------------------------
Header 0x00000000 1 2048
Kernel 0x00000800 2966 6074368
Ramdisk 0x005CB800 327 669696
Free 0x0066F000 0 0
------------------------------------------------
Total 3294 6746112
------------------------------------------------
Seeking to start of kernel (0x00000800)...
Reading MTK header (512 bytes)...
Magic : 0x00 0x00 0xA0 0xE1
Size (bytes) : -509607936
Type :
ERROR : Kernel header magic is not valid !
Thanks.
There's no file libpng12.so.0
on Debian sid. I think it's a little bit old because in the system I can find the package libpng16-16
which has the the following files:
/usr/lib/x86_64-linux-gnu/libpng16.so.16.25.0
/usr/lib/x86_64-linux-gnu/libpng16.so.16
Get the error 'Kernel header magic is not valid' when trying to unpack amazon mtk boot.img
MTKIMG V0.44(win64) by rom1nux
Unpacking boot image 'boot.img'...
Reading image header (596 bytes)...
Image header :
Signature : ANDROID!
Kernel size : 7043382 bytes
Kernel load address : 0x40080000
Ramdisk size : 1554777 bytes
Ramdisk load address : 0x44000000
Second stage size : 0 bytes
Second stage load address : 0x40F00000
Tags address : 0x48000000
Page size : 2048 bytes
Product name : ''
Command line : 'bootopt=64S3,32N2,64N2'
ID : 18EAB62D9D8F8C50EC954D03F917B6D0C8E4A275
Image layout :
Seeking to start of kernel (0x00000800)...
Reading MTK header (512 bytes)...
Magic : 0x1F 0x8B 0x08 0x00
Size (bytes) : 0
☻Æ╪B≤Pë² : ☻♥∞Z{PTWÜ ε╜
ERROR : Kernel header magic is not valid !
I tried to unpack a logo.bin from a Gretel A7 (based on the MT6580), but mtkimg fails with:
ERROR : Logo header type is not valid !
The problem is the case of the string "LOGO" at offset 0x08, the program expects an uppercase string, where I have a lowercase one.
After fixing that, there is another problem with the decoding of the raw data. It seems that mtkimg expects an RGB565 formats (16 bit), but in my case I have images in bgra format (32 bit).
I successfully decoded the binary files (after z-decompressing) with:
ffmpeg -y -vcodec rawvideo -f rawvideo -pix_fmt bgra -s 720x1280 -i file.bin -f image2 -vcodec png file.png
Hello rom1nux,
I am using your mtkimg tool for AMAZON Fire TV with MTK-8173 chipset.*
I am facing some problem during repacking. Can you help.
I did the unpack, using the following command:
#*./mtkimg unpack -m
It created 3 files:
-rw-rw-r-- 1 pintu pintu *349 Jul 31 18:15 image.cfg
-rw-rw-r-- 1 pintu pintu *14M Jul 31 18:15 kernel.img.mtk
-rw-rw-r-- 1 pintu pintu 761K Jul 31 18:15 ramdisk.cpio.gz.mtk
After that, I just tried to repack the same image again.
#*./mtkimg repack newboot.img -n -k kernel.img.mtk -r ramdisk.cpio.gz.mtk
MTKIMG V0.44(linux64) by rom1nux
Repacking image to 'newboot.img'...
ERROR : Configuration file 'image.cfg' is not a valid 'ROOTFS' or 'RECOVERY' image descriptor !
But it gives the above error.
Can you help me, what is the problem. And how to fix it.
If possible, CC me in this mail id: [email protected]*
Thanks,
Pintu
Amazon_Fire_TV_MT8173.zip
Good morning,
Your great app makes me make a mistake unpacking the logo.bin the Ulefone Armor 6e smartphone.
Here's the report:
Unpacking boot image 'D:Ulefone Armor_6e Custom-mtkimg-master-releases.bin'...
Reading the image header (596 bytes)...
Image header :
Signature: êêX "18
Kernel size: 1869049708 bytes
Kernel loading address: 0x000000
Hard disk size: 0 bytes
Hard drive loading address: 0x000000
Size of the second step: 0 byte
Loading address of the second step: 0x000000
Address tags: 0x000000
Page size: 0 byte
Product name : "ëëX
Command line: ''.
ID: 46811200DC861200DEA11200BFBE1200A5DB1200
ERROR: Android image signature is not valid!
Here is my problem:
MTKIMG V0.44(win64) by rom1nux
Unpacking logo image 'D:Ulefone Armor_6e Customer-mtkimg-master-releases.bin'...
ERROR: Logo header type is not valid!
and here's the final problem:
MTKIMG V0.44(win64) by rom1nux
WARNING : Option '--keep-mtk-header' implies '--no-zip' !
Unpacking boot image 'D:Ulefone Armor_6e Customer mtkimg-master releases do logo-verified.bin'...
ERROR: Android image signature is not valid!
That's all. I hope you'll find it useful as you continue to develop the project.
thank you for your wonderful work and good cooperation.
french language:
Bonjour,
Votre superbe application provoqué un échec en déballant le logo.bin du smartphone Ulefone Armor 6e.
Voici le rapport :
Déballage de l'image de démarrage 'D:\Ulefone\Armor_6e\Custom\mtkimg-master\releases\do\logo-verified.bin'...
Lecture de l'en-tête de l'image (596 octets)...
En-tête de l'image :
Signature : êêX "18
Taille du noyau : 1869049708 octets
Adresse de chargement du noyau : 0x00000000
Taille du disque dur : 0 octet
Adresse de chargement du disque dur : 0x00000000
Taille de la deuxième étape : 0 octet
Adresse de chargement de la deuxième étape : 0x00000000
Tags adresse : 0x00000000
Taille de la page : 0 octet
Nom du produit : "ëëX
Ligne de commande : '''.
ID : 46811200DC861200DEA11200BFBE1200A5DB1200
ERREUR : La signature de l'image Android n'est pas valide !
voici mon problème :
MTKIMG V0.44(win64) by rom1nux
Unpacking logo image 'D:\Ulefone\Armor_6e\Custom\mtkimg-master\releases\do\logo-verified.bin'...
ERROR : Logo header type is not valid !
et voici le dernier soucis :
MTKIMG V0.44(win64) by rom1nux
WARNING : Option '--keep-mtk-header' implies '--no-zip' !
Unpacking boot image 'D:\Ulefone\Armor_6e\Custom\mtkimg-master\releases\do\logo-verified.bin'...
ERROR : Android image signature is not valid !
voilà tout j'espère que cela vous sera utile si vous continuez le dévellopement du projet
merci pour votre merveilleux travail et bonne continuation
I get this while trying to build:
/usr/bin/ld: build/main.o:(.bss+0x0): multiple definition of `app_data'; build/info.o:(.bss+0x0): first defined here
/usr/bin/ld: build/repack.o:(.bss+0x0): multiple definition of `app_data'; build/info.o:(.bss+0x0): first defined here
/usr/bin/ld: build/tools.o:(.bss+0x0): multiple definition of `app_data'; build/info.o:(.bss+0x0): first defined here
/usr/bin/ld: build/unpack.o:(.bss+0x0): multiple definition of `app_data'; build/info.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:157: build/mtkimg] Error 1
Using GCC 10.2.0 and GNU ld 2.35.1
david@devuan:/mnt/home/dave/Mediiacom_S501_ROM_4.4.2_1.50_mod$ mtkimg -v -d unpack boot.img
MTKIMG V0.44(linux64) by rom1nux
Execute command 'unpack'...
Parsing arguments...
verbose : yes
debug : yes
type : boot
input : boot.img
overwrite : no
kernel : kernel.img
ramdisk : ramdisk.d
config : image.cfg
no-decompress : no
keep-mtk-header : no
Unpacking boot image 'boot.img'...
Reading image header (596 bytes)...
Image header :
Signature : ANDROID!
Kernel size : 4869976 bytes
Kernel load address : 0x10008000
Ramdisk size : 830067 bytes
Ramdisk load address : 0x11000000
Second stage size : 0 bytes
Second stage load address : 0x10F00000
Tags address : 0x10000100
Page size : 2048 bytes
Product name : 'eng.1409721144'
Command line : ''
ID : 80470F1ACA532150E781C8B3EFD4A1F61077B8C2
Image layout :
Seeking to start of kernel (0x00000800)...
Reading MTK header (512 bytes)...
Magic : 0x88 0x16 0x88 0x58
Size (bytes) : 4869464
Type : KERNEL
Unpacking kernel to 'kernel.img' (4869464 bytes)...
Reading kernel zimage header from 'kernel.img' (4 bytes)...
Seeking to start of ramdisk (0x004A5800)...
Reading MTK header (512 bytes)...
Magic : 0x88 0x16 0x88 0x58
Size (bytes) : 829555
Type : ROOTFS
Unpacking ramdisk to 'tmp-ramdisk.cpio.gz' (829555 bytes)...
Reading gzip header from 'tmp-ramdisk.cpio.gz' (2 bytes)...
Unpacking ramdisk content to 'ramdisk.d'...
Create directory 'ramdisk.d'...
Changing directory 'ramdisk.d'...
Unpacking ramdisk content...
gzip -d -c ../tmp-ramdisk.cpio.gz | cpio -i --quiet
Changing directory '/mnt/home/dave/Mediiacom_S501_ROM_4.4.2_1.50_mod'...
Removing file 'tmp-ramdisk.cpio.gz'...
Writing image configuration file 'image.cfg'...
Boot image successfully unpacked !
david@devuan:/mnt/home/dave/Mediiacom_S501_ROM_4.4.2_1.50_mod$ mtkimg -v -d repack boot2.img
MTKIMG V0.44(linux64) by rom1nux
Execute command 'repack'...
Parsing arguments...
verbose : yes
debug : yes
overwrite : no
output : boot2.img
kernel : kernel.img
ramdisk : ramdisk.d
config : image.cfg
no-compress : no
compress-rate : 9
Repacking image to 'boot2.img'...
Loading image configuration file 'image.cfg'...
Packing ramdisk content from 'ramdisk.d'...
Changing directory 'ramdisk.d'...
Packing ramdisk content (compression rate : 9)...
find . | cpio -o -H newc --quiet | gzip -9 -n > ../tmp-ramdisk.cpio.gz
Changing directory '/mnt/home/dave/Mediiacom_S501_ROM_4.4.2_1.50_mod'...
Reading mtk header from 'kernel.img' (4 bytes)...
Reading kernel zimage header from 'kernel.img' (4 bytes)...
File 'kernel.img' is ARM Linux zImage file !
Reading mtk header from 'tmp-ramdisk.cpio.gz' (4 bytes)...
Reading gzip header from 'tmp-ramdisk.cpio.gz' (2 bytes)...
File 'tmp-ramdisk.cpio.gz' is GZIP file !
Image header :
Signature : ANDROID!
Kernel size : 4869976 bytes
Kernel load address : 0x10008000
Ramdisk size : 833355 bytes
Ramdisk load address : 0x11000000
Second stage size : 0 bytes
Second stage load address : 0x10F00000
Tags address : 0x10000100
Page size : 2048 bytes
Product name : 'eng.1409721144'
Command line : ''
ID : 80470F1ACA532150E781C8B3EFD4A1F61077B8C2
Image layout :
ERROR : Kernel and/or ramdisk are too big to fit into image (2048 bytes exceed) !
david@devuan:/mnt/home/dave/Mediiacom_S501_ROM_4.4.2_1.50_mod$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.