如何反编译 .dll 文件?

发布于 2024-10-20 20:55:43 字数 69 浏览 1 评论 0原文

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

我相信它是用VB编写的。

I have a .dll I would like to decompile to make some improvements to the code. What are some tools out there that will allow me to do this?

It's written in VB, I believe.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

断肠人 2024-10-27 20:55:43

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

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

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

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

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

The answer depends on what language the DLL was written in.

If it was a .NET language then, as pointed out, you can use .NET Reflector.

If it's the older Visual Basic (pre-.NET), then the DLL is compiled as what's called p-code and there are a few options for doing some variations on decompiling.

Finally, if it's written in a language like C++, there is no direct way to obtain the source code. Such a DLL is compiled to machine language and can only be directly decompiled to assembly language.

So, again, it depends on the language used. And the answer might be that it's just not possible to get anything resembling the original source code.

谁的年少不轻狂 2024-10-27 20:55:43

JetBrain 的 dotPeek 号称免费 .NET 反编译器和程序集浏览器,非常适合我:快速、简单且易于使用当然最重要的是,免费!

JetBrain's dotPeek billed as the Free .NET Decompiler and Assembly Browser worked great for me: quick, easy, and of course best of all, free!

往日 2024-10-27 20:55:43

.NET 反射器!!!

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

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

.NET Reflector!!!

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

It is even free, you won't need the pro version to see the dissassembled code.

幽梦紫曦~ 2024-10-27 20:55:43

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

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

There are many paid tools out there in the market. But I use a free tool and not only just seeing disassembled code, but I am also able to debug the code.
For example, let's say there is an exe that was developed in .Net, I am able to debug that compile code using this tool known as DnSpy.

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

如果没有你 2024-10-27 20:55:43

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

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

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

Since this is an older question and a lot has happened since asked I figure I would add a couple links to decompilers out there that may be of use to others looking for a solution.

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

Completely Free & according to Git README.md as of current:

Decompiler Frontends

Aside from the WPF UI ILSpy (downloadable via Releases, see also plugins), the following other frontends are available:

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

Features

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)

Telerik
https://www.telerik.com

This one is Free/Trail/Paid Versions with multiple language support.

小情绪 2024-10-27 20:55:43

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

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

I tried the JetBrains's DotPeek but the result wasn't sufficient enough, (there were some issues with "reference to a compiler-generated field") then I gave a next try to .NET Reflector 11.1 with a little bit better result, but still almost as DotPeek's efficiency. Last I tried Telerik's JustDecompile, with the overall best result.

I recommend the Telerik JustDecompile, if your're looking for a good decompiler, which can save a project file.
It is also open source!

情深已缘浅 2024-10-27 20:55:43

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

我不知道特定于 VB 的反编译器,但有 Ghidra,它将本机代码反编译为 C。Ghidra 于 2019 年向公众开放,距离这个问题最初发布很久之后。

If it's written in 'classic' Visual Basic and not compiled to p-code, you will need a decompiler.

I'm not aware of a VB-specific decompiler, but there is Ghidra, which will decompile native code to C. Ghidra was made available to the public in 2019, long after this question was originally posted.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文