Topic: turnning c code into shellcode like bytestring
I am asking myself if there is an easy way to turn a compiled c program into a shellcode like byte string, which can be injected into an other executable.
to explain my question a bit more here an example:
for example if I would write a "hello world!" program then the "hello world" string would be in the data segment and the code would be in the text segment. But I want to have the whole code+data in one text segment.
I thought there must be some kind of gcc option to archive that but i could not find it.
So if there is no compiler option like that: Is there an easy way to turn a "normally" compiled program into this shellcode like bytestring. What would I have to care about if i would like to write a program which does that?