Well, it was not the header you should correct, it was the length of the original TP-Link firmware that was wrong.
You had lost the first byte in the stock firmware, (0x01) (and you obviously don't understand how the checksum is calculated).
Here is a file with correct header, correct length, and correct checksum: _________________ Kernel panic: Aiee, killing interrupt handler!
It is the 1's complement of the CRC-32 digest over the area from 0x0c to the end of the file.
The value is 32-bit big endian stored in position 0x08 - 0x0b.
Since a TP-Link bootloader stripped firmware is 0x3c0000 bytes long (4MB flash)or 0x7c0000 bytes long (8MB flash) then the checksum'ed are will be 0x3c0010 and 0x7c0010 respectively. _________________ Kernel panic: Aiee, killing interrupt handler!
I admit that on the actual specifics of what content is being checksum'd, I am ignorant as I have gone back and tried every way to run a checksum and still did not come up with the 4 bytes in your file. Could you enlighten us all so as to prevent future blunders?
Ignorant because you could have used almost any dd-wrt firmware to test your theories on, most of them contains a trx header with a correct checksum and you should not had published files for users until you could generate and verify a checksum on a dd-wrt firmware.
There is of course source code for it somewhere in the dd-wrt .svn and if you can't find it there then get it from openwrt.
Joined: 31 Jul 2021 Posts: 2146 Location: All over YOUR webs
Posted: Tue Apr 05, 2022 10:59 Post subject:
I did remove the offending attachment a few days back of the incorrect fw to prevent any side issues, sadly file had been downloaded 8 times at the time I read LOM's original reply that `length of the original TP-Link firmware was wrong` and correct file ad been attached with reply.
Joined: 08 May 2018 Posts: 13904 Location: Texas, USA
Posted: Tue Apr 05, 2022 14:18 Post subject:
@LOM: Thanks for the clarification; to explain the blunder completely, the included checksum of the file I provided was copied directly from the webflash file's header for this specific device I used for reference, which was obviously a gross error on my part. The only other thing I'm a little lost on is the specific process on how to create this checksum; or rather, is this checksum calculated against only the bootloader-stripped stock firmware or what exactly. Perhaps I am not reading your commentary as I should... _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
Linux User #377467 counter.li.org / linuxcounter.net