I think I’ve been living under a rock as I’ve only just come across dnSpy, a decompiler for .net!
I’ve been building apps and services with .NET for a long time, so a Twitter thread talking about decompilers amused me. David Kean’s comment pretty accurately reflects my sentiment regarding Reflector.
You can pry ildasm from my cold dead hands Jared Parsons. Still have nightmares over what Red Gate did to Reflector, and can’t bear to pick up another C# decompiler. https://t.co/HVz2iuGzn4
— David Kean (@davkean) June 1, 2019
Reflector was such a simple tool and it just worked. That was until Red Gate took over and I can’t even remember what happened to it. Does it still exist?
The thread started with Jared commenting that developers should be using ilSpy instead of hacking with ildasm. I’ve rocked ilSpy in my toolkit for a while now and it’s always served me well. In fact I go so far as to set it as the default file handler for .dll files. After all, what other program are you going to want to launch when you double-click on a .dll file.
dnSpy: A Decompiler for .NET
What really knocked my socks off was that someone mentioned dnSpy which I’d never heard of. Thinking it was something similar to ilspy I didn’t think much of it but figured I would download it and take a look.
Next thing I knew it was like I had opened an entire development environment. The layout was familiar, all the way down to the Debug menu that allows me to attach to process.
What? come again? Attach to Process? Yes, that’s right you can attach to a running process, set breakpoints and intercept exceptions (and I’m sure a whole bunch more things. Ironically whilst I was attempting to modify an image of dnspy running, Paint.NET crashed on me. Whilst Paint.NET was hung, I was able to attach to the process using dnspy and see that it was stuck waiting for a print dialog to return.
If you’re using ilspy, you should check out dnspy
For anyone still using ildasm, you should check out ilspy and dnspy
Developers not using a decompiler, what have you been doing? Get yourself a decompiler for .NET, and use either ilspy or dnspy.
Nick Randolph @thenickrandolph
If you need help debugging your application, contact Built to Roam
1 thought on “Decompilers for .NET and Windows (UWP) Apps”
Well it looks like I’m not the only one that felt the need to blog about these tools. Check out Scott Hanselman’s summary of the tools: https://www.hanselman.com/blog/WhatsBetterThanILDasmILSpyAndDnSpyAreToolsToDecompileNETCode.aspx