4

I need a .NET assembly viewer which can show low-level details such as metadata tables content, etc.

user536232
  • 645
  • 5
  • 18

6 Answers6

7

ildasm, the IL disassembler, has low-level managed metadata token information. It gets installed as part of the Windows SDK when you install Visual Studio. It should be accessible from a VS command prompt.

When you open a managed assembly, hit Ctrl+M or do View » MetaInfo » Show! to see the metadata tokens, e.g.:

TypeDef #1 (02000002)
-------------------------------------------------------
    TypDefName: ConsoleApplication1.Program  (02000002)
    Flags     : [NotPublic] [AutoLayout] [Class] [AnsiClass] [BeforeFieldInit]  (00100000)
    Extends   : 01000001 [TypeRef] System.Object
    Method #1 (06000001) [ENTRYPOINT]
    -------------------------------------------------------
        MethodName: Main (06000001)
        ...

There are also options to view the raw metadata tables via ildasm /text /metadata=raw foo.dll:

// =================================================
// 25(0x19): MethodImpl           cRecs:    0(0), cbRec:  6(0x6), cbTable:     0(0)
//   col  0:* Class        oCol: 0, cbCol:2, TypeDef
//   col  1:  MethodBody   oCol: 2, cbCol:2, MethodDefOrRef
//   col  2:  MethodDeclaration oCol: 4, cbCol:2, MethodDefOrRef
// =================================================
// 26(0x1a): ModuleRef            cRecs:    0(0), cbRec:  2(0x2), cbTable:     0(0)
//   col  0:  Name         oCol: 0, cbCol:2, string 
// =================================================
// 27(0x1b): TypeSpec             cRecs:    0(0), cbRec:  2(0x2), cbTable:     0(0)
//   col  0:  Signature    oCol: 0, cbCol:2, blob  
// ...
Chris Schmich
  • 29,128
  • 5
  • 77
  • 94
  • @user536232: see my updated answer. It looks like ildasm can dump the raw metadata tables in text format. I don't know how intelligible this is, but I know ildasm is kept up-to-date with the shipping compilers. – Chris Schmich Feb 11 '11 at 08:48
2

Did you try RedGate's reflector? http://www.red-gate.com/products/dotnet-development/reflector/

vamyip
  • 1,161
  • 1
  • 10
  • 35
2

Check out

http://www.codeproject.com/KB/dotnet/asmex.aspx

Madhur Ahuja
  • 22,211
  • 14
  • 71
  • 124
  • Nice tool, does what I need. Bit it's very old, doesn't support many new features. Is there any new version? – user536232 Feb 11 '11 at 08:35
1

Reflector will do that. It will show resources as well as metadata information on methods, etc.

Tedd Hansen
  • 12,074
  • 14
  • 61
  • 97
1

There is an application CFF Explorer which will show you the metadata directories, PE header and all that other good stuff.

Available from: http://www.ntcore.com/exsuite.php

Barry Jones
  • 587
  • 5
  • 14
-1

I think its already build-in in Visual Studio 2008 or use

NDepend

NDepend is a Visual Studio tool to manage complex .NET code and achieve high Code Quality. With NDepend, software quality can be measured using Code Metrics.

NDepend

Sudantha
  • 15,684
  • 43
  • 105
  • 161