Ejemplo n.º 1
0
 def __init__(self, data=None, isNDR64=False):
     NDRSTRUCT(self, data, isNDR64)
     self.structure = (
         ('tdescElem', TYPEDESC),
         ('cDims', USHORT),
         ('rgbounds', SAFEARRAYBOUND_ARRAY),
     )
Ejemplo n.º 2
0
 def __getitem__(self, key):
     if key == "asData":
         value = ""
         for letter in self.fields["asData"]["Data"]:
             value += pack("<H", letter).decode("utf-16le")
         return value
     else:
         return NDRSTRUCT.__getitem__(self, key)
Ejemplo n.º 3
0
 def __getitem__(self, key):
     if key == 'asData':
         value = ''
         for letter in self.fields['asData']['Data']:
             value += pack('<H', letter).decode('utf-16le')
         return value
     else:
         return NDRSTRUCT.__getitem__(self, key)
Ejemplo n.º 4
0
 def __setitem__(self, key, value):
     if key == "asData":
         value = value  # + '\x00'
         array = list()
         for letter in value:
             encoded = letter.encode("utf-16le")
             array.append(unpack("<H", encoded)[0])
         self.fields[key]["Data"] = array
         self["cBytes"] = len(value) * 2
         self["clSize"] = len(value)
         self.data = None  # force recompute
     else:
         return NDRSTRUCT.__setitem__(self, key, value)
Ejemplo n.º 5
0
 def __setitem__(self, key, value):
     if key == 'asData':
         value = value  #+ '\x00'
         array = list()
         for letter in value:
             encoded = letter.encode('utf-16le')
             array.append(unpack('<H', encoded)[0])
         self.fields[key]['Data'] = array
         self['cBytes'] = len(value) * 2
         self['clSize'] = len(value)
         self.data = None  # force recompute
     else:
         return NDRSTRUCT.__setitem__(self, key, value)
Ejemplo n.º 6
0
 def __init__(self, data=None, isNDR64=False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self['context_handle_uuid'] = '\x00' * 20
Ejemplo n.º 7
0
 def getData(self, soFar = 0):
     self['SubAuthorityCount'] = len(self['SubAuthority'])
     return NDRSTRUCT.getData(self, soFar)
Ejemplo n.º 8
0
 def __setitem__(self, key, value):
     if key == 'Data' and isinstance(value, NDR) is False:
         self['Length'] = len(value)*2
         self['MaximumLength'] = len(value)*2
     return NDRSTRUCT.__setitem__(self, key, value)
Ejemplo n.º 9
0
 def __init__(self, data = None,isNDR64 = False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self['context_handle_uuid'] = '\x00'*20