Decompilation - dll spy toolset

Did you ever needed to check what is inside some DLL or EXE file?
In the dark ages that was popular way to gain certain knowledge, sometimes not so legal, but it was time that there was no open source. I know, not good enough excuse. Let's leave it alone in past.

Still, curiosity of decompiling is a good thing. In dark ages there was a .Net Reflector but one day it became a Pro version (paid version). fortunately where is a need there is a product, even two, maybe more but those two i know best dotPeek from Jet Brains and Just Decompile from Telerik. Using them is very easy, just drop file and it will be decompiled. Both applications are pretty efficient and generates almost ideally projected original code.

Dot peek even recreates comments!
Why this is alarming? Comments doesn't supposedly end up in released application.

Decompiling you own code to exactly the same code is not very useful. 

There is one more tool that is much more interesting. ILSpy. Dissipate the name it's not only generating IL, it can also generated C# code, and this is not the same code that we are writing, it's the compiler generated code decompiled.
This make sense if you remember that compiler is not just a figure of speech it really do its work creating intermediate language. So it sometimes generates additional .. well all he needs: code, classes, and other stuff. We can understand what is happening with code and how things work. We can see the results not only read documentation or believe. 

But this is only about tools.
ILSpy is great. But it's white. You can get the same functionality from dotPeek by selecting "Show compiler-generated code"

Now we can see grayed out code. To see the content right click is needed to summon menu.

DotPeek has one more sweet functionality. When from code window we will open IL code both windows will collaborate and select IL code when C# code is selected and vice versa.


Popularne posty