Skip to content

Commit

Permalink
Fix get_memory_mapped_image copy much header data
Browse files Browse the repository at this point in the history
  • Loading branch information
qux-bbb committed Nov 25, 2023
1 parent dcf780e commit e608d01
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6300,7 +6300,9 @@ def get_memory_mapped_image(self, max_virtual_address=0x10000000, ImageBase=None
if padding_length > 0:
mapped_data += b"\0" * padding_length
elif padding_length < 0:
mapped_data = mapped_data[:padding_length]
mapped_data = self.header + b"\0" * (
len(mapped_data) + padding_length - len(self.header)
)

mapped_data += section.get_data()

Expand Down

0 comments on commit e608d01

Please sign in to comment.