The firmware i want to modify consists of 3 parts. 3 times Header + cramfs.img + new_20.bin. Just the last one worked on the DVR. So i will continue with the last one
Decrypting and encrypting is working because md5 values of the files are the same.
Following steps done:
Extracting cramfs.img and its contents, decrypting, modifying, encrypting, decrypting new_10.bin, modifying MD5 values stored in new_10.bin, encrypting new_10.bin, using mkcramfs to create new cramfs.img, decrypting new_20.bin, save new MD5 value of cramfs.img new_20.bin, encrypting new_20.bin, creating dav file with hex editor.
But the update fails. i get "Upgrading failed, execute program error"
So i just tried to make a new firmware with unmodified files. But the new cramfs.img with the unmodified files is different to the one stored in the original dav file.
Even when i modifiy the md5 in the new_20.bin the update with the unmodified files fails. the DVR reads the dav file till the end and then i get the error "Upgrading failed, execute program error"
So i think the problem is generating the cramfs.img. Am i right?