将 ARM 汇编反编译回 C
几年前,我编写了一个很好的 ARM 汇编程序例程,多年来,它在其设计的 ARM 嵌入式系统上出色地完成了工作。现在,是时候将其移植到非 ARM 系统上了,我想知道是否有工具或某种方法可以获取我原始的 ARM 汇编器源代码并从中获取基本的 C 文件。我可能可以在几天内自己完成,但如果有一个起点那就太好了。如果应用程序或方法是免费的就更好了:)
有什么建议吗?
I wrote a nice ARM assembler routine a few years back and it has done its job beautifully over the years on the ARM embedded systems it was designed for. Now, the time has come to port it on to non-ARM systems and I was wondering if there was tool or some sort of method to take my original ARM assembler source and get a rudimentory C file from it. I could probably do it myself in a couple of days, but it would be nice to have a starting point. Nicer still if the app or method was free :)
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
IDA Pro 的 Hex-Rays Decompiler 插件可以反编译 ARM。它有点贵,所以如果您只需要一种常规,可能不是最佳选择。
Hex-Rays Decompiler plugin for IDA Pro can decompile ARM. It's somewhat expensive, so probably not the best choice if you need just one routine.
有几个反编译器可以将 Arm 和 Arm 64 位代码反转为 C。除了前面的回复中提到的内容之外,另外两个专业选项是:
Several decompilers exist to reverse Arm and Arm 64-bit code to C. Aside from what's mentioned in earlier responses, two other professional options are:
不幸的是,我不知道这样的工具......那就太好了......; )
所以我能给出的唯一建议就是专注于逻辑。
你写了汇编代码。所以你知道编码应该做什么。即使使用 ARM 汇编,将其转换为 C 代码也不应该那么困难。
我的意思是,将 C 移植到 ARM 汇编可能是一项艰巨的任务。但对于相反的选项,如果您知道代码逻辑,并且知道如何编写 C,那么应该没问题......
创建 C 结构以简化您正在使用的内存区域。关于算法,它们不会改变。只需在一些结构等的帮助下将你正在做的事情从汇编翻译成C...
抱歉我可以给你这样一个工具...
祝你好运:)
I don't know such a tool unfortunately... Would be nice... ; )
So the only suggestion I can give is to concentrate on the logic.
You wrote assembly code. So you know what to code is supposed to do. Converting it to C code shouldn't be that hard, even with ARM assembly.
I mean porting C to ARM assembly can be a difficult task. But for the reverse option, if you know the code logic, and if you know how to write C, it should be just ok...
Creates C structures to ease the memory regions you are working with. About the algorithms, they won't change. Just translate what you are doing from assembly to C, with the help of some structs, etc...
Sorry I can give you such a tool...
Good luck : )
您可以使用radare2反编译插件(
r2dec
),它将asm转换到伪C。但我认为手动转换非常有趣。You can using radare2 decompiler plugin (
r2dec
), it convert asm to pseudo-C. But I think converting manually very interesting.