2014年12月22日 星期一

tp link router flash rom (For tp link 940N v2.1)

For tp link 940N v2.1

1. Download openwrt-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin or find in openwrt download page.
link: https://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/

2. Open it in a hex editor. Look at offset 0x40. There should be the following bytes: 08 41 00 08. Modify to: 09 41 00 05
link: http://mh-nexus.de/en/hxd/

3. Get mktplinkfw.c, md5.c and md5.h.
Compile the tool: gcc -Os mktplinkfw.c md5.c -o mktplinkfw.
Run: ./mktplinkfw -i *-factory.bin

4. Look for the expected MD5Sum1: expected : e5 67 34 4d 04 99 20 60 f5 76 c6 04 15 81 ab f8

5. Open the hex editor again, go to offset 0x4c, and copy the MD5 above (it should span from offset 0x4c to offset 0x5b).

6. Go and upload the resulting file to firmware upgrade (in TP-Link web-interface). Good luck.
Many thanks to LOM from DD-WRT and to cable007 for reporting this approach worked with DD-WRT

:)



Reference
https://forum.openwrt.org/viewtopic.php?pid=206667#p206667

I have just put a TL-WR941ND v5.0 router on production with OpenWrt. You can use the same firmware file as TL-WR841N v8, but you need to modify the header in order for the TP-Link web-interface to recognize it as a valid firmware for WR941ND v5.0 hardware.
For the impatient, I have put my modified firmware online: tl-wr941nd_v5.0.bin. MD5 is: db062f1699c760775c5046cc303cba91. It worked perfectly with my router (I did not need to open it at all), but no warranties it will not brick your router, though.
If you want to modify the firmware yourself, do as follows:
Download openwrt-ar71xx-generic-tl-wr841n-v8-squashfs-factory.bin
Open it in a hex editor. Look at offset 0x40. There should be the following bytes: 08 41 00 08. Modify to: 09 41 00 05
Get mktplinkfw.c, md5.c and md5.h. Compile the tool: gcc -Os mktplinkfw.c md5.c -o mktplinkfw.
Run: ./mktplinkfw -i *-factory.bin
Look for the expected MD5Sum1: expected : e5 67 34 4d 04 99 20 60 f5 76 c6 04 15 81 ab f8
Open the hex editor again, go to offset 0x4c, and copy the MD5 above (it should span from offset 0x4c to offset 0x5b).
Go and upload the resulting file to firmware upgrade (in TP-Link web-interface). Good luck.
Many thanks to LOM from DD-WRT and to cable007 for reporting this approach worked with DD-WRT



File name              : wr940nv2_en_3_15_9_up_boot(140627).bin
File size              : 0x003c0000 /  3932160 bytes
Version 1 Header size  : 0x00000200 /      512 bytes
Header MD5Sum1         : f1 66 0b a3 c1 42 34 5d 57 60 81 7e 8d 17 27 88 (*ERROR*)
          --> expected : e5 67 34 4d 04 99 20 60 f5 76 c6 04 15 81 ab f8 
Header MD5Sum2         : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (purpose yet unknown, unchecked here)

Vendor name            : OpenWrt
Firmware version       : r36088
Hardware ID            : 0x09410005 (unknown)
Hardware Revision      : 0x00000001

Kernel data offset     : 0x00000200 /      512 bytes
Kernel data length     : 0x000e9a7c /   957052 bytes
Kernel load address    : 0x80060000
Kernel entry point     : 0x80060000
Rootfs data offset     : 0x00100000 /  1048576 bytes
Rootfs data length     : 0x001c7f05 /  1867525 bytes
Boot loader data offset: 0x00000000 /        0 bytes
Boot loader data length: 0x00000000 /        0 bytes
Total firmware length  : 0x003c0000 /  3932160 bytes