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.