Executing an unmanaged exe from memory?

I know it is certainly possible to embed a managed exe as a resource into an executable, and then use Assembly.Load(byte[])  to load it, and then invoke it's EntryPoint to execute it. However, I have yet to find a way to imbed an unmanaged exe as a resource in an executable and invoke it in memory in a similar fashion. Does anyone know if it is possible Thanks.


Answer this question

Executing an unmanaged exe from memory?

  • SanG_123

    No, that is not directly possible with a reasonable amount of effort. If you are familiar with the Nt subsystem API and aren't worried about using officially undocumented features you can probably do it and there are functions intended for debuggers which allow you to achieve this effect using documented Win32 APIs, but not in a way that is to be recommended for a production application.

    If it is important enough for you to spend a very significant amount of time on, experts can be found in the following newsgroup:
    http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.win32.programmer.kernel&lang=en&cr=US

    Ronald Laeremans
    Visual C++ team

  • Executing an unmanaged exe from memory?