ColdSmoke627 / firmware-mod-kit

Automatically exported from code.google.com/p/firmware-mod-kit
0 stars 0 forks source link

Added support for TP-Link v2 header firmware (TD-W8968v1) #125

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hello 

I've just finished modyfing tpl-tool tool to add support TP-Link v2 header with 
MD5 checksum update/checking. Now this tool has two versions support. 

Succesfuly tested on my TD-W8968v1 router.

adam@adam-VirtualBox:/opt/firmware-mod-kit$ ./extract-firmware.sh firmware.bin
Firmware Mod Kit (extract) 0.99, (c)2011-2013 Craig Heffner, Jeremy Collake

Scanning firmware...

Scan Time:     2014-01-18 15:13:22
Signatures:    193
Target File:   /opt/firmware-mod-kit/firmware.bin
MD5 Checksum:  3badfb5fd028ceafbe15d15d69f42abb

DECIMAL     HEX         DESCRIPTION
--------------------------------------------------------------------------------
-----------------------
512         0x200       LZMA compressed data, properties: 0x5D, dictionary size: 
8388608 bytes, uncompressed size: 3524088 bytes
1114112     0x110000    Squashfs filesystem, big endian, version 3.0, size: 
4511155 bytes, 454 inodes, blocksize: 65536 bytes, created: Mon Feb 18 02:14:56 
2013 

Extracting 1114112 bytes of  header image at offset 0
Extracting squashfs file system at offset 1114112
Extracting squashfs files...
[sudo] password for adam: 
Firmware extraction successful!
Firmware parts can be found in '/opt/firmware-mod-kit/fmk/*'

After modyfing "status.htm" file from the "web" directory I just need to edit 
by hand file "config.log" to change HEADER_TYPE to 'tp-link' and save it (now 
I'm working to update binwalk to set this variable automaticaly for v2 
versions).

adam@adam-VirtualBox:/opt/firmware-mod-kit$ ./build-firmware.sh
Firmware Mod Kit (build) 0.99, (c)2011-2013 Craig Heffner, Jeremy Collake

Building new squashfs file system... (this may take several minutes!)
Squashfs block size is 64 Kb
[sudo] password for adam: 
Creating big endian 3.0 filesystem on 
/opt/firmware-mod-kit/fmk/new-filesystem.squashfs, block size 65536.

Big endian filesystem, data block size 65536, compressed data, compressed 
metadata, compressed fragments
Filesystem size 4405.44 Kbytes (4.30 Mbytes)
    24.31% of uncompressed filesystem size (18122.78 Kbytes)
Inode table size 4079 bytes (3.98 Kbytes)
    28.66% of uncompressed inode table size (14234 bytes)
Directory table size 3829 bytes (3.74 Kbytes)
    58.10% of uncompressed directory table size (6590 bytes)
Number of duplicate files found 23
Number of inodes 454
Number of files 283
Number of fragments 47
Number of symbolic links  51
Number of device nodes 77
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 43
Number of uids 1
    root (0)
Number of gids 0
Remaining free bytes in firmware image: 2433024
Processing 0 header(s) from /opt/firmware-mod-kit/fmk/new-firmware.bin...
CRC update failed.

Correcting TP-Link firmware image ... [tpl-tool] WARNING: Invalid Image 
Checksum.
[tpl-tool] WARNING: Component files may not be valid.
Image file "/opt/firmware-mod-kit/fmk/new-firmware.bin" successfully extracted.
Image file "/opt/firmware-mod-kit/fmk/new-firmware.bin-new" successfully 
rebuilt.
Filename           : /opt/firmware-mod-kit/fmk/new-firmware.bin
Filesize           : 0x007b0000 / 8060928

Image Version      : ver. 1.0
Image Size         : 0x007b0000 / 8060928
Image Checksum     : aa 64 66 25 32 37 b3 68 7c 7a dd af 35 83 42 f5  (Valid)

Product Id         : 0x89680001  (TD-W8968v1)
Product Version    : 0x00000005
Firmware Version   : 0.6.0 0.4

Kernel Offset      : 0x00000200 /     512
Kernel Length      : 0x000fd75f / 1038175
Kernel Load Address: 0x80020000
Kernel Entry Point : 0x80020000
Kernel Checksum    : ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff  (Not 
Verified)

Rootfs Offset      : 0x00110000 / 1114112
Rootfs Length      : 0x0044e000 / 4513792
Done
Finished! 
New firmware image has been saved to: /opt/firmware-mod-kit/fmk/new-firmware.bin
adam@adam-VirtualBox:/opt/firmware-mod-kit$ 

-- Tested both versions :
* v1 = TL-WDR4300 V1
* v2 = TD-W8968v1

Firmware update successful!

I can't add attachment for patch file for this issue. Here's link to my dropbox:

https://www.dropbox.com/s/k73kye0eykuunj2/tpl-tool.patch

Regards
Adam

Original issue reported on code.google.com by adam.garczyk.pwsz@gmail.com on 18 Jan 2014 at 6:32

GoogleCodeExporter commented 8 years ago
Is anyone ever going to implement this? I tried to get the patch but seems i am 
too late, the link is dead.

Original comment by evertonc...@gmail.com on 7 May 2014 at 4:16

GoogleCodeExporter commented 8 years ago
does anyone have this patch, I need it for the w8980 and w9980

link to w8980 http://pastebin.com/E1VZAX4z

link to w9980 http://pastebin.com/4jB9Zcfm

w9980 has vdsl enable in stock firmware, w8980 does not, I'm trying to get 
w9980 firmware running on the w8980 to see if the vdsl gets enabled.

Original comment by horus...@gmail.com on 20 Aug 2014 at 9:01