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

Method contains_offset

pythonmemorymodule/pefile.py:1242–1252  ·  view source on GitHub ↗

Check whether the section contains the file offset provided.

(self, offset)

Source from the content-addressed store, hash-verified

1240 return rva - self.get_VirtualAddress_adj() + self.get_PointerToRawData_adj()
1241
1242 def contains_offset(self, offset):
1243 """Check whether the section contains the file offset provided."""
1244
1245 if self.PointerToRawData is None:
1246 # bss and other sections containing only uninitialized data must have 0
1247 # and do not take space in the file
1248 return False
1249 PointerToRawData_adj = self.get_PointerToRawData_adj()
1250 return (
1251 PointerToRawData_adj <= offset < PointerToRawData_adj + self.SizeOfRawData
1252 )
1253
1254 def contains_rva(self, rva):
1255 """Check whether the section contains the address provided."""

Callers 1

get_section_by_offsetMethod · 0.80

Calls 1

Tested by

no test coverage detected