Created
March 21, 2018 15:49
-
-
Save nguerrera/c672cb728a96a24837408b5d1c6ca7e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection.Metadata; | |
using System.Reflection.Metadata.Ecma335; | |
using System.Reflection.PortableExecutable; | |
class Program | |
{ | |
static void Main() | |
{ | |
using (var pe = new PEReader(...)) | |
{ | |
MetadataReader md = pe.GetMetadataReader(); | |
for (int row = 1, count = md.GetTableRowCount(TableIndex.TypeSpec); row <= count; row++) | |
{ | |
TypeSpecificationHandle handle = MetadataTokens.TypeSpecificationHandle(row); | |
TypeSpecification specification = md.GetTypeSpecification(handle); | |
... | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment