0

How do I view the code behind an .exe program on Linux? I want to see the programs code because I want to see how it works. I am just learning coding, so I thought the program would be cool to look at!

3
  • What is a .exe? File extension are just visual markers for us humans ;-) If you meant an executable in linux it will be easier to find the source code in the repositories.
    – Rinzwind
    Nov 16, 2015 at 21:04
  • Combined with askubuntu.com/q/481/158442
    – muru
    Nov 16, 2015 at 21:06
  • Yes Rinzwind. How do I do that? Nov 16, 2015 at 21:07

3 Answers 3

0

If you want to see the source for Linux executables, install the apt-src package (sudo apt-get install apt-src), and read man apt-src. Then you can use apt-src to get the source for ANY Ubuntu package.

0

There exists something know as decompiler. When you create a program in a compiled language, such as C, you use compiler that translates human-readable code into machine-level code. Decompiler does the opposite. Here's a small list of C decompilers, from stackoverflow question.

I don't have experience with decompilers , but my guess is that if a program is non-open source, you wouldn't be able to decompile it.

With open-source apps , it's easier - you can use apt-get source package-name or just look up an app on git-hub

1
  • 1
    It doesn't matter whether the source code was open source or not, the problem is that often being the compilation not a 1:1 conversion there are multiple "ways" back to an equivalent source code, so the decompiled source might not be identical, although functionally equivalent; nonetheless preprocessor directives, comments and whitespace are lost, and symbols are not always recovered; sequences of bare assembly instructions in the decompiled source code are frequent.So unless you're using a really good decompiler and you're lucky enough you usually get only a rough idea of the original source.
    – kos
    Nov 17, 2015 at 8:17
-1

You cant, .exe are executable binaries for windows, there's no code, just machine instructions. If you use Linux or Mac you can easily find the raw sources in the temp src folder of your package manager (brew, yum, apt-get...), Unix systems downloads the sources and (sometimes) builds it on your own machine

1
  • Normally only binaries are downloaded. You have to ask for the source code if you want it with apt-get source packagename. And of course, the question was about a windows executable, for which this does not apply.
    – psusi
    Nov 16, 2015 at 23:29

Not the answer you're looking for? Browse other questions tagged .