What exactly are you trying to accomplish?
It is a like a little serial number, I will have a program in the PC this program will read the hex file and will be able to program this hex file on the Arduino, but I need to have tracking of the number of devices in the wild that is why the serial number, so the PC program shall be able to read the hex file and modify it in the desired location to add the serial number and then flash it this will be done automatically every time I hit the program button it just needs the initial hex file, the address (maybe also length) at which the hex file is going to be modified and the starting serial number. If I input at the start address 0x1F00 and the starting serial number is 1000, the program will generate a new hex file using the input hex file and adding 1000 to the address 0x1F00 (in this case It uses 2 bytes) also calculate the correct checksum of the hex file, after I hit program, and everything is successful it will automatically generate the new hex file with the serial number 1001 and put it in the location 0x1F00 I can just hit program again and this new hex file will be programed in the Arduino with the serial number 1001 and so on. So, in this way if I go to any of this devices, I will be able to read it serial number and see when it was programmed and have a tracking if this has had some issue before. Ideally this same PC software will also print a label with the serial number so the user (who programs the Arduinos) can put the label on it and both serial numbers shall match. To be clear I am not asking about the PC software just I way I can put this variable in a specific location on the Arduino
I hope this describes the process I want to do
Do you want to take the compiled hex file and modify it before loading onto the arduino, instead of just recompiling the sketch when the data changes? Yes