2020-04-29 01:39 AM
Right now, i have generated a hex file using objcopy, added a crc etc to it.
Now, is there any way to add this hex information back to the original elf file? It would be nice to have it all packaged in one file back again.
2020-04-29 03:23 AM
The ELF object format is documented, you can work on it with the usual File IO functions.
If adding data into sections you might have to expand and re-render the object file. If you've left space or a place holder via linker, etc you can do a more simple substitution or patch of the data in-place.
2020-04-29 07:49 AM
I have heard that production programmer machines can put individual serial serial number into a hex data, but there must be a place for it. HEX file is a text file.
2020-04-29 08:51 AM
Typically you can specify an address, or use substitution on a string constant "*SERIAL*" or whatever. Objects provide for sections and symbols to locate things by name.
Traversing and modifying binary, object and hex files should be within the scope of a software engineer.