如何反编译.dll文件?

问题描述 投票:0回答:7

我有一个.dll,我想反编译以对代码进行一些改进。有哪些工具可以让我做到这一点?

我相信它是用 VB 编写的。

dll decompiler
7个回答
35
投票

答案取决于 DLL 是用什么语言编写的。

如果它是 .NET 语言,那么正如所指出的,您可以使用 .NET Reflector。

如果是较旧的 Visual Basic(.NET 之前的版本),则 DLL 会被编译为所谓的 p 代码,并且有一些 选项可用于对反编译进行一些变体

最后,如果是用C++这样的语言编写的,没有直接的方法来获取源代码。这样的DLL被编译为机器语言,只能直接反编译为汇编语言。

所以,这又取决于所使用的语言。答案可能是不可能获得任何类似于原始源代码的东西。


16
投票

JetBrain 的 dotPeek 号称免费 .NET 反编译器和程序集浏览器,对我来说非常有用:快速、简单,当然最重要的是免费!


2
投票

.NET 反射器!!!

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

它甚至是免费的,你不需要专业版就可以看到反汇编代码。


2
投票

市场上有很多付费工具。但我使用免费工具,不仅可以看到反汇编代码,而且还可以调试代码。 例如,假设有一个在 .Net 中开发的 exe,我可以使用这个称为 DnSpy 的工具来调试该编译代码。

http://xyzcoder.github.io/dll_decompiling/decompiled_dll_debugging/dnspy/2018/06/07/dnSpy-For-DeCompiling,Debugging.html


0
投票

由于这是一个较旧的问题,并且自问以来发生了很多事情,我想我会添加几个反编译器的链接,这可能对其他寻求解决方案的人有用。

ILSpy https://github.com/icsharpcode/ILSpy/releases

完全免费并根据当前的 Git README.md:

反编译器前端

除了 WPF UI ILSpy(可通过版本下载,另请参阅插件)之外,还可以使用以下其他前端:

Visual Studio 2022 ships with decompilation support for F12 enabled by default (using our engine v7.1).
In Visual Studio 2019, you have to manually enable F12 support. Go to Tools / Options / Text Editor / C# / Advanced and check "Enable navigation to decompiled source"
C# for Visual Studio Code ships with decompilation support as well. To enable, activate the setting "Enable Decompilation Support".
Our Visual Studio 2022 extension marketplace
Our Visual Studio 2017/2019 extension marketplace
Our Visual Studio Code Extension repository | marketplace
Our Linux/Mac/Windows ILSpy UI based on Avalonia - check out https://github.com/icsharpcode/AvaloniaILSpy
Our ICSharpCode.Decompiler NuGet for your own projects
Our dotnet tool for Linux/Mac/Windows - check out ILSpyCmd in this repository
Our Linux/Mac/Windows PowerShell cmdlets in this repository

特点

Decompilation to C# (check out the language support status)
Whole-project decompilation (csproj, not sln!)
Search for types/methods/properties (learn about the options)
Hyperlink-based type/method/property navigation
Base/Derived types navigation, history
Assembly metadata explorer (feature walkthrough)
BAML to XAML decompiler
ReadyToRun binary support for .NET Core (see the tutorial)
Extensible via plugins
Additional features in DEBUG builds (for the devs)

泰勒里克 https://www.telerik.com

这是免费/试用/付费版本,支持多种语言。


0
投票

我尝试了 JetBrains 的 DotPeek,但结果不够充分,(“引用编译器生成的字段”存在一些问题),然后我再次尝试 .NET Reflector 11.1更好的结果,但仍然与 DotPeek 的效率差不多。最后我尝试了 Telerik 的 JustDecompile,获得了 总体最佳结果

推荐Telerik JustDecompile,如果您正在寻找一个好的反编译器,它可以保存项目文件。 它也是开源


0
投票

如果它是用“经典”Visual Basic 编写的并且未编译为 p 代码,则您将需要一个反编译器。

我不知道 VB 专用的反编译器,但有 Ghidra,它将本机代码反编译为 C。

© www.soinside.com 2019 - 2024. All rights reserved.