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

Fix get_memory_mapped_image copy much header data #385

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

qux-bbb
Copy link

@qux-bbb qux-bbb commented Nov 25, 2023

Before this changing, some non b"\0" data will be copied to the header.
After this changing, the header will be clear.

@erocarrera
Copy link
Owner

I want to understand better what is the reason for this change? does it mirror the behavior of the OS or is it simply to keep it "clean" of the values outside the header?
I have the recollection (but I have not verified it) that the OS does not clear the values when mapping the file into memory. pefile attempts to mirror that behavior.

@erocarrera erocarrera self-assigned this Jan 11, 2024
@qux-bbb
Copy link
Author

qux-bbb commented Jan 12, 2024

This change want to mirror the behavior of the OS.
The OS just maps PE file to memory. For mapped header, it does not contain latter data.
But before this commit, pefile will map latter data to header in memory.

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