dotnet-decompilelisted
Install: claude install-skill eduardoghi/reverse-engineering-skills
# .NET decompilation
A .NET assembly keeps its code as IL with full metadata, so ILSpy recovers C# close to the original,
with type and member names, string literals and, for WPF, the XAML of every window from its compiled
BAML. It is still a reconstruction. Local names, loop shapes and compiler-generated classes differ
from the source, so confirm in the IL anything a conclusion depends on.
Native code is out of its reach. A program can ship native DLLs next to its assemblies and call them
through P/Invoke, and only the declarations of those calls are in the metadata. The native side needs
Ghidra or rizin, as in the `delphi-bpl` and `binary-diff` skills.
## Setup
`ilspycmd` is a .NET tool. Version 11.1 runs on the .NET 10 SDK.
```sh
dotnet tool install -g ilspycmd # into ~/.dotnet/tools, which has to be on PATH
mkdir -p ~/.cache/netfx-ref && cd ~/.cache/netfx-ref
curl -sSLo net48.nupkg https://www.nuget.org/api/v2/package/Microsoft.NETFramework.ReferenceAssemblies.net48/1.0.3
unzip -q net48.nupkg
REF=~/.cache/netfx-ref/build/.NETFramework/v4.8
```
On Linux nothing provides the .NET Framework assemblies (`mscorlib`, `System.Windows.Forms`,
`PresentationFramework`), so pass the reference assemblies from that NuGet package with `-r` when the
target is .NET Framework. Without them ilspycmd still exits with 0 and prints nothing on stderr, but
the output degrades. On one WPF executable it left 2,808 `missing references` comments in the C#,
enum values as casts (`(Messa