This[
^] is a pretty good introduction to the Windows Portable Executable file header.
This[
^] one gives more information as it relates to the .NET Framework.
An internet search on
pe header structure .net will get you lots of hits. You might even find some example code you can utilize.
A similar search but replacing
pe header with
msi will get you just as much help.
Be warned though, neither of these tasks is easy. :)