Check summing question - DSLR Hack development - CHDK Forum  

Check summing question

  • 3 Replies
  • 4730 Views
*

ASalina

Check summing question
« on: 31 / May / 2008, 12:07:13 »
Advertisements
I'm finishing up a program ("mkfir") which will create a .fir file that contains a user written program and a dummy payload (simply a RET instruction). I've got mkfir to assemble the pieces into a single file along with the new headers. Now I want to generate the new check sum for the file. Looking at eos_tools_v11/check_sum/check_sum.c the whole file is used in the calculation, including the existing check sum (in the file's header). How is this possible? Won't an existing check sum value in the file corrupt the calculation of a new sum, or is check summing not that precise?

Once the check summing is worked out I'll only need to do the re-encryption and the .fir will be ready for testing in the camera.

EDIT: Ok, the re-encryption needs to be done before not after the check sum. Done. Still need an answer unless I just experiment.
« Last Edit: 31 / May / 2008, 13:03:55 by ASalina »

Re: Check summing question
« Reply #1 on: 31 / May / 2008, 16:19:52 »
the easy way: paste 00 00 00 00 in the checksum. count the checksum for the whole file. paste it in the file :-)

*

ASalina

Re: Check summing question
« Reply #2 on: 31 / May / 2008, 18:18:38 »
the easy way: paste 00 00 00 00 in the checksum. count the checksum for the whole file. paste it in the file :-)

Ah! Yes!

*

Offline mx3

  • ****
  • 372
Re: Check summing question
« Reply #3 on: 01 / June / 2008, 00:39:24 »
Looking at eos_tools_v11/check_sum/check_sum.c the whole file is used in the calculation, including the existing check sum (in the file's header).

see eos_fsum.c inn 1D_5D_40D_30D_400D_check_sum folder
skype: max_dtc. ICQ: 125985663, email: win.drivers(at)gmail, eVB decompiler


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal