MCPcopy Create free account
hub / github.com/ELMERIKH/PyinMemoryPE / merge_modified_section_data

Method merge_modified_section_data

pythonmemorymodule/pefile.py:6977–6990  ·  view source on GitHub ↗

Update the PE image content with any individual section data that has been modified.

(self)

Source from the content-addressed store, hash-verified

6975 self.__data__[offset : offset + len(data)] = data
6976
6977 def merge_modified_section_data(self):
6978 """Update the PE image content with any individual section data that has been
6979 modified.
6980 """
6981
6982 for section in self.sections:
6983 section_data_start = self.adjust_FileAlignment(
6984 section.PointerToRawData, self.OPTIONAL_HEADER.FileAlignment
6985 )
6986 section_data_end = section_data_start + section.SizeOfRawData
6987 if section_data_start < len(self.__data__) and section_data_end < len(
6988 self.__data__
6989 ):
6990 self.set_data_bytes(section_data_start, section.get_data())
6991
6992 def relocate_image(self, new_ImageBase):
6993 """Apply the relocation information to the image using the provided image base.

Callers

nothing calls this directly

Calls 3

adjust_FileAlignmentMethod · 0.95
set_data_bytesMethod · 0.95
get_dataMethod · 0.45

Tested by

no test coverage detected