I'm currently looking for a way to add data to an already compiled ELF executable, that is, embedding a file in an executable without recompiling it.
I could easily do this with cat myexe mydata > myexe_with_mydata , but I could not access the data from the executable file because I do not know the size of the original executable file.
Does anyone have any idea how I can implement this? I thought about adding a section to the executable or using a special marker (e.g. 0xBADBEEFC0FFEE ) to detect the beginning of the data in the executable, but I do not know if there is a more beautiful way to do this.
Thanks in advance.
binary file-format elf embed
Pierre bourdon
source share