将ARM指令转换为i386指令
有ARM指令到i386指令的转换器吗?
Is there any ARM instruction to i386 instruction Converter available?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有ARM指令到i386指令的转换器吗?
Is there any ARM instruction to i386 instruction Converter available?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
您可以使用 QEMU 在 x86 上模拟 ARM 指令。
You can use QEMU to emulate ARM instructions on x86.
您可以将 ARM 代码逆向工程为 C,然后简单地编译 C 代码。
这家公司实际上从汇编程序生成了相当不错的C代码。 (我从未使用过他们的产品,但我熟悉该公司背后的研究)。
You could reverse-engineer the ARM code to C, and then simply compile the C code.
This company actually produces pretty good code C code from assembler. (I've never used their product, but I am familiar with the research behind that company).
模拟或静态二进制翻译是我会采取的路径,每种方法都有其优点和缺点。
你需要更清楚你要问什么。将一个指令集简单地转换为另一个指令集是一回事,使结果变得有用的更困难的部分是您正在解决的问题。您的 ARM 内存和寄存器空间与 X86 不匹配,因此直接指令到指令(模拟或 sbt)是不够的,您必须添加代码来替换许多加载和存储,以检查地址、确定什么它正在寻址并模拟该外围设备(模拟或 sbt)。
Emulation or static binary translation are the paths I would take, each has its pros and cons.
You need to be more clear about what you are asking. The simple translation of one instruction set to another is one thing, the harder part of making the result useful is what you are addressing. Your ARM's memory and register space will not match the X86, so a straight instruction to instruction (emulated or sbt) will not be enough, you have to add code to replace many of the loads and stores with something that checks the address, determines what it was addressing, and emulate that peripheral (emulated or sbt).
我真的很怀疑。差异太大,无法实现自动化。
i really doubt. there are too much differences to make it automated.
http://www.libcpu.org/
它还处于测试阶段,但想法是编写 llvm二进制文件的前端,以便 llvm 后端可以为任何支持的平台生成代码。有一个 ARMv6 前端正在积极开发中,我确信他们希望获得帮助。目标是支持任何受支持的体系结构之间的仿真和静态重新编译。
http://www.libcpu.org/
It's very much in beta, but the idea is to write llvm front-ends for binaries, so that the llvm back-end can then generate code for any supported platform. There is an ARMv6 front end under active development, and I'm sure they would like to have help with it. The goal is to support both emulation and static recompilation between any of the supported architectures.
最简单的方法是使用“软件动态翻译”。您可以在此处找到有关该技术的一些信息:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.120.5182&rep=rep1&type=pdf
它的工作原理是动态翻译“基本块”,您可以在其中将所有指令翻译到控制点(分支、调用、跳转),然后用回调到翻译器的存根替换分支目标处的代码。它大致相当于 CLR 中的“JIT 编译”之类的东西,只不过它在更细粒度的级别上工作(基本块而不是方法)。它比静态翻译方法更有优势,因为它不依赖于准确的反汇编。获得完美的反汇编是不可能的(相当于停机问题)。即使真正优秀的反汇编程序(如 IDA pro)也可能在识别异常处理程序等内容时遇到问题,并且经常将代码与数据混淆。
然而,软件动态翻译不受任何这些限制。它甚至可以(理论上)使用适当的内存保护技术来处理自修改代码。
The easiest way to do this is to use something called "Software Dynamic Translation". You can find some information on the technique here:
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.120.5182&rep=rep1&type=pdf
It works by dynamically translating "basic blocks", where you translate all instructions up to a control point (branch, call, jump) and then replace the code at branch targets with stubs that call back into the translator. It is roughly equivalent to something like "JIT Compilation" in the CLR except that it works at a more granular level (basic blocks instead of methods). It's advantageous over static translation approaches because it doesn't rely on accurate disassembly. Acquiring perfect disassembly is not possible (it's equivalent to the halting problem). Even really good disassemblers, like IDA pro, can have problems identifying things like exception handlers and often confuse code with data.
Software dynamic translation, however, is not subject to any of these limitations. It can even (in theory) handle self modifying code using appropriate memory protection techniques.
微软提供了设备模拟器,它正是这样做的。
第一个版本甚至附带源代码: http:// www.microsoft.com/download/en/details.aspx?displaylang=en&id=10865
microsoft provides the device emulator, which does exactly that.
the first version even comes with source code: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=10865