In my journey of exploring Huawei devices, I've created a variety of scripts and tools, each serving different purposes.
To make these tools readily available and easily accessible for anyone interested in reverse engineering (RE) Huawei devices, I have centralized all of them into a single repository. I will keep updating the collection with new scripts and tools.
cm2parser.py: Script designed to parse CM3 images, including modem, hifi, or mcu images. It will print the header information and will dump all the sections of the image.fastbootimage.py: Script designed to parse bootloader (fastboot.img) images. It will print the header information (i.e: load address, end address and first cmd).oeminfo.py: Script to unpack and repack oeminfo images. Repacking data with higher size will result in a brick.partdumper.py: Script to dump partitions directly from fastboot mode using custom OEM commands. Experimental and might only work on MediaTek based Huawei(s).update-extractor.py: Script to extractUPDATE.APPfiles. It will extract and print information about the images contained in the update file.
Each tool comes with its unique functionality. To understand how to use them, you can access the help documentation by invoking it with the -h parameter.
Parse a CM3 image (modem/hifi/mcu):
python cm3parser.py modem.imgParse bootloader header info:
python fastbootimage.py fastboot.img
python fastbootimage.py --start-offset 0x20 fastboot.imgList all entries in an oeminfo image:
python oeminfo.py extract -l oeminfo.imgExtract all entries and images:
python oeminfo.py extract oeminfo.img -o extracted/Extract specific entries by ID:
python oeminfo.py extract oeminfo.img -i 0x01,0x02,0x05Extract a single entry:
python oeminfo.py extract oeminfo.img -s 0x01Repack modified entries back into image:
python oeminfo.py repack oeminfo.img extracted/ -o oeminfo_modified.imgList all available partitions:
python partdumper.py --listDump a specific partition
python partdumper.py recovery recovery.img
python partdumper.py boot boot.img
python partdumper.py system system.imgList partitions in UPDATE.APP:
python update-extractor.py UPDATE.APPExtract all partitions:
python update-extractor.py UPDATE.APP -e -o output/Extract specific partition:
python update-extractor.py UPDATE.APP -e -p SYSTEM -o output/This project is licensed under the GPL-3.0 License - see the LICENSE file for details.