I like to inject DLLs to processes, because I can change certain values of a program.
The only minus with dll is that they are not very portable friendly and making them portable consumes a lot of code.
I just wanted to know is it possible to inject an application (to a process) that is stored in a resource and then later execute it?
If so, what code parts may differ from the dll’s injecting?
Your question is not tagged “Windows” but from the wording I’ll still assume you refer to Windows.
Given the necessary access rights, it is possible to inject an executable to another process, the
forkimplementation in cygwin is a proof of concept. Windows does not support anything likefork, at least not exposed in the public API. Cygwin implements it by creating a new process and injecting its own process into the other one (including all data). Reading from a resource instead and injecting that is just about the same thing.One of the differences (and difficulties) may be the image base, which is (normally) always the same under Win32. For a DLL it is an usual thing to be rebased, for an executable it is not. On the other hand, if you want to inject code in addition to an already existing process’ code, then the addresses you want may not be free.