Decompiling an ARM asm back to C

给你一囗甜甜゛ 提交于 2020-01-02 05:30:10

问题


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?


回答1:


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 : )




回答2:


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.




回答3:


You can using radare2 decompiler plugin (r2dec), it convert asm to pseudo-C. But I think converting manually very interesting.



来源:https://stackoverflow.com/questions/3197751/decompiling-an-arm-asm-back-to-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!