I have this D-Link firmware and would like to identify checksum type used on it and add it to OpenWrt bin file so I could upgrade firmware to OpenWrt instead default crappy D-Link. I did tried to update it through Realtek bootloader cli but it gave me an error

Booting...
OK
OK



---RealTek(RTL8196E-kld) version v6.0.4e(2013.02.22-18:00+0800) [16bit](380MHz)
P0phymode=01, embedded phy

---Ethernet init Okay!


**TFTP Client Upload, File Name: openwrt-realtek-rtl8196e-AP-fw.bin
-\|/-\|...|/-
**TFTP Client Upload File Size = 003AA004 Bytes at 80500000

Success!
<RealTek>checksum failed  80500000  00009fa5

Here is what binwal says

$ binwalk DIR-605L_v2.08UIBetaB01.bin 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
11280         0x2C10          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2547712 bytes
658466        0xA0C22         Squashfs filesystem, big endian, version 2.0, size: 89101 bytes, 8 inodes, blocksize: 65536 bytes, created: 2017-06-09 02:24:25
748596        0xB6C34         Squashfs filesystem, big endian, version 2.0, size: 2592128 bytes, 512 inodes, blocksize: 65536 bytes, created: 2017-06-09 02:24:40

1- If you own original firmware bin image you could use hex workshop, open it: tools -> generate checksum, keep results. Also you have online websites with specific CRC algorythm, MD5, MDC2, and so on... Keep as much results as you could for next step..

2- Normally checksum bytes should be at the end of the file (EOF) and usually is a CRC32 (4 bytes lenght). So collect all checksums and take a look to results if match ok.

Then you would be able to generate correct checksum with proper algorythm, just in case as the bootloader makes.

Never loose the faith :-)

  • If it bee that easy :) But if I calculated it from whole file it would not be correct it will be calculated with actual check sum and I dont know where is it stored, its not at EOF because it ends with LZMA EOF byte, so its somewhere at header, or is it first extracted and then calculated ? To many questions with unknown answer for not :) But tnx for helping out :) – Vido Jan 11 at 7:21

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.