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

Method parse_resource_data_entry

pythonmemorymodule/pefile.py:4442–4464  ·  view source on GitHub ↗

Parse a data entry from the resources directory.

(self, rva)

Source from the content-addressed store, hash-verified

4440 return resource_directory_data
4441
4442 def parse_resource_data_entry(self, rva):
4443 """Parse a data entry from the resources directory."""
4444
4445 try:
4446 # If the RVA is invalid all would blow up. Some EXEs seem to be
4447 # specially nasty and have an invalid RVA.
4448 data = self.get_data(
4449 rva, Structure(self.__IMAGE_RESOURCE_DATA_ENTRY_format__).sizeof()
4450 )
4451 except PEFormatError:
4452 self.__warnings.append(
4453 "Error parsing a resource directory data entry, "
4454 "the RVA is invalid: 0x%x" % (rva)
4455 )
4456 return None
4457
4458 data_entry = self.__unpack_data__(
4459 self.__IMAGE_RESOURCE_DATA_ENTRY_format__,
4460 data,
4461 file_offset=self.get_offset_from_rva(rva),
4462 )
4463
4464 return data_entry
4465
4466 def parse_resource_entry(self, rva):
4467 """Parse a directory entry from the resources directory."""

Callers 1

Calls 5

get_dataMethod · 0.95
__unpack_data__Method · 0.95
get_offset_from_rvaMethod · 0.95
StructureClass · 0.85
sizeofMethod · 0.45

Tested by

no test coverage detected