def __init__(self, data = None, isNDR64 = False): NDRSTRUCT.__init__(self, data, isNDR64) self.structure = ( ('tdescElem',TYPEDESC), ('cDims',USHORT), ('rgbounds',SAFEARRAYBOUND_ARRAY), )
def __init__(self, data=None, isNDR64=False): NDRSTRUCT.__init__(self, data, isNDR64) self.structure = ( ('tdescElem', TYPEDESC), ('cDims', USHORT), ('rgbounds', SAFEARRAYBOUND_ARRAY), )
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)
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)
def __setitem__(self, key, value): if key == 'Data' and isinstance(value, NDR) is False: try: value.encode('utf-16le') except UnicodeDecodeError: import sys value = value.decode(sys.getfilesystemencoding()) self['Length'] = len(value)*2 self['MaximumLength'] = len(value)*2 return NDRSTRUCT.__setitem__(self, key, value)
def __setitem__(self, key, value): if key == 'Data' and isinstance(value, NDR) is False: try: value.encode('utf-16le') except UnicodeDecodeError: import sys value = value.decode(sys.getfilesystemencoding()) self['Length'] = len(value) * 2 self['MaximumLength'] = len(value) * 2 return NDRSTRUCT.__setitem__(self, key, value)
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)
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)
def __init__(self, data = None,isNDR64 = False): NDRSTRUCT.__init__(self, data, isNDR64) self['context_handle_uuid'] = '\x00'*20
def getData(self, soFar=0): return NDRSTRUCT.getData(self, soFar)
def fromString(self, data, soFar = 0 ): # Here we're changing the struct so we can represent a linked list with NDR self.fields['pNextEntInf'] = PREPLENTINFLIST(isNDR64 = self._isNDR64) retVal = NDRSTRUCT.fromString(self, data, soFar) return retVal
def fromString(self, data, soFar = 0): retVal = NDRSTRUCT.fromString(self, data, soFar) #self.dumpRaw() return retVal
def getData(self, soFar=0): self['SubAuthorityCount'] = len(self['SubAuthority']) return NDRSTRUCT.getData(self, soFar)
def getData(self, soFar = 0): return NDRSTRUCT.getData(self, soFar)
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)
def getData(self, soFar = 0): self['SubAuthorityCount'] = len(self['SubAuthority']) return NDRSTRUCT.getData(self, soFar)
def __init__(self, data=None, isNDR64=False): NDRSTRUCT.__init__(self, data, isNDR64) self["context_handle_uuid"] = "\x00" * 20
def fromString(self, data, soFar=0): # Here we're changing the struct so we can represent a linked list with NDR self.fields["pNextEntInf"] = PREPLENTINFLIST(isNDR64=self._isNDR64) retVal = NDRSTRUCT.fromString(self, data, soFar) return retVal
def __setitem__(self, key, value): if key == 'Data' and isinstance(value, NDR) is False: self['Length'] = len(value) self['MaximumLength'] = len(value) return NDRSTRUCT.__setitem__(self, key, value)
def fromString(self, data, soFar=0): retVal = NDRSTRUCT.fromString(self, data, soFar) # self.dumpRaw() return retVal
def getData(self, soFar=0): self["SubAuthorityCount"] = len(self["SubAuthority"]) return NDRSTRUCT.getData(self, soFar)