Skip to content

IlDisassembler

Namespace: Dotsider.Core.Analysis

Assembly: Dotsider.Core.dll

Decodes IL (Intermediate Language) method bodies into human-readable instruction sequences.

public sealed class IlDisassembler

ObjectIlDisassembler

Decodes IL (Intermediate Language) method bodies into human-readable instruction sequences.

Parameters:

  • analyzer (AssemblyAnalyzer): Provides the assembly metadata and method bodies to disassemble.
public IlDisassembler(AssemblyAnalyzer analyzer)

Disassembles a method’s IL body into a sequence of instructions. Returns an empty list if the method has no IL body. A body ending inside an opcode or operand returns its valid prefix followed by one IsMalformed marker.

Parameters:

Returns: IReadOnlyList<IlInstruction>

The list of decoded IL instructions.

public IReadOnlyList<IlInstruction> Disassemble(MethodDefInfo method)

Disassembles a method and returns the text, instruction list, and header line count. A malformed terminal opcode or operand is represented by one IsMalformed marker.

Parameters:

Returns: Nullable<String, IlInstruction>, Int32>>

Tuple of (text, instructions, headerLineCount), or null if no IL body.

public (string Text, IReadOnlyList<IlInstruction> Instructions, int HeaderLineCount)? DisassembleWithText(MethodDefInfo method)

Formats a complete disassembly listing for a method, including header information and any terminal malformed-IL marker.

Parameters:

Returns: String

A multi-line string with the full disassembly listing.

public string FormatDisassembly(MethodDefInfo method)

Returns the number of header lines for a method’s disassembly listing.

Parameters:

  • method (MethodDefInfo): The method to compute header lines for.

Returns: Int32

The number of header lines, or 0 if no IL body.

public int GetHeaderLineCount(MethodDefInfo method)