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

Method to_list

windows/com.py:103–117  ·  view source on GitHub ↗
(self, t=None)

Source from the content-addressed store, hash-verified

101 return res
102
103 def to_list(self, t=None):
104 if t is None:
105 if hasattr(self, "elt_type"):
106 t = self.elt_type
107 else:
108 raise ValueError("Missing type of the array")
109 if self.cDims != 1:
110 raise NotImplementedError("tagSAFEARRAY if dims != 1")
111
112 nb_element = self.rgsabound[0].cElements
113 llbound = self.rgsabound[0].lLbound
114 if self.cbElements != ctypes.sizeof(t):
115 raise ValueError("Size of elements != sizeof(type)")
116 data = [t.from_address(self.pvData + (i + llbound) * ctypes.sizeof(t)).value for i in range(nb_element)]
117 return data
118
119#VT_VALUE_TO_TYPE = {
120#VT_I2 : SHORT,

Callers 3

namesMethod · 0.80
get_propertiesMethod · 0.80

Calls 1

sizeofMethod · 0.45

Tested by

no test coverage detected