Embedding an external executable inside a C# program and run it without creating new file [duplicate]

三世轮回 提交于 2019-12-11 04:45:34

问题


Possible Duplicate:
How do I invoke an exe that is an embedded resource in a .Net assembly?

How do I embed an external executable inside my C# ( I suppose via Resources, but I don't know about other ways, so this option is needed in this question - too ) and run this program inside main running program without writing it to the disk.

How could it be done?


回答1:


Despite Hans' comment I think it is pretty easy* (assuming code have enough privilegies to do that). Essentially you want to fake local drive (or network drive if it works for your evil code).

Network drive can be easiy created by implementing DAV in your own program and that pointing network path to that machine using WebDAV client.

Local drive should be possibible too (also I'm not sure if any .Net implementations are avaialble) by for example implementing Minifilter Driver and setting it up, but I strongly suspect that there is no way to have it run from the only executable...

*Easy as in "does not require significant unsupported hacks", time estimates and necessary level of knowledge is not considered.



来源:https://stackoverflow.com/questions/12020758/embedding-an-external-executable-inside-a-c-sharp-program-and-run-it-without-cre

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!