DotNET Decompiler

DotNET Decompiler

Decompiler for .NET assemblies.

Once you have installed the package, you can access the decompiler from the bytecode view.

The interface provides a quick filter to show only matching namespaces, classes, and methods.

To switch between the bytecode and the decompiler, you can use the combo box at the top.

Alternatively, and even more conveniently, you can use the ‘Tab’ key to toggle between the bytecode and the decompiler, which will bring you directly from the C# code to the corresponding bytecode and vice versa.

You can navigate the code both when viewing the bytecode and the decompiled output. The ‘Esc’ key will bring you back to the previous position, just like in the Carbon disassembly view.

The ‘Strings’ button displays all referenced strings in the code, showing which class and method reference them. It also allows you to jump to the location where they are referenced, both in the bytecode and in the decompiled output.

Additionally, the strings view features a filter to quickly find strings of interest.

The package is exposed to the SDK. The following code snippet demonstrates how to decompile a class in a .NET assembly:

from Pkg.DotNETDecompiler import *

def main():
    dec = DotNETDecompiler()
    dec.init("path/to/assembly")
    # we specify the name of the class to decompile or alternatively we could specify a class or method token
    text, _ = dec.decompile("WindowsFormsApplication1.Form1")
    if text != None:
        print(text)