开发者

How to get source code of a Windows executable?

开发者 https://www.devze.com 2022-12-27 01:04 出处:网络
I\'ve got some old Windows executable files. How can I edit them with Vis开发者_如何学编程ual Studio 2010? What are the ways to see an exe\'s source code?You can\'t get the C++ source from an exe, and

I've got some old Windows executable files. How can I edit them with Vis开发者_如何学编程ual Studio 2010? What are the ways to see an exe's source code?


You can't get the C++ source from an exe, and you can only get some version of the C# source via reflection.


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 won't see the original code as written by the programmer. You will see the code produced by the compiler. 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.


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.


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


Use PE Explorer click here to know more and download


For Any *.Exe file written in any language .You can view the source code with hiew (otherwise Hackers view). You can download it at www.hiew.ru. It will be the demo version but still can view the code.

After this follow these steps:

  1. Press alt+f2 to navigate to the file.

  2. Press enter to see its assembly / c++ code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号