Esempio n. 1
0
 def __init__(self, data = None, isNDR64 = False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self.structure = (
         ('tdescElem',TYPEDESC),
         ('cDims',USHORT),
         ('rgbounds',SAFEARRAYBOUND_ARRAY),
     )
Esempio n. 2
0
 def __init__(self, data=None, isNDR64=False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self.structure = (
         ('tdescElem', TYPEDESC),
         ('cDims', USHORT),
         ('rgbounds', SAFEARRAYBOUND_ARRAY),
     )
Esempio 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 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)
Esempio n. 7
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)
Esempio n. 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)
Esempio n. 9
0
 def __init__(self, data = None,isNDR64 = False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self['context_handle_uuid'] = '\x00'*20
Esempio n. 10
0
 def getData(self, soFar=0):
     return NDRSTRUCT.getData(self, soFar)
Esempio n. 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
Esempio n. 12
0
 def fromString(self, data, soFar = 0):
     retVal = NDRSTRUCT.fromString(self, data, soFar)
     #self.dumpRaw()
     return retVal
Esempio n. 13
0
 def getData(self, soFar=0):
     self['SubAuthorityCount'] = len(self['SubAuthority'])
     return NDRSTRUCT.getData(self, soFar)
Esempio n. 14
0
 def getData(self, soFar = 0):
     return NDRSTRUCT.getData(self, soFar)
Esempio n. 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)
Esempio n. 16
0
 def getData(self, soFar = 0):
     self['SubAuthorityCount'] = len(self['SubAuthority'])
     return NDRSTRUCT.getData(self, soFar)
Esempio n. 17
0
File: rrp.py Progetto: mrlzh/sLANt
 def __init__(self, data=None, isNDR64=False):
     NDRSTRUCT.__init__(self, data, isNDR64)
     self["context_handle_uuid"] = "\x00" * 20
Esempio n. 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
Esempio n. 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)
Esempio n. 20
0
 def fromString(self, data, soFar=0):
     retVal = NDRSTRUCT.fromString(self, data, soFar)
     # self.dumpRaw()
     return retVal
Esempio n. 21
0
 def getData(self, soFar=0):
     self["SubAuthorityCount"] = len(self["SubAuthority"])
     return NDRSTRUCT.getData(self, soFar)