MCPcopy Index your code
hub / github.com/ELMERIKH/PyinMemoryPE / __setattr__

Method __setattr__

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

Source from the content-addressed store, hash-verified

1218 return self.pe.__data__[offset:end]
1219
1220 def __setattr__(self, name, val):
1221
1222 if name == "Characteristics":
1223 section_flags = retrieve_flags(SECTION_CHARACTERISTICS, "IMAGE_SCN_")
1224
1225 # Set the section's flags according to the Characteristics member
1226 set_flags(self, val, section_flags)
1227
1228 elif "IMAGE_SCN_" in name and hasattr(self, name):
1229 if val:
1230 self.__dict__["Characteristics"] |= SECTION_CHARACTERISTICS[name]
1231 else:
1232 self.__dict__["Characteristics"] ^= SECTION_CHARACTERISTICS[name]
1233
1234 self.__dict__[name] = val
1235
1236 def get_rva_from_offset(self, offset):
1237 return offset - self.get_PointerToRawData_adj() + self.get_VirtualAddress_adj()

Callers

nothing calls this directly

Calls 2

retrieve_flagsFunction · 0.85
set_flagsFunction · 0.85

Tested by

no test coverage detected