How to convert a .o file back to a .c file in C? [closed]

若如初见. 提交于 2021-02-07 10:15:38

问题


I'm sure there's a way. I'm new to C and my research on this led me nowhere. Is there a command that can convert a .o file to .c?


回答1:


Usually you can only determine the assembly language for the object file, using a disassembler. Here are a few links to discussion on that topic, e.g., for objdump:

  • objdump - GNU Binary Utilities
  • Disassembling a binary in Linux
  • Using GCC to produce readable assembly?
  • Linux Interactive DisAssembler

Reverse-compiling (decompiling) is much harder. Here are a few links to help:

  • What's a good C decompiler?
  • Reverse Engineering Resources - Decompilers



回答2:


.o file has object code and cannot be converted back to its original .c file having high level code . It is just like the fact that chewed food cannot be converted back to its solid form.



来源:https://stackoverflow.com/questions/29179620/how-to-convert-a-o-file-back-to-a-c-file-in-c

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