[英]How do I invoke an exe that is an embedded resource in a .Net assembly?
I have a non-.Net executable file that is included in my .net assembly as an embedded resource. 我有一个非.Net可执行文件,作为嵌入式资源包含在我的.net程序集中。 Is there a way to run this executable that does not involve writing it out to disk and launching it?
有没有办法运行此可执行文件,不涉及将其写入磁盘并启动它?
This is .Net 2.0. 这是.Net 2.0。
You can load a .NET assembly from a byte array using an overload of Assembly.Load . 您可以使用Assembly.Load的重载从字节数组加载.NET程序集。
However, there are implications for the security model that need to be considered which make things more complex. 但是,需要考虑的安全模型会产生影响,使事情变得更加复杂。 See the discussion here , and also this thread .
请参阅此处的讨论以及此主题 。
If your embedded executable is not .NET then I think you will have to write it out to disk first. 如果您的嵌入式可执行文件不是.NET,那么我认为您必须先将其写入磁盘。
您可能会尝试将您的exe注入暂停的进程,然后唤醒被劫持的进程,但这似乎是灾难的一个秘诀。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.