-1

I lost my source code file code.c on my Linux virtual machine. It is a code I wrote some months ago, and I need to open and read it now.

But I cannot find it anymore. All I have is the executable file c after compile it using GCC like this.

$ gcc -o c code.c

So how can I get the code.c from its executable? I tried to search on Google to solve it, but unfortunately all answers were “impossible to get it”.

5gon12eder
  • 24,280
  • 5
  • 45
  • 92
Samah
  • 61
  • 1
  • 10

2 Answers2

1

Tracing out the source code from executables is a tough task and requires a lot of effort. It can be done through decompilers like hex-rays, but even such softwares fail to decompile the executables to its original source code.

You should consider recovering your data instead of decompiling.

srishabh
  • 141
  • 9
0

I once deleted my workspace by mistake with the rm linux command. The only way for me to recover the files was restoring software.

I guess you are using linux too because of the linux tag. The one I used was Test Disk, there are several manuals on how to use it, it's not difficult.

The only thing to take into account is that the more memory you use, more likely will be to overwrite your missing file. Good luck!

UDKOX
  • 738
  • 3
  • 15