Skip to content

Python script for work with Novatek binary firmware - get info, modify...

License

Notifications You must be signed in to change notification settings

EgorKin/Novatek-FW-info

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 

Repository files navigation

Novatek Firmware info (NTKFWinfo)

Python script for work with Novatek firmware files. Show full FW info, allow extract, replace, uncompress, compress partitions, fix CRC for modded partitions and whole firmware file. Useful tool for building custom firmwares. Use Linux environment or WSL2 (Windows Subsystem for Linux) for properly work with UBI and SPARSE partitions.

Novatek FW info is available under the terms of the GNU Public License version 3.

If this project helps you, you can send me any amount of BTC to address 12q5kucN1nvWq4gn5V3WJ8LFS6mtxbymdj or use QR code below:

btc

Безымянный NTKFWinfo2

Installation:

First of all install:

sudo apt-get install python3
sudo apt-get install python3-pip
sudo apt-get install mtd-utils
sudo apt-get install liblzo2-dev
sudo apt-get install pypy3

Additionaly install this python modules:

sudo pip3 install python-lzo
sudo pip3 install ubi_reader

For SPARSE partitions support install:

sudo apt-get install android-sdk-libsparse-utils

For FDT(DTB) partitions support install:

sudo apt-get install device-tree-compiler

Basic usage:

Show firmware partitions info:

python3 ./NTKFWinfo.py -i FWA229A.bin

Uncompress partition by ID to a file(for BCL1) or folder(for UBI or SPARSE):

python3 ./NTKFWinfo.py -i FWA229A.bin -u 6

Compress partition back to firmware binary file from uncompressed file(for BCL1) or folder(for UBI or SPARSE) and fix all CRC:

python3 ./NTKFWinfo.py -i FWA229A.bin -c 6

Additional(expert) commands:

Extract partition by ID number and skip n start bytes:

(as example extract data from CKSM partition require skip first 64 CKSM-header bytes)

python3 ./NTKFWinfo.py -i FWA229A.bin -x 6 64

Replace partition with ID=6 and start offset = 64 (CKSM-header size) using file img-726660551.ubi:

python3 ./NTKFWinfo.py -i FWA229A.bin -r 6 64 ./img-726660551.ubi

Fix CRC for all known partitions(uboot, MODELEXT INFO, BCL1, CKSM) and whole firmware file:

python3 ./NTKFWinfo.py -i FWA229A.bin -fixCRC

Use custom directory for input/output partitions files:

python3 ./NTKFWinfo.py -i FWA229A.bin -u 6 -o tempdir
python3 ./NTKFWinfo.py -i FWA229A.bin -c 6 -o tempdir

Speed-up compress BCL1 LZ partitions:

I suggest use pypy3 VS python3 to decrease compression time for BCL1 LZ partitions:

pypy3 ./NTKFWinfo.py -i GIT3FWv2.3.bin -c 0

pypy3 speed-up

About

Python script for work with Novatek binary firmware - get info, modify...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages