Read/Get TypeRef table from assembly metadata

后端 未结 1 1528
自闭症患者
自闭症患者 2021-01-21 03:35

This is a follow-up question to THIS one:

To analyze an assembly (or the types it ueses) I would like to read the TypeRef table of such assembly.

I

1条回答
  •  天涯浪人
    2021-01-21 04:12

    Using Cecil, it's just a matter of accessing ModuleDefinition.GetTypeReferences(). For example:

    var assembly = AssemblyDefinition.ReadAssembly(assemblyPath);
    
    var typeReferences = assembly.MainModule.GetTypeReferences();
    

    0 讨论(0)
提交回复
热议问题