Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PE: read reserved DOS header fields #405

Merged
merged 1 commit into from Apr 21, 2024
Merged

PE: read reserved DOS header fields #405

merged 1 commit into from Apr 21, 2024

Conversation

kkent030315
Copy link
Contributor

This PR fixes DosHeader::parse by reading reserved and reserved2 fields from the input instead of assuming that they are always zeros (PE64/32).

In the PECOFF, the DOS header fields except e_lfanew (the pe_pointer alias in the goblin) are entiely not read by the LDR (Windows loader). So assuming that the two fields in question does not really matter.

However, these fields are sometimes (and rarely) used by the PE packers for marking/watermaking purpose. In the real world example, Riot Games uses the e_ss = 0x4952 and e_sp = 0x544F fields for MZ ... RIOT marker.

Copy link
Owner

@m4b m4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thank you!

@m4b m4b merged commit eda1be7 into m4b:master Apr 21, 2024
6 checks passed
@m4b
Copy link
Owner

m4b commented Apr 21, 2024

note: non-breaking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants