How to execute an executable embedded as resource

前端 未结 3 2067
醉话见心
醉话见心 2021-02-07 21:13

Is it possible to execute an exe file that is included in the project as a resource? Can I fetch the file as a byte array and execute it in memory?

I don\'t want to writ

3条回答
  •  攒了一身酷
    2021-02-07 21:42

    Its not very easy to create a new process from a memory image, all of the kernel functions are geared towards loading an image from disk. See the process section of the Windows NT/2000 native API reference for more information - page 161 has an example of manually forking a process.

    If it is ok to run the code from within your own process then you can create a small DLL that will take a pointer to executable data and run it.

提交回复
热议问题