ilspy-decompile
Understand implementation details of .NET code by decompiling assemblies. Use when you want to see how a .NET API works internally, inspect NuGet package source, view framework implementation, or understand compiled .NET binaries.
适合你,如果想查看 .NET 库或 NuGet 包的源代码
/ 通过 npx 安装 校验哈希
npx oh-my-skill add nikiforovall/claude-code-rules/ilspy-decompile/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- nikiforovall/claude-code-rules/ilspy-decompile/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify nikiforovall/claude-code-rules/ilspy-decompile安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
133GitHub stars
~635最小装载
~1K含声明引用
~1K文本包总量
索引托管
怎么用
商店整理自技能原文 · 版本 642e21e · 表述以原文为准它做什么
装上后,Claude可以反编译.NET程序集(.dll文件),并把编译后的二进制代码还原成可读的C#源码,让你看到类、方法等内部实现。
什么时候触发
当你询问某个.NET API的内部工作原理、想查看NuGet包源码、框架实现或理解编译后的二进制代码时触发。
装好后可以这样说
Claude会使用 -l c 参数列出类名。
技能原文 SKILL.md
.NET Assembly Decompilation with ILSpy
Use this skill to understand how .NET code works internally by decompiling compiled assemblies.
Prerequisites
- .NET SDK installed
- ILSpy command-line tool available via one of the following:
dotnet dnx ilspycmd(if available in your SDK or runtime)dotnet tool install --global ilspycmd
Both forms are shown below. Use the one that works in your environment.
Note: ILSpyCmd options may vary slightly by version. Always verify supported flags with ilspycmd -h.
Quick start
# Decompile an assembly to stdout ilspycmd MyLibrary.dll # or dotnet dnx ilspycmd MyLibrary.dll # Decompile to an output folder ilspycmd -o output-folder MyLibrary.dll
Common .NET Assembly Locations
NuGet packages
~/.nuget/packages/<package-name>/<version>/lib/<tfm>/
.NET runtime libraries
dotnet --list-runtimes
.NET SDK reference assemblies
dotnet --list-sdks
Reference assemblies do not contain implementations.
Project build output
./bin/Debug/net8.0/<AssemblyName>.dll ./bin/Release/net8.0/publish/<AssemblyName>.dll
Core workflow
- Identify what you want to understand
- Locate the assembly
- List types to find the target
- Decompile the target
Commands
List types in an assembly
Use -l with an entity type to discover what's inside:
# List classes ilspycmd -l c MyLibrary.dll # List interfaces ilspycmd -l i MyLibrary.dll # List structs, delegates, enums ilspycmd -l s MyLibrary.dll ilspycmd -l d MyLibrary.dll ilspycmd -l e MyLibrary.dll
Basic decompilation
ilspycmd MyLibrary.dll ilspycmd -o ./decompiled MyLibrary.dll ilspycmd -p -o ./project MyLibrary.dll
Targeted decompilation
# Decompile specific type ilspycmd -t Namespace.ClassName MyLibrary.dll # Specify C# language version (default: Latest) ilspycmd -lv CSharp12_0 MyLibrary.dll
View IL code
ilspycmd -il MyLibrary.dll
Clean output
# Remove dead code and dead stores for cleaner results ilspycmd --no-dead-code --no-dead-stores MyLibrary.dll
Organized project output
# Decompile with nested directories matching namespaces ilspycmd --nested-directories -p -o ./decompiled MyLibrary.dll
References
- references/diagrammer.md — Generate interactive HTML diagrams from assemblies. Load when the user asks to visualize or explore type relationships.
Notes on modern .NET builds
- ReadyToRun images may reduce readability
- Trimmed or AOT builds may omit code
- Prefer non-trimmed builds
Legal note
Decompiling assemblies may be subject to license restrictions.
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…