Hello, a little background of what I am doing: I have a project which uses some keys in his code in the initialization. The thing is that I would like to change these keys to generete several .hex files. It would be a set of keys, for each differente .hex. To achieve this the thing would be open the project change the keys for a new ones, and compile again, which would be repeat everytime that I need to generate another hex file. The goal of this is to have .hex tied to some hardware that just work on his particular device.
This process would be a little long and boring, so which I tried to do is a program that open the .hex file (motorola-s format), look for the old keys, and write the new ones. I have already finished the program and is working quite well, of course the program takes care of motorola-s format and checksum bytes. Well, but this is not working well because of this:
For example I have this key: char MyKey[4]={0x00,0x01,0x02,0x03} (yeah complicated key xD)
and if I just change one bye like this: char MyKey[4]={0xFF,0x01,0x02,0x03} and I compile, I obtain an .out and then I use hex2ais to generate the hex file, I really can see that the place where it was the key has obviously change the 0x00 to 0xFF value. But.... there is other bytes almost in the end of the .hex file that have changed too, and this is what my program is not doing, so I cannot generate the .hex properly. I guess that these bytes that are changing are something like a complete checksum or some kind of hash bytes... does someone know something about this?
What these bytes are changing when I am just changing the value of one byte in the code? How I could recalculate the value of these bytes? This would very helpful to me because I could automatize my work and do it very fast... I would be greateful for any help.
Thanks and best regards