Exemplo n.º 1
0
Arquivo: caps.py Projeto: zha0/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.glyphCache = ArrayType(CacheEntry, init = [CacheEntry() for _ in range(0,10)], readLen = UInt8(10))
     self.fragCache = UInt32Le()
     #all fonts are sent with bitmap format (very expensive)
     self.glyphSupportLevel = UInt16Le(GlyphSupport.GLYPH_SUPPORT_NONE)
     self.pad2octets = UInt16Le()
Exemplo n.º 2
0
 def __init__(self, readLen=None):
     CompositeType.__init__(self, readLen=readLen)
     self.MCSChannelId = UInt16Le(mcs.Channel.MCS_GLOBAL_CHANNEL)
     self.channelCount = UInt16Le(lambda: len(self.channelIdArray._array))
     self.channelIdArray = ArrayType(UInt16Le, readLen=self.channelCount)
     self.pad = UInt16Le(
         conditional=lambda: ((self.channelCount.value % 2) == 1))
Exemplo n.º 3
0
 def __init__(self):
     CompositeType.__init__(self)
     self.pad2OctetsA = UInt16Le()
     self.numberOrders = UInt16Le(lambda: len(self.orderData._array))
     self.pad2OctetsB = UInt16Le()
     self.orderData = ArrayType(order.PrimaryDrawingOrder,
                                readLen=self.numberOrders)
Exemplo n.º 4
0
 def __init__(self, readLen=None):
     """
     @param readLen: Max size of packet
     """
     CompositeType.__init__(self, readLen=readLen)
     self.numberRectangles = UInt16Le(lambda: len(self.rectangles._array))
     self.rectangles = ArrayType(BitmapData, readLen=self.numberRectangles)
Exemplo n.º 5
0
 def recvFastPath(self, secFlag, fastPathS):
     """
     @summary: Implement IFastPathListener interface
     Fast path is needed by RDP 8.0
     @param fastPathS: {Stream} that contain fast path data
     @param secFlag: {SecFlags}
     """
     updates = ArrayType(data.FastPathUpdatePDU)
     fastPathS.readType(updates)
     for update in updates:
         if update.updateHeader.value == data.FastPathUpdateType.FASTPATH_UPDATETYPE_BITMAP:
             self._listener.onUpdate(update.updateData.rectangles._array)
Exemplo n.º 6
0
 def recvPDU(self, s):
     """
     @summary: Main receive function after connection sequence
     @param s: Stream from transport layer
     """
     pdus = ArrayType(data.PDU)
     s.readType(pdus)
     for pdu in pdus:
         if pdu.shareControlHeader.pduType.value == data.PDUType.PDUTYPE_DATAPDU:
             self.readDataPDU(pdu.pduMessage)
         elif pdu.shareControlHeader.pduType.value == data.PDUType.PDUTYPE_DEACTIVATEALLPDU:
             #use in deactivation-reactivation sequence
             #next state is either a capabilities re exchange or disconnection
             #http://msdn.microsoft.com/en-us/library/cc240454.aspx
             self.setNextState(self.recvDemandActivePDU)
Exemplo n.º 7
0
 def __init__(self):
     CompositeType.__init__(self)
     self.shareId = UInt32Le()
     self.originatorId = UInt16Le(0x03EA, constant=True)
     self.lengthSourceDescriptor = UInt16Le(
         lambda: sizeof(self.sourceDescriptor))
     self.lengthCombinedCapabilities = UInt16Le(
         lambda: (sizeof(self.numberCapabilities) + sizeof(self.pad2Octets)
                  + sizeof(self.capabilitySets)))
     self.sourceDescriptor = String("rdpy",
                                    readLen=self.lengthSourceDescriptor)
     self.numberCapabilities = UInt16Le(
         lambda: len(self.capabilitySets._array))
     self.pad2Octets = UInt16Le()
     self.capabilitySets = ArrayType(caps.Capability,
                                     readLen=self.numberCapabilities)
Exemplo n.º 8
0
Arquivo: caps.py Projeto: zha0/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.terminalDescriptor = String("\x00" * 16, readLen = UInt8(16))
     self.pad4octetsA = UInt32Le(0)
     self.desktopSaveXGranularity = UInt16Le(1)
     self.desktopSaveYGranularity = UInt16Le(20)
     self.pad2octetsA = UInt16Le(0)
     self.maximumOrderLevel = UInt16Le(1)
     self.numberFonts = UInt16Le()
     self.orderFlags = UInt16Le(OrderFlag.NEGOTIATEORDERSUPPORT)
     self.orderSupport = ArrayType(UInt8, init = [UInt8(0) for _ in range (0, 32)],  readLen = UInt8(32))
     self.textFlags = UInt16Le()
     self.orderSupportExFlags = UInt16Le()
     self.pad4octetsB = UInt32Le()
     self.desktopSaveSize = UInt32Le(480 * 480)
     self.pad2octetsC = UInt16Le()
     self.pad2octetsD = UInt16Le()
     self.textANSICodePage = UInt16Le(0)
     self.pad2octetsE = UInt16Le()
Exemplo n.º 9
0
 def __init__(self, userId=0, shareId=0):
     CompositeType.__init__(self)
     self.numEntriesCache0 = UInt16Le()
     self.numEntriesCache1 = UInt16Le()
     self.numEntriesCache2 = UInt16Le()
     self.numEntriesCache3 = UInt16Le()
     self.numEntriesCache4 = UInt16Le()
     self.totalEntriesCache0 = UInt16Le()
     self.totalEntriesCache1 = UInt16Le()
     self.totalEntriesCache2 = UInt16Le()
     self.totalEntriesCache3 = UInt16Le()
     self.totalEntriesCache4 = UInt16Le()
     self.bitMask = UInt8()
     self.pad2 = UInt8()
     self.pad3 = UInt16Le()
     self.entries = ArrayType(
         PersistentListEntry,
         readLen=UInt16Le(
             lambda: (self.numEntriesCache0 + self.numEntriesCache1 + self.
                      numEntriesCache2 + self.numEntriesCache3 + self.
                      numEntriesCache4)))
Exemplo n.º 10
0
 def __init__(self, init=[], readLen=None):
     CompositeType.__init__(self, readLen=readLen)
     self.settings = ArrayType(DataBlock, [DataBlock(i) for i in init])
Exemplo n.º 11
0
 def __init__(self, readLen=None):
     CompositeType.__init__(self, readLen=readLen)
     self.channelCount = UInt32Le(lambda: len(self.channelDefArray._array))
     self.channelDefArray = ArrayType(ChannelDef, readLen=self.channelCount)
Exemplo n.º 12
0
 def __init__(self):
     CompositeType.__init__(self)
     self.NumCertBlobs = UInt32Le()
     self.CertBlobArray = ArrayType(CertBlob, readLen=self.NumCertBlobs)
     self.padding = String(
         readLen=CallableValue(lambda: (8 + 4 * self.NumCertBlobs.value)))
Exemplo n.º 13
0
Arquivo: lic.py Projeto: nolteg/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     self.scopeCount = UInt32Le(lambda: sizeof(self.scopeArray))
     self.scopeArray = ArrayType(Scope, readLen=self.scopeCount)
Exemplo n.º 14
0
 def __init__(self, readLen=None):
     CompositeType.__init__(self, readLen=readLen)
     self.numberOfAreas = UInt8(lambda: len(self.areasToRefresh._array))
     self.pad3Octets = (UInt8(), UInt8(), UInt8())
     self.areasToRefresh = ArrayType(InclusiveRectangle,
                                     readLen=self.numberOfAreas)
Exemplo n.º 15
0
 def __init__(self):
     CompositeType.__init__(self)
     self.numEvents = UInt16Le(lambda: len(self.slowPathInputEvents._array))
     self.pad2Octets = UInt16Le()
     self.slowPathInputEvents = ArrayType(SlowPathInputEvent,
                                          readLen=self.numEvents)
Exemplo n.º 16
0
 def __init__(self):
     CompositeType.__init__(self)
     self.header = UInt16Le(FastPathUpdateType.FASTPATH_UPDATETYPE_BITMAP,
                            constant=True)
     self.numberRectangles = UInt16Le(lambda: len(self.rectangles._array))
     self.rectangles = ArrayType(BitmapData, readLen=self.numberRectangles)