Decompile .NET assemblies to C# or IL
dotPeek can decompile any .NET assemblies into equivalent C# code and optionally show the underlying IL code.
Libraries, executables and more
dotPeek can work with a variety of formats, such as libraries (.dll), executables (.exe), and metadata files (.winmd).
dotPeek can also decompile .baml files, enabling you to reconstruct XAML UI definitions.
In addition to traditional assemblies and executables, you can have dotPeek open archives (including .zip, .vsix, and
.nupkg formats) and folders. For example, when you point dotPeek at a folder, it processes all its subfolders in hunt
for files that it can decompile.
View source code if available
Decompiled code is better than nothing but sometimes you can match an assembly to its source code, so why not take
advantage of this? dotPeek can identify local source code based on PDB files, or fetch source code from source servers
such as Microsoft Reference Source Center or SymbolSource.org. Moreover, dotPeek can generate PDB files.
Use the navigation mode drop-down in the menu bar to choose whether you only want dotPeek to decompile assemblies,
or try find source code if possible.
Show or hide compiler-generated code
You can choose to turn off certain compiler transformations, thus making code structure that dotPeek displays very similar
to what the compiler turns it to. This helps see how compiler deals with lambdas, closures, and auto-properties, among
Explore running processes
The Process Explorer window shows the list of all currently running processes and allows exploring their modules and
decompiling those of them that are .NET assemblies. Once you locate a process to decompile, you can add it to Assembly
Explorer for further investigation.
View IL code whenever necessary
Whenever you want to dive deeper than source code, you can navigate to IL code from any point in decompiled C#.
IL code can be shown in a separate tool window that is synchronized with the main code viewer:
Also, you can opt to show IL code as comments to decompiled C# code, which effectively merges its default text viewer
and the normally separate IL Viewer window, all in one view.
dotPeek can display IL code both for decompiled code and for source code reproduced from symbol files.
Navigate decompiled code in different ways
As dotPeek is based on ReSharper's powerful code insight architecture, it lets you navigate decompiled assemblies in a
contextual or context-insensitive ways, get a quick summary what's inside each decompiled file, set bookmarks and
explore inheritance chains.
Find usages of any symbol
With dotPeek, you have several options to search where code symbols are referenced.
Specifically, Find Usages displays all usages of a symbol (method, property, local variable etc.) in the Find Results tool
window where you can group them, navigate between them, and open in the code view area.
There's also Find Usages Advanced, which is a more detailed version of Find Usages that helps you fine-tune search
criteria by limiting the scope of search and other characteristics.
Finally, Highlight Usages in File puts highlighting on usages of a symbol in the current file, depending on whether
it's a write or read usage:
Explore current class
Use Go to File Member for a quick overview of and navigation to members of a file representing a decompiled type.
Enter parts of member names, and navigate directly to them:
Alternatively, if you'd like a static display of members in the current file, open and dock the File Structure tool window:
Jump to any code
By indexing all assemblies in your assembly list, as well as all their references, dotPeek provides two features to quickly
jump to specific code:
- Go to Symbol helps navigate to a specific symbol declaration, which could be a type, method, field, or property. Use
lowerCamelHumps syntax to locate types — for example, enter xmard to locate and open XamlMarkupDeclaredElement.
- Go to Everything allows searching for an assembly, namespace, type, member, or a recently opened file.
If there are lines of decompiled code that you feel are important and you want to go back to them later, feel free to set
Navigate class hierarchies
If you're interested to navigate up and down an inheritance hierarchy from a specific type or type member,
consider using Go to Base Symbols and Go to Derived Symbols.
These are extremely useful when you want to go to an inheritor or a base symbol right away.
Whenever you put a caret on a symbol in the code view area, dotPeek offers a plethora of contextual navigation
options that are all available via Navigate To drop-down menu:
For example, Go to Declaration takes you from a usage of any symbol to its declaration. If the symbol is declared on
another assembly, the assembly is loaded automatically.
Go to Implementation helps navigate to end implementations of types and type members, bypassing intermediate
inheritance steps in the inheritance chain, such as abstract classes.
Other useful contextual navigation options include Go to Base Symbols and Go to Extension Methods.
Explore inheritance chains
If you're looking to get a visual summary of a certain inheritance chain, use Type Hierarchy.
dotPeek will show you all types that are inherited from the selected type, as well as types that it inherits itself —
as a tree view, in a separate tool window:
Make sense of assemblies
dotPeek provides a way to quickly grasp the structure of any given assembly, as well as ways to organize assemblies
into discrete lists, which helps only focus on assemblies that you're interested for your current assignment.
Manage assembly lists
You can work with different assembly lists depending on your context. You can save and reopen assembly lists, and
clear the current list if you no longer need it. Assembly lists are not limited to .dll and .exe files: they can also contain
archives and folders.