Beispiel #1
0
 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)
Beispiel #4
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)
Beispiel #5
0
 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)
Beispiel #6
0
 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)
Beispiel #8
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)
Beispiel #9
0
 def __init__(self, data = None,isNDR64 = False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self['context_handle_uuid'] = '\x00'*20
Beispiel #10
0
 def getData(self, soFar=0):
     return NDRSTRUCT.getData(self, soFar)
Beispiel #11
0
 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
Beispiel #12
0
 def fromString(self, data, soFar = 0):
     retVal = NDRSTRUCT.fromString(self, data, soFar)
     #self.dumpRaw()
     return retVal
Beispiel #13
0
 def getData(self, soFar=0):
     self['SubAuthorityCount'] = len(self['SubAuthority'])
     return NDRSTRUCT.getData(self, soFar)
Beispiel #14
0
 def getData(self, soFar = 0):
     return NDRSTRUCT.getData(self, soFar)
Beispiel #15
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)
Beispiel #16
0
 def getData(self, soFar = 0):
     self['SubAuthorityCount'] = len(self['SubAuthority'])
     return NDRSTRUCT.getData(self, soFar)
Beispiel #17
0
 def __init__(self, data=None, isNDR64=False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self["context_handle_uuid"] = "\x00" * 20
Beispiel #18
0
 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
Beispiel #19
0
 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)
Beispiel #20
0
 def fromString(self, data, soFar=0):
     retVal = NDRSTRUCT.fromString(self, data, soFar)
     # self.dumpRaw()
     return retVal
Beispiel #21
0
 def getData(self, soFar=0):
     self["SubAuthorityCount"] = len(self["SubAuthority"])
     return NDRSTRUCT.getData(self, soFar)