开发者

Execute file in resourses folder without copying it to disk

I have an executable file in the resources folder. I am able to run that file by writing it to the disk then locating the file and use the Process.开发者_开发技巧Start method to run the executable. Here is an example of how I do this:

Execute file in resourses folder without copying it to disk

How can I execute the file without writing it to the disk. Is there a way I can execute the file from memory? Or maybe execute it directly from the resources folder?


You can't. One of the very hard requirements of Windows, an executable must exist on disk. It is fundamental to its architecture. Slowing down the malware authors is a happy side-effect. Google "memory mapped file" if you want to learn more about it.


If it's a .NET exe try Assembly.Load(byte[]). Be wary of CAS though.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜