16

我们有一个生产应用程序,代码是预编译的形式。开发该应用程序的开发人员离开了公司,我们没有任何源代码备份。我们唯一的访问权限是服务器中的预编译代码。我们现在需要修复应用程序中的问题。

有什么方法可以反编译(提取到实际源代码)预编译代码?

4

6 回答 6

15

.NET Reflector中打开 DLL 。

于 2011-01-05T19:58:12.590 回答
4

要更新@xOn 的答案:

由于最近的源代码控制灾难,我不得不从 DLL 中恢复我的项目。可悲的是,我对程序很了解:

  1. Get .Net Reflector from here: http://www.red-gate.com/products/dotnet-development/reflector/

  2. You do not seem to need FileDisassembler.

  3. Either load your bins in Reflector or double click them.

  4. Mind that the .Net framework might have not maintained your original project file structure. So if some of your ASPX pages shared the same basic class name in different .cs files (I.E. Inherits tag is the same, but CodeFile tag differs), you would not be able to simply "export source code". Don't go blindly exporting source files. It won't work.

  5. There will still be some work to be done before being able to just fire up the old build button. For example - DLLs can refer to property's getter/setters directly. You will have to fix that.

Good luck.

于 2014-03-07T17:58:22.883 回答
3

从...开始:

http://www.red-gate.com/products/dotnet-development/reflector/

...加:

http://www.denisbauer.com/NETTools/FileDisassembler.aspx

您必须重新编译后者以将其与反射器的 v6.5 链接(最新,截至本文。)如果您想避免将单个类复制并粘贴到文件中,这是一个很好的附加组件手。它将整个程序集转储为 .cs 文件。我认为它甚至可以生成一个 csproj。

这两种工具都是免费的。

于 2011-01-05T20:03:33.880 回答
0

我发现使用 .NET Reflector 工具可以只读取 dll,但无法提取源代码。而且一旦网络表单被预编译,我们甚至无法取回文件背后的代码。我们所能做的就是调试和分析代码。

于 2011-02-14T19:52:44.457 回答
0

我有类似的问题并使用反射器对其进行反编译。我得到了源代码,然后更改了我想要的位,然后重新构建它。然后我再次将该 dll 复制到生产站点。它开始反映我的变化。这很简单,一点也不难,可能是因为预编译站点的每个页面都有 dll,并且是可更新的,所以 dll 中只有代码隐藏文件。

供参考:http ://www.reflector.net/

于 2011-12-22T03:12:51.957 回答
0

当您在 Visual Studio 中安装 .net reflecter.its 导入时。然后您在菜单栏上看到了 .net 反射器工具。

点击 .net reflector >>Choose Asseblies (Dll file) 进行调试。

于 2012-06-15T13:32:07.547 回答