LinuxCommandLibrary

monodis

Disassemble .NET bytecode

TLDR

Disassemble an assembly to textual CIL

$ monodis [path/to/assembly.exe]
copy

Save the output to a file
$ monodis --output=[path/to/output.il] [path/to/assembly.exe]
copy

Show information about an assembly
$ monodis --assembly [path/to/assembly.dll]
copy

List the references of an assembly
$ monodis --assemblyref [path/to/assembly.exe]
copy

List all the methods in an assembly
$ monodis --method [path/to/assembly.exe]
copy

List resources embedded within an assembly
$ monodis --manifest [path/to/assembly.dll]
copy

Extract all the embedded resources to the current directory
$ monodis --mresources [path/to/assembly.dll]
copy

SYNOPSIS

monodis [options] assembly_file

PARAMETERS

-output=filename
    Specifies the output file for the disassembled code. If not specified, the output is written to standard output.

-il
    Displays only the IL code. Omits the metadata and other information.

-metadata
    Displays only the metadata.

-tokens
    Shows all metadata tokens.

-hex
    Output the data in hexadecimal

-ignore
    Do not resolve method names

DESCRIPTION

The monodis command is a disassembler for .NET assemblies, providing a human-readable representation of the Intermediate Language (IL) code and metadata contained within a .dll or .exe file.
It allows developers to inspect the structure and logic of compiled .NET code, aiding in debugging, reverse engineering, and understanding how .NET applications function.
monodis can display the IL code, class definitions, method signatures, metadata tables (assembly manifest, type definitions, method definitions, etc), resources and other information.
The output format can vary depending on the options used, but generally aims to present the code in a way that resembles assembly language but operates at a higher level of abstraction.

CAVEATS

The output of monodis can be verbose and complex, requiring a good understanding of .NET IL and metadata structures to interpret effectively.

USE CASES

Some common use cases include investigating the implementation details of a third-party library, verifying the correctness of compiled code, and reverse engineering applications to understand their functionality. It is helpful when source code is unavailable.

SEE ALSO

ildasm(1), mono(1)

Copied to clipboard