This PR adds parsing of Rich headers, as someone opened issue #400.
Added rich header goblin::pe::header::RichHeadergoblin::pe::header::RichMetadata parsing if present, with success/fail/corrupted tests.
DOS stub is now non-fixed size of slice reference, and explicitly isolated from the DOS header.
The DOS stub is not always guaranteed to be 64-bytes long; there are some linkers (Borland C++) and PE packers generate application-specific DOS stub; and
The DOS stub includes the DOS header in definition. The DOS header and DOS stub are sometimes known to be separate, but also sometimes together. This is confusing stuff, and there are no official statement. By design, separating the header and the stub would be preferred. Concating them in the higher implementations (on the user side) are pretty easiest than making it together (otherwise user needs to mess with the raw buffer in the higher implementations.. bad).
I took the constant bytes in the test code from mthiesen/link-patcher (MIT). If this can potentially be license incompliance, I am happy to make own specimens for testing.
This PR adds parsing of Rich headers, as someone opened issue #400.
goblin::pe::header::RichHeader
goblin::pe::header::RichMetadata
parsing if present, with success/fail/corrupted tests.I took the constant bytes in the test code from mthiesen/link-patcher (MIT). If this can potentially be license incompliance, I am happy to make own specimens for testing.