pe: Implement parsing of file headers and optional headers.