如何执行原始X86指令的字节数组? [英] How Do I Execute Byte Array Of Raw X86 Instruction?

查看:77
本文介绍了如何执行原始X86指令的字节数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想执行存储在字节数组中的原始EXE,而不将其写入磁盘。就像将它放入内存并以与磁盘上的EXE相同的方式执行它将被双击

I want to execute a raw EXE stored in a byte array, without writing it to disk. Like putting it in memory and executing it in the same way as the EXE on disk would be double clicked

推荐答案

请参阅我对该问题的评论。这些困难将使整个问题难以解决。我会在系统temp目录中创建一个临时文件,写一个文件并加载PE图像。



听起来不专业?然后看看微软。在他们的.NET CodeDOM实现中,他们可以选择将一些代码编译到内存中并加载程序集而不使用某些PE文件。并查看它是如何实现的:可执行模块由编译器在临时目录中创建,然后将该文件加载到调用进程中。为什么你不能允许自己这样做?



-SA
Please see my comment to the question. These difficulties would make the whole problem impractical to address. I would create a temporary file in a system "temp" directory, write a file and loaded the PE image.

Sounds non-professional? Then look at Microsoft. In their implementation of .NET CodeDOM, they have an option to compile some code into memory and load the assembly without using some PE file. And look how it is implemented: the executable module is created by a compiler in a temporary directory and then this file is loaded into the calling process. Why can't you allow yourself to do something like that?

—SA


参见CODYQX4在 [C#]中的答案从内存中运行非.NET exe [ ^ ]。确保你包含信用。



希望有所帮助。
See CODYQX4's answer in [C#] Run non .NET exe from memory [^]. Make sure you include credit.

Hope that helps.


这篇关于如何执行原始X86指令的字节数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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