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

Method trim

pythonmemorymodule/pefile.py:7359–7367  ·  view source on GitHub ↗

Return the just data defined by the PE headers, removing any overlaid data.

(self)

Source from the content-addressed store, hash-verified

7357 return None
7358
7359 def trim(self):
7360 """Return the just data defined by the PE headers, removing any overlaid data."""
7361
7362 overlay_data_offset = self.get_overlay_data_start_offset()
7363
7364 if overlay_data_offset is not None:
7365 return self.__data__[:overlay_data_offset]
7366
7367 return self.__data__[:]
7368
7369 # According to http://corkami.blogspot.com/2010/01/parce-que-la-planche-aura-brule.html
7370 # if PointerToRawData is less that 0x200 it's rounded to zero. Loading the test file

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected