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

Method __pack__

pythonmemorymodule/pefile.py:1029–1045  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1027 setattr(self, key, val)
1028
1029 def __pack__(self):
1030
1031 new_values = []
1032
1033 for idx, val in enumerate(self.__unpacked_data_elms__):
1034
1035 for key in self.__keys__[idx]:
1036 new_val = getattr(self, key)
1037
1038 # In the case of unions, when the first changed value
1039 # is picked the loop is exited
1040 if new_val != val:
1041 break
1042
1043 new_values.append(new_val)
1044
1045 return struct.pack(self.__format__, *new_values)
1046
1047 def __str__(self):
1048 return "\n".join(self.dump())

Callers 3

__pack__Method · 0.45
__pack__Method · 0.45
writeMethod · 0.45

Calls 1

packMethod · 0.45

Tested by

no test coverage detected