How do I decompile a .NET EXE into readable C# sou

2019-01-01 04:17发布

I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE?

7条回答
临风纵饮
2楼-- · 2019-01-01 04:55

Telerik JustDecompile is free and has a feature to create projects from .NET assemblies.

查看更多
后来的你喜欢了谁
3楼-- · 2019-01-01 04:58

Reflector and the File Disassembler add-in from Denis Bauer. It actually produces source projects from assemblies, where Reflector on its own only displays the disassembled source.

ADDED: My latest favourite is JetBrains' dotPeek.

查看更多
不再属于我。
4楼-- · 2019-01-01 05:02

You want reflector.

查看更多
笑指拈花
5楼-- · 2019-01-01 05:04

I'm surprised no one has mentioned Microsoft's ildasm. It may not be as pretty as ILSpy or Reflector, but it comes with Visual Studio so many developers already have it.

To run it (assuming VS 2013, should be similar for other versions):

  1. Select Start > All Programs > Visual Studio 2013 > Visual Studio Tools.
  2. Double-click on Developer Command Prompt for VS2013.
  3. Run "ildasm" from the resulting command prompt.
  4. In the tool, select File > Open and open your executable or DLL.

Now you can navigate the DLL structure. Double-click on class members to see the IL. Use File > Dump to export IL to a file.

查看更多
忆尘夕之涩
6楼-- · 2019-01-01 05:07

Reflector and its add-in FileDisassembler.

Reflector will allow to see the source code. FileDisassembler will allow you to convert it into a VS solution.

查看更多
永恒的永恒
7楼-- · 2019-01-01 05:07

Reflector is no longer free in general, but they do offer it for free to open source developers: http://reflectorblog.red-gate.com/2013/07/open-source/

But a few companies like DevExtras and JetBrains have created free alternatives:

DevExtras CodeReflect

JetBrains DotPeek

查看更多
登录 后发表回答