Is there any way to get the source code by using object file in C?
For example I have a source code simple.c
cc simple.c
Now I have a.out (object file). By this a.out whether can I get the source?
code of simple.c
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are many useful tools to retrieve information from your executable. None of them is able to give you back the original source code (as some other user pointed out, it’s impossible for C), but you can try some reverse engineering tools. My preferred one are:
With the first one you can actually get all the exported symbols and their relative executable code in terms of assembly (obviously this is true only for the
.textsections). The second one is aimed to work with intel architectures, but you will be able to analize every executable file and get information about the ELF sections and symbols.