Packing a file into an ELF executable

Posted by Pierre Bourdon on Stack Overflow See other posts from Stack Overflow or by Pierre Bourdon
Published on 2010-05-24T23:07:02Z Indexed on 2010/05/24 23:11 UTC
Read the original article Hit count: 315

Filed under:
|
|
|

Hello,

I'm currently looking for a way to add data to an already compiled ELF executable, i.e. embedding a file into the executable without recompiling it.

I could easily do that by using cat myexe mydata > myexe_with_mydata, but I couldn't access the data from the executable because I don't know the size of the original executable.

Does anyone have an idea of how I could implement this ? I thought of adding a section to the executable or using a special marker (0xBADBEEFC0FFEE for example) to detect the beginning of the data in the executable, but I do not know if there is a more beautiful way to do it.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about binary

Related posts about embed