的Process.Start()嵌入exe文件无解压到文件的第一个C# [英] process.start() embedded exe without extracting to file first c#

查看:282
本文介绍了的Process.Start()嵌入exe文件无解压到文件的第一个C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有嵌入我的应用程序资源的可执行文件。 ATM我使用汇编反射来解压缩可执行到它自己的文件,然后开始使用执行过程中,START()。是否有可能运行写它先申请从流中嵌入可执行直呢?可能有人请告诉我最有效的方式做到这一点吧。

I have an executable embedded into my app resources. ATM I use assembly reflection to extract the executable to its own file and then start the executive using process,START(). Is it possible to run the embedded executable straight from a stream instead of writing it to file first? Could someone please show me the most efficient way to do this please.

推荐答案

下面是我从你的问题聚集,您的意见:

Here's what I gather from your question, and your comments:

  1. 您想知道是否可以执行嵌入到你的程序的可执行文件,没有它先解压到磁盘
  2. 您的程序是一个.NET程序
  3. 您要执行的可执行文件不是一个.NET程序

这个问题的答案是:

不过,这个问题的答案也是这是非常,非常难

However, the answer to that is also it is very, very, hard

什么,你需要做的是,请注意,我不知道所有关于这个细节,因为我不这样做,但无论如何:

What you have to do is, and note that I do not know all the details about this since I don't do this, but anyway:

  1. 加载可执行code到内存
  2. 重新映射在二进制图像,这样他们就在你加载的可执行文件的基地址正确的所有地址
  3. 在可能加载外部参照,即。其他DLL的该可执行文件需要
  4. 重新映射的地址的这些的引用
  5. 在加载可能需要的只是加载的DLL引用的
  6. 引用
  7. Remape的这些的DLL的
  8. 重复3到6,直到完成
  9. 调用code
  1. Load the executable code into memory
  2. Remap all addresses in the binary image so that they're correct in relation to the base address you loaded the executable at
  3. Possibly load external references, ie. other DLL's that executable need
  4. Remap the addresses of those references
  5. Possibly load references needed by the just loaded referenced DLL's
  6. Remape those dll's
  7. Repeat 3 through 6 until done
  8. Call the code

我假设你的问题是我该怎么办1和8,这个问题的答案是

I'm assuming your question is "can I do 1 and 8", and the answer to that is no.

这篇关于的Process.Start()嵌入exe文件无解压到文件的第一个C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆