Here's what I gather from your question, and your comments:
- You want to know if it is possible to execute an executable embedded into your program, without extracting it to disk first
- Your program is a .NET program
- The executable you want to execute is not a .NET program
The answer to that is: yes
However, the answer to that is also it is very, very, hard
What you have to do is, and note that I do not know all the details about this since I don't do this, but anyway:
- Load the executable code into memory
- Remap all addresses in the binary image so that they're correct in relation to the base address you loaded the executable at
- Possibly load external references, ie. other DLL's that executable need
- Remap the addresses of those references
- Possibly load references needed by the just loaded referenced DLL's
- Remape those dll's
- Repeat 3 through 6 until done
- Call the code
I'm assuming your question is "can I do 1 and 8", and the answer to that is no.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…