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

Method __setattr__

pythonmemorymodule/pefile.py:1733–1754  ·  view source on GitHub ↗
(self, name, val)

Source from the content-addressed store, hash-verified

1731 """
1732
1733 def __setattr__(self, name, val):
1734
1735 # If the instance doesn't yet have a struct attribute
1736 # it's not fully initialized so can't do any of the
1737 # following
1738 #
1739 if hasattr(self, "struct"):
1740 # Get the word containing the type and data
1741 #
1742 word = self.struct.Data
1743
1744 if name == "type":
1745 word = (val << 12) | (word & 0xFFF)
1746 elif name == "rva":
1747 offset = max(val - self.base_rva, 0)
1748 word = (word & 0xF000) | (offset & 0xFFF)
1749
1750 # Store the modified data
1751 #
1752 self.struct.Data = word
1753
1754 self.__dict__[name] = val
1755
1756
1757class TlsData(DataContainer):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected