LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How can I add custom data to my executable (https://www.linuxquestions.org/questions/programming-9/how-can-i-add-custom-data-to-my-executable-210545/)

bestofmed 07-28-2004 06:01 AM

How can I add custom data to my executable
 
Hi everyone

Plz I want to ask how to embed custom data in linux standard executables(I mean the ELF exe) so I can extract it using a table definition like method. I tried a previous method which is not what I'm looking for. you can find the method here (the implementation for the example is in delphi).

I want a standard way that is possible for me or for any other developer to find out the custom data.

jim mcnamara 07-28-2004 01:18 PM

I'm guessing this is not steganography, so you probably want a way of embedding completely arbitrary data in object file. Soemtimes it's called stabs. But I'm not sure. It requires writing asm.

Look here:
http://sources.redhat.com/gdb/downlo.../stabs_13.html

infamous41md 07-28-2004 01:19 PM

what exactly do u want for an answer??? append your data to the end of file and go about your business. if you wan to get tricky, then read the ELF standards http://x86.ddj.com/ftp/manuals/tools/elf.pdf , and you'll see that executable files do not need the section header table. any non stripped binary has one, and u can instead embed your data in the sh table, that way the original exe won't change sizes.

bestofmed 07-29-2004 03:24 AM

This is why
 
Thank you for the answers.

The reason I wanna it like that coz I don't want a non standard way to add custom data (there will be incompatability between footers).

i need it for the following projects:
[list=1][*]Linstaller: Installation builder for Linux that will build one execuatable with all the data.[*]Piz: (Zip flipped): a compression program that make selfextractor archives (small installation)[*]Programming a kde thumb viewer for executable files. This viewer will extract the executable information (icon/screenshot/website) and more from the executable and display it.[/list=1]

I don't want my exec to be confused or removed whene someone else add data to the end.
As you see each project try to add custom data using his way. This is not a solution, so I made standard structure to define the content and more. but I'm looking for better solution and I think I found it.


All times are GMT -5. The time now is 03:25 PM.