Is it possible to decompile in C (changing from object file to source code )? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Is it possible to decompile in C (changing from object file to source code )?

24th Feb 2018, 7:35 AM
Kimiya Nayyeri
Kimiya Nayyeri - avatar
3 Answers
0
You can't get the same original C code (e.g. you will loose comments, white spaces might look different, variables might have different names) but you may be able to obtain a C version that could be compiled into the same object file you started with. I must warn you that there are copyright laws that could be infringed depending on what program you are trying to decompile. Wikipedia has some information about its legality (https://en.wikipedia.org/wiki/Decompiler#Legality) but I would advice consulting a copyright lawyer if the code you are trying to retrieve a code of your own that you happened to delete by accident. You can look into the suggestions of this answer for more information: https://stackoverflow.com/a/29183452/2225532
25th Feb 2018, 6:08 AM
Kevin Hernandez
Kevin Hernandez - avatar
0
what do you mean by white spaces in C?
25th Feb 2018, 9:39 AM
Kimiya Nayyeri
Kimiya Nayyeri - avatar
0
I was referring to things that are likely to look different to the original source code. Maybe your indentation settings are different to the ones in the result of a decompiled version. Cosmetic aspects of the original source code (what you see when looking at the code, not the result of running the code) may look different between original and decompiled versions. Comments and white spaces are two examples
25th Feb 2018, 3:54 PM
Kevin Hernandez
Kevin Hernandez - avatar