ilspy-decompile

Entenda detalhes de implementação de código .NET descompilando assemblies. Use quando quiser ver como uma API .NET funciona internamente, inspecionar código-fonte de pacotes NuGet, visualizar implementações de framework ou entender binários .NET compilados.

O que é ilspy-decompile?

Esta skill permite que agentes de IA descompilem assemblies .NET usando o ILSpy, fornecendo acesso ao código-fonte subjacente de bibliotecas, pacotes NuGet e componentes do runtime .NET. Ela é útil para depuração, análise de compatibilidade, aprendizado ou verificação de implementações quando o código-fonte não está disponível. A skill é compatível com ferramentas de linha de comando como Claude Code, Cursor, Codex e outras plataformas de agentes de IA. O fluxo de trabalho principal envolve localizar o assembly desejado, listar seus tipos e então descompilar seletivamente classes ou métodos específicos usando os comandos `ilspycmd` com flags como `-t`, `-o` e `-il`. A skill também fornece instruções sobre como encontrar assemblies comuns, como os de pacotes NuGet, diretórios de runtime e saídas de build de projeto, além de recomendações sobre builds modernos (ReadyToRun, AOT) e considerações legais sobre licenciamento.

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/ilspy-decompile

Installed? Explore more Programação e Desenvolvimento skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Descompilação de Assemblies .NET com ILSpy

Use esta skill para entender como o código .NET funciona internamente, descompilando assemblies compilados.

Pré-requisitos

  • SDK .NET instalado
  • Ferramenta de linha de comando ILSpy disponível via uma das seguintes formas:
    • dnx ilspycmd (se disponível no seu SDK ou runtime)
    • dotnet tool install --global ilspycmd

Ambas as formas são mostradas abaixo. Use a que funcionar no seu ambiente.

Nota: As opções do ILSpyCmd podem variar ligeiramente conforme a versão.
Sempre verifique as flags suportadas com ilspycmd -h.

Início rápido

# Descompilar um assembly para a saída padrão
ilspycmd MyLibrary.dll
# ou
dnx ilspycmd MyLibrary.dll

# Descompilar para uma pasta de saída
ilspycmd -o pasta-saida MyLibrary.dll

Locais Comuns de Assemblies .NET

Pacotes NuGet

~/.nuget/packages/<nome-do-pacote>/<versao>/lib/<tfm>/

Bibliotecas do runtime .NET

dotnet --list-runtimes

Assemblies de referência do SDK .NET

dotnet --list-sdks

Assemblies de referência não contêm implementações.

Saída de build do projeto

./bin/Debug/net8.0/<NomeDoAssembly>.dll
./bin/Release/net8.0/publish/<NomeDoAssembly>.dll

Fluxo de trabalho principal

  1. Identifique o que deseja entender
  2. Localize o assembly
  3. Liste os tipos
  4. Descompile o alvo

Comandos

Descompilação básica

ilspycmd MyLibrary.dll
ilspycmd -o ./descompilado MyLibrary.dll
ilspycmd -p -o ./projeto MyLibrary.dll

Descompilação direcionada

ilspycmd -t Namespace.ClassName MyLibrary.dll
ilspycmd -lv CSharp12_0 MyLibrary.dll

Visualizar código IL

ilspycmd -il MyLibrary.dll

Observações sobre builds modernos do .NET

  • Imagens ReadyToRun podem reduzir a legibilidade
  • Builds trimmed ou AOT podem omitir código
  • Prefira builds não trimmed

Nota legal

A descompilação de assemblies pode estar sujeita a restrições de licenciamento.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

akka-hosting-actor-patterns

Patterns for building entity actors with Akka.Hosting - GenericChildPerEntityParent, message extractors, cluster sharding abstraction, akka-reminders, and ITimeProvider. Supports both local testing and clustered production modes.

akka-net-aspire-configuration

Configure Akka.NET with .NET Aspire for local development and production deployments. Covers actor system setup, clustering, persistence, Akka.Management integration, and Aspire orchestration patterns.

akka-net-best-practices

Critical Akka.NET best practices including EventStream vs DistributedPubSub, supervision strategies, error handling, Props vs DependencyResolver, work distribution patterns, and cluster/local mode abstractions for testability.

akka-net-management

Akka.Management for cluster bootstrapping, service discovery (Kubernetes, Azure, Config), health checks, and dynamic cluster formation without static seed nodes.

akka-net-testing-patterns

Write unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, and actor interaction verification. Includes guidance on when to use traditional TestKit.

api-design

Design stable, compatible public APIs using extend-only design principles. Manage API compatibility, wire compatibility, and versioning for NuGet packages and distributed systems.

aspire-configuration

Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.

aspire-integration-testing

Write integration tests using .NET Aspire

aspire-service-defaults

Create a shared ServiceDefaults project for Aspire applications. Centralizes OpenTelemetry, health checks, resilience, and service discovery configuration across all services.

crap-analysis

Analyze code coverage and CRAP (Change Risk Anti-Patterns) scores to identify high-risk code. Use OpenCover format with ReportGenerator for Risk Hotspots showing cyclomatic complexity and untested code paths.

csharp-concurrency-patterns

Choosing the right concurrency abstraction in .NET - from async/await for I/O to Channels for producer/consumer to Akka.NET for stateful entity management. Avoid locks and manual synchronization unless absolutely necessary.

database-performance

Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.

dependency-injection-patterns

Organize DI registrations using IServiceCollection extension methods. Group related services into composable Add* methods for clean Program.cs and reusable configuration in tests.

dotnet-devcert-trust

Diagnose and fix .NET HTTPS dev certificate trust issues on Linux. Covers the full certificate lifecycle from generation to system CA bundle inclusion, with distro-specific guidance for Ubuntu, Fedora, Arch, and WSL2.

dotnet-local-tools

Managing local .NET tools with dotnet-tools.json for consistent tooling across development environments and CI/CD pipelines.

dotnet-project-structure

Modern .NET project structure including .slnx solution format, Directory.Build.props, central package management, SourceLink, version management with RELEASE_NOTES.md, and SDK pinning with global.json.

dotnet-slopwatch

Use Slopwatch to detect LLM reward hacking in .NET code changes. Run after every code modification to catch disabled tests, suppressed warnings, empty catch blocks, and other shortcuts that mask real problems.

efcore-patterns

Entity Framework Core best practices including NoTracking by default, query splitting for navigation collections, migration management, dedicated migration services, and common pitfalls to avoid.

mailpit-integration

Test email sending locally using Mailpit with .NET Aspire. Captures all outgoing emails without sending them. View rendered HTML, inspect headers, and verify delivery in integration tests.

marketplace-publishing

Workflow for publishing skills and agents to the dotnet-skills Claude Code marketplace. Covers adding new content, updating plugin.json, validation, and release tagging.

Habilidades Relacionadas