ilspy-decompile
- 作者仓库星标 0
- 作者更新于 2026年8月8日 02:11
- 作者仓库 dotnet-skills
.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:
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 withilspycmd -h.
Quick start
# Decompile an assembly to stdout
ilspycmd MyLibrary.dll
# or
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
- Decompile the target
Commands
Basic decompilation
ilspycmd MyLibrary.dll
ilspycmd -o ./decompiled MyLibrary.dll
ilspycmd -p -o ./project MyLibrary.dll
Targeted decompilation
ilspycmd -t Namespace.ClassName MyLibrary.dll
ilspycmd -lv CSharp12_0 MyLibrary.dll
View IL code
ilspycmd -il MyLibrary.dll
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.
- 流狐分类
- 通用
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @Aaronontheweb · 未声明 license
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 即装即用
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- 未声明
- 底层运行要求
- 未声明
- 检测到的文件与系统行为
-
- 只读
- 检测到的网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
# Project build output
./bin/Debug/net8.0/<AssemblyName>.dll
./bin/Release/net8.0/publish/<AssemblyName>.dll Quick start
Quick start
Core workflow
Identify what you want to understand Locate the assembly List types
# .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:
- `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
```bash
# Decompile an assembly to stdout
ilspycmd MyLibrary.dll
# or
dnx ilspycmd MyLibrary.dll
# Decompile to an output folder
ilspycmd -o output-folder MyLibrary.dll
```
## Common .NET Assembly Locations
### NuGet packages
```bash
~/.nuget/packages/<package-name>/<version>/lib/<tfm>/
```
### .NET runtime libraries
```bash
dotnet --list-runtimes
```
### .NET SDK reference assemblies
```bash
dotnet --list-sdks
```
> Reference assemblies do not contain implementations.
### Project build output
```bash
./bin/Debug/net8.0/<AssemblyName>.dll
./bin/Release/net8.0/publish/<AssemblyName>.dll
```
## Core workflow
1. Identify what you want to understand
2. Locate the assembly
3. List types
4. Decompile the target
## Commands
### Basic decompilation
```bash
ilspycmd MyLibrary.dll
ilspycmd -o ./decompiled MyLibrary.dll
ilspycmd -p -o ./project MyLibrary.dll
```
### Targeted decompilation
```bash
ilspycmd -t Namespace.ClassName MyLibrary.dll
ilspycmd -lv CSharp12_0 MyLibrary.dll
```
### View IL code
```bash
ilspycmd -il MyLibrary.dll
```
## Notes on modern .NET builds
- ReadyToRun images may reduce readability
- Trimmed or AOT builds may omit code
- Prefer non-trimmed builds
## Legal note
… 证据边界与执行链路
作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Prerequisites → Quick start → Common .NET Assembly Locations → NuGet packages → .NET runtime libraries → .NET SDK reference assemblies
要点 -> Use this skill to understand how .NET code works internally by decompiling compiled assemblies. · Both forms are shown below. · > Note: ILSpyCmd options may vary slightly by version. · > Reference assemblies do not contain implementations. · 1. Identify what you want to understand 2. · Decompiling assemblies may be subject to license restrictions.
文件/命令 -> dnx ilspycmd · dotnet tool install --global ilspycmd · ilspycmd -h · .nuget/packages · ./bin/Debug/net8.0 · ./bin/Release/net8.0/publish · ./decompiled · ./project
内容 SHA-256 -> 4bc1d39fb442
方法与流程
适用与边界
原文中的明确线索
dnx ilspycmd、dotnet tool install --global ilspycmd、ilspycmd -h、.nuget/packages、./bin/Debug/net8.0、./bin/Release/net8.0/publish、./decompiled、./project