I've got some old Windows executable files. How can I edit them with Visual Studio 2010? What are the ways to see an exe's source code?
If the program was written in C# you can get the source code in almost its original form using .NET Reflector. You won't be able to see comments and local variable names, but it is very readable.
If it was written C++ it's not so easy... even if you could decompile the code into valid C++ it is unlikely that it will resemble the original source because of inlined functions and optimizations which are hard to reverse.
Please note that by reverse engineering and modifying the source code you might breaking the terms of use of the programs unless you wrote them yourself or have permission from the author.
If it is native code, you can disassemble it. But you wont see the original code as writte by the programmer. You will see the code produces by the compiler (assembler). This code is possibly optimized and although it is semantically equivalent, it can be much harder to read than normal ASM.
If it is bytecode (MSIL or javabytecode), there are decompiler which can product pretty good sourcecode. For .net, this would be reflector.
You can't get the C++ source from an exe, and you can only get some version of the C# source via reflection. Neither will be of much use to you, judging from the way you asked the question.
There's nothing you can do about it i'm afraid as you won't be able to view it in a readable format, it's pretty much intentional and it'll show the interpreted machine code, there would be no formatting or comments as you normally get in .cs/.c files.
It's pretty much a hit and miss scenario.
Someone has already asked about it on another website
I would (and have) used IDA Pro to decompile executables. It creates semi-complete code, you can decompile to assembly or C.
If you have a copy of the debug symbols around, load those into IDA before decompiling and it will be able to name many of the functions, parameters, etc.
You can use Reverse Engineering. You can find Some Decompilers for the Languages. It gives not the exact code, only the asm code.