So, where does it start? If we look back in the CLRHeader, we see the Metatadata field which is an RVA. Let's see if we can get some data out. From the beginning, things are not going to be easy. The iVersionString gives the length of the pVersion which means that a simple deserialize is out. I am going to create the top 'fixed' portion of the header as normal and then deal with the pVersion string separately. That means that I am going to use an intermediate structure and implement the actual GeneralMetatadataHeader as a class. Here is my implementation:
Note that the constructor for the type actually reads in the variable length string. I might go back and implement the CodeViewHeader in a similar way as this is actually cleaner than I was expecting. That is enough for tonight, I will get into the actual Metadata streams in the next post.
Keep your code clean!