推荐.Net、C# 逆向反编译四大工具利器

在项目开发过程中,估计也有人和我遇到过同样的经历:运行环境出现了重大Bug亟需解决、或者由于电脑挂了、旧代码覆盖新代码,而在这种情况下,我们不能直接在当前的代码中修改这个Bug然后发布,这会导致更严重的问题,因为相当于版本回退了。还有电脑挂了代码整个都没有,这种情况下 我们只能只能利用一些逆向的技巧和工具了 来解析在服务器发布好的dll。那么你只是单纯的修改一个.Net程序集中的某个方法或功能,而且这个程序集还是出自于你自己或你所在团队之手,这实在是一件非常容易的事情,这和破解别人的程序完全不同,你不会遇到无法破解的加密算法,也不会遇到让人恶心的加壳混淆。所以我要把用过的工具一个个的列出来总结一下。

推荐四大发编译工具

1:.Net Reflector  【收费】

一提起.Net逆向,其实很多人第一反应都是Reflector这款神器,这一方面是由于Reflector良好的用户体验和强大的插件功能,另一方面要归功于Reflector堪称完美的智能反编译能力,使用它不仅能看到反编译后的IL源码甚至能直接反编译出C#源码,而且和编写时的代码几无二致,如果需要还可以直接另存为工程文件用Visual Studio打开,不过现在已经收费了,所以老司机都选择破解版,有钱人选择正版。 破解地址就不在这里放出,大家自行搜索.

使用方法:可以直接把dll、exe拖放到左侧,或者文件选择选择

官方网址:http://www.red-gate.com/products/dotnet-development/reflector/

2:ILSpy/dnSpy 【免费】

ILSpy是唯一免费且开源的.NET反编译器,它基于MIT许可证发布。ILSpy的代码生成和语法高亮功能做的非常好。对于反编译的程序集,它既可以将其保存在一个文件中,也可以为所有文件创建一个项目。ILSpy是一个独立的工具,没有Visual Studio集成。,ILSpy 是为了完全替代收费的Reflector而生,它是由 iCSharpCode 团队出品,这个团队开发了著名的 SharpDevelop 。ILSpy 完全开源,ILSpy的使用和上面的Reflector完全类似,可以直接把dll、exe拖放到左侧,或者文件选择选择。

官方网址:http://ilspy.net/跳转到https://github.com/icsharpcode/ILSpy

ILSPY还有一款同门师弟,感觉比ILSPY还强大

dnSpy is a .NET assembly editor, decompiler, and debugger forked from ILSpy

* Assembly editor
* Decompiler
* Debugger
* Tabs and tab groups
* Themes (blue, dark, light and high contrast)

If you want to help, fork the project and send pull requests.

Latest release: https://github.com/0xd4d/dnSpy/releases

Latest build: https://ci.appveyor.com/project/0xd4d/dnspy/build/artifacts


3:JetBrains dotPeek【免费】

JetBrains是捷克的一家软件开发公司,出品了大量著名的开发工具,包括:IntelliJ IDEA、PHPStorm、ReSharper、TeamCity、YouTrack等等,每一款产品都如雷贯耳。dotPeek 是 JetBrains 开发的一款.Net反编译工具,是.Net工具套件中的一个相比于前面几款工具来说,dotPeek算比较小众的一款,它生成的代码质量很高,它还会尝试到源代码服务器上抓取代码。DotPeek的导航功能和快捷键非常便捷。它还能精确查找符号的使用,同时支持插件。DotPeek不能与Visual Studio集成。个人感觉它最大的特色就是Visual Studio风格,这对于那些长期在Visual Studio下进行开发的人来说应该更亲切一点。

官方网址:http://www.jetbrains.com/decompiler/

4:Telerik JustDecompile 【需要输入信息安装】不喜欢这个就卸载了

Telerik JustDecompile是一个免费的.NET反编译器,但是有商业化支持。它生成的代码质量也很高。它可以为反编译程序集得到的代码创建一个项目。JustDecompile提供了健壮的查找功能,能够支持全文查找和符号使用查找。它还有一个插件系统,目前在Telerik的网站上有两个可用的扩展。JustDecompile不能与Visual Studio集成。

官方网址:http://www.telerik.com/products/decompiler.aspx

总结:

使用舒服些如下:

dnSPY>ILSPY>Net Reflector>doPeek

下面是一个dll里面的方法反编译后的对比:

转:https://blog.csdn.net/crisschan/article/details/53170847

dnSpy - 一款 .NET 程序逆向工具

项目地址:https://github.com/0xd4d/dnSpy

项目作者:0xd4d

dnSpy 是一款针对 .NET 程序的逆向工程工具。该项目包含了反编译器,调试器和汇编编辑器等功能组件,而且可以通过自己编写扩展插件的形式轻松实现扩展。该项目使用 dnlib读取和写入程序集,以便处理有混淆代码的程序(比如恶意程序)而不会崩溃。

已发布工具的下载地址:

最新发布:https://github.com/0xd4d/dnSpy/releases

或者通过源码构建该项目,参考 Wiki

特性展示

Edit any method, property or event in C# or Visual Basic

Edit any type (class), method, property, event, field

Add, remove, rename any type (class), method, property, event, field

Edit, add, remove .NET resources and save them to disk

The IL editor allows editing method bodies at the IL level: IL instructions, locals, exception handlers

Debug any .NET assembly, no source code required

Raw contents of locals (eg. decrypted byte arrays) can be saved to disk

Optimizations for smaller screens

Multiple tabs and tab groups

Search assemblies

Assembly analyzer

Highlighted references, keywords, use Tab, Shift+Tab, Ctrl+Shift+Up, Ctrl+Shift+Down to select next or previous reference or Alt+Up/Down for next definition

Structure visualizer adds colorized vertical guide lines between braces; loops, try/catch and conditional blocks are shown in different colors

Structure visualizer is very useful when you're in a method like this:

Go to: Entry Point, Module Initializer, MD Token, MD Table Row

Syntax highlighted tooltips with XML doc comments when hovering over a type (class), method, property, event, field

Background images can be shown in the text editor

Same image with left margin and top margin set to 75%

Export to project decompiles all selected assemblies and creates a Visual Studio solution

Command line decompiler, supports Windows, Linux, Mac

Scripting with C# REPL, control the debugger and other extensions with C#

Hex editor

Metadata editor, click on a token or press Ctrl+Shift+D

该项目的翻译相关

如果你想要帮助翻译 dnSPY 成其它语言,请点击此处

Wiki

具体命令和编译相关的内容请参考 Wiki 。

 转:https://blog.csdn.net/kongwei521/article/details/54927689

原文地址:https://www.cnblogs.com/shikyoh/p/10613486.html