How to add custom bytes to the image after build?

I am new to cmake. I want to add custom bytes to the image file and want to read these bytes in the mcu. There will be two usages, device id and custom checksum. I dont want to change h or c files but I want to add something like during or post build.

Can you use install(SCRIPT) or install(CODE) to run custom logic at install time?