dnSpy

.NET调试器和汇编编辑器。「.NET debugger and assembly editor」

Github stars Tracking Chart

dnSpy -- 最新版本

dnSpy 是一款调试器和 .NET 汇编编辑器。即使你没有任何源代码,你也可以用它来编辑和调试程序集。主要功能

  • 调试 .NET 和 Unity 程序集
  • 编辑 .NET 和 Unity 程序集
  • 明暗主题

更多特点请看下文。

要调试 Unity 游戏,你也需要这个 Repo:https://github.com/dnSpy/dnSpy-Unity-mono (或从 https://github.com/0xd4d/dnSpy/releases/unity 获取二进制文件)

二进制文件

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

构建

git clone --recursive https://github.com/0xd4d/dnSpy.git
cd dnSpy
# or dotnet build
./build.ps1 -NoMsbuild

调试器

  • 调试 .NET Framework、.NET Core 和 Unity 游戏程序集,无需源代码。
  • 设置断点,并进入任何组件
  • 本地人、手表、汽车窗
  • 变量窗口支持将变量保存到磁盘或在十六进制编辑器中查看(内存窗口)。
  • 对象 ID
  • 可同时对多个进程进行调试。
  • 模块负载中断
  • 跟踪点和条件断点
  • 导出/导入断点和跟踪点。
  • 调用栈、线程、模块、进程窗口
  • 抛出的例外情况下的中断(第一次机会)
  • 变量窗口支持评估 C#/Visual Basic 表达式。
  • 可以对动态模块进行调试(但由于 CLR 的限制,不能对动态方法进行调试)。
  • 输出窗口记录各种调试事件,默认显示时间戳:)
  • 在运行时自行解密的程序集可以进行调试,dnSpy 将使用内存中的镜像。你也可以强制 dnSpy 总是使用内存中的镜像而不是磁盘文件。
  • 公共 API,你可以写一个扩展或使用 C# 交互窗口来控制调试器。

汇编编辑

  • 所有元数据都可以编辑
  • 使用 IntelliSense 在 C# 或 Visual Basic 中编辑方法和类,无需源代码。
  • 在 C# 或 Visual Basic 中添加新的方法、类或成员。
  • IL 编辑器用于低级 IL 方法体编辑
  • 可以编辑低级元数据表。这在内部使用十六进制编辑器。

十六进制编辑器

  • 点击反编译代码中的一个地址,在十六进制编辑器中进入其IL代码。
  • 上面的反过来,在十六进制编辑器中的IL体中按F12键,可以进入反编译后的代码或其他高级表示的位。可以很好的发现一个补丁修改了哪条语句。
  • 重点介绍.NET元数据结构和PE结构
  • 工具提示显示有关所选.NET元数据/PE字段的更多信息。
  • 转到位置、文件、RVA
  • 转到.NET元数据令牌、方法体、#Blob/#Strings/#US堆偏移量或#GUID堆索引。
  • 遵循参考文献(Ctrl+F12)

其他

  • BAML反编译器
  • 蓝色、浅色和深色主题(以及深色高对比度主题)。
  • 书签
  • C#交互式窗口可以用来编写dnSpy脚本。
  • 搜索集合体中的类、方法、字符串等。
  • 分析类和方法的使用情况,查找调用者等。
  • 多个标签和标签组
  • 参考文献被高亮显示,使用Tab / Shift+Tab移动到下一个参考文献。
  • 转到入口点和模块初始化命令
  • 转到元数据令牌或元数据行命令
  • 代码工具提示(C#和Visual Basic)
  • 导出到项目

dnSpy 使用的其他开源库列表

  • ILSpy 反编译引擎 (C# 和 Visual Basic 反编译器)
  • Roslyn (C# 和 Visual Basic 编译器)
  • dnlib (.NET元数据读写器,也可以读取混淆的程序集)
  • VS MEF (更快的MEF等于更快的启动)
  • ClrMD (访问 CorDebug API 没有提供的低级调试信息)
  • Iced (x86/x64 反汇编程序)

翻译 dnSpy

如果您想帮助将 dnSpy 翻译成您的母语,请点击这里

Wiki

请参阅 Wiki 中的构建说明和其他文档。

许可证

dnSpy 是根据 GPLv3 授权的。


(The first version translated by vz on 2020.10.10)

Overview

Name With OwnerdnSpy/dnSpy
Primary LanguageC#
Program languageC# (Language Count: 4)
PlatformWindows
License:
Release Count1
Last Release Namev6.1.8 (Posted on )
First Release Namev6.1.8 (Posted on )
Created At2015-07-01 16:05:10
Pushed At2020-12-20 23:55:15
Last Commit At2020-12-07 22:07:17
Stargazers Count25.5k
Watchers Count1k
Fork Count4.9k
Commits Count3.9k
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count53
Pull Requests Open Count0
Pull Requests Close Count30
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

dnSpy

dnSpy is a debugger and .NET assembly editor. You can use it to edit and debug assemblies even if you don't have any source code available.

Want to say thanks? Click the star at the top of the page. Or fork dnSpy and send a PR!

The following pictures show dnSpy in action. It shows dnSpy editing and debugging a .NET EXE file, not source code.

debug-animated

edit-code-animated

Features (see below for more detail)

  • Debug .NET Framework, .NET Core and Unity game assemblies, no source code required
  • Edit assemblies in C# or Visual Basic or IL, and edit all metadata
  • Light and dark themes
  • Extensible, write your own extension
  • High DPI support (per-monitor DPI aware)
  • And much more, see below

dnSpy uses the ILSpy decompiler engine and the Roslyn (C# / Visual Basic) compiler and many other open source libraries, see below for more info.

Binaries

Latest release

Latest build: Build status

Or build it from source, see the Wiki.

Debugger

  • Debug .NET Framework, .NET Core and Unity game assemblies, no source code required
  • Set breakpoints and step into any assembly
  • Locals, watch, autos windows
  • Variables windows supports saving variables (eg. decrypted byte arrays) to disk or view them in the hex editor (memory window)
  • Object IDs
  • Multiple processes can be debugged at the same time
  • Break on module load
  • Tracepoints and conditional breakpoints
  • Export/import breakpoints and tracepoints
  • Call stack, threads, modules, processes windows
  • Break on thrown exceptions (1st chance)
  • Variables windows support evaluating C# / Visual Basic expressions
  • Dynamic modules can be debugged (but not dynamic methods due to CLR limitations)
  • Output window logs various debugging events, and it shows timestamps by default :)
  • Assemblies that decrypt themselves at runtime can be debugged, dnSpy will use the in-memory image. You can also force dnSpy to always use in-memory images instead of disk files.
  • Public API, you can write an extension or use the C# Interactive window to control the debugger

Assembly Editor

  • All metadata can be edited
  • Edit methods and classes in C# or Visual Basic with IntelliSense, no source code required
  • Add new methods, classes or members in C# or Visual Basic
  • IL editor for low level IL method body editing
  • Low level metadata tables can be edited. This uses the hex editor internally.

Hex Editor

  • Click on an address in the decompiled code to go to its IL code in the hex editor
  • Reverse of above, press F12 in an IL body in the hex editor to go to the decompiled code or other high level representation of the bits. It's great to find out which statement a patch modified.
  • Highlights .NET metadata structures and PE structures
  • Tooltips shows more info about the selected .NET metadata / PE field
  • Go to position, file, RVA
  • Go to .NET metadata token, method body, #Blob / #Strings / #US heap offset or #GUID heap index
  • Follow references (Ctrl+F12)

Other

  • BAML decompiler
  • Blue, light and dark themes (and a dark high contrast theme)
  • Bookmarks
  • C# Interactive window can be used to script dnSpy
  • Search assemblies for classes, methods, strings etc
  • Analyze class and method usage, find callers etc
  • Multiple tabs and tab groups
  • References are highlighted, use Tab / Shift+Tab to move to next reference
  • Go to entry point and module initializer commands
  • Go to metadata token or metadata row commands
  • Code tooltips (C# and Visual Basic)
  • Export to project

List of other open source libraries used by dnSpy

  • ILSpy decompiler engine (C# and Visual Basic decompilers)
  • Roslyn (C# and Visual Basic compilers)
  • dnlib (.NET metadata reader/writer which can also read obfuscated assemblies)
  • VS MEF (Faster MEF equals faster startup)
  • ClrMD (Access to lower level debugging info not provided by the CorDebug API)

Translating dnSpy

Click here if you want to help with translating dnSpy to your native language.

Wiki

See the Wiki for build instructions and other documentation.

License

dnSpy is licensed under GPLv3.

Credits

To the top