问题
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