Ejemplo n.º 1
0
Archivo: rfb.py Proyecto: dnozay/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     self.x = UInt16Be()
     self.y = UInt16Be()
     self.width = UInt16Be()
     self.height = UInt16Be()
     self.encoding = SInt32Be()
Ejemplo n.º 2
0
 def __init__(self):
     CompositeType.__init__(self)
     self.x = UInt16Be()
     self.y = UInt16Be()
     self.width = UInt16Be()
     self.height = UInt16Be()
     self.encoding = SInt32Be()
Ejemplo n.º 3
0
Archivo: x224.py Proyecto: dnozay/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     self.len = UInt8(lambda:sizeof(self) - 1)
     self.code = UInt8(MessageType.X224_TPDU_CONNECTION_CONFIRM, constant = True)
     self.padding = (UInt16Be(), UInt16Be(), UInt8())
     #read if there is enough data
     self.protocolNeg = Negotiation(optional = True)
Ejemplo n.º 4
0
Archivo: rfb.py Proyecto: dnozay/rdpy
 def __init__(self, incremental = False, x = 0, y = 0, width = 0, height = 0):
     CompositeType.__init__(self)
     self.incremental = UInt8(incremental)
     self.x = UInt16Be(x)
     self.y = UInt16Be(y)
     self.width = UInt16Be(width)
     self.height = UInt16Be(height)
Ejemplo n.º 5
0
Archivo: caps.py Proyecto: dnozay/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()
Ejemplo n.º 6
0
 def __init__(self, name="", options=UInt32Le()):
     CompositeType.__init__(self)
     #name of channel
     self.name = String(name[0:8] + "\x00" * (8 - len(name)),
                        readLen=UInt8(8))
     #unknown
     self.options = options
Ejemplo n.º 7
0
 def __init__(self):
     CompositeType.__init__(self)
     self.len = UInt8(lambda:sizeof(self) - 1)
     self.code = UInt8()
     self.padding = (UInt16Be(), UInt16Be(), UInt8())
     #read if there is enought data
     self.protocolNeg = Negotiation(optional = True)
Ejemplo n.º 8
0
 def __init__(self, incremental=False, x=0, y=0, width=0, height=0):
     CompositeType.__init__(self)
     self.incremental = UInt8(incremental)
     self.x = UInt16Be(x)
     self.y = UInt16Be(y)
     self.width = UInt16Be(width)
     self.height = UInt16Be(height)
Ejemplo n.º 9
0
Archivo: order.py Proyecto: dnozay/rdpy
 def __init__(self, isDelta, conditional = lambda:True):
     """
     @param isDelta: callable object to know if coord field is in delta mode
     @param conditional: conditional read or write type
     """
     CompositeType.__init__(self, conditional = conditional)
     self.delta = SInt8(conditional = isDelta)
     self.coordinate = SInt16Le(conditional = isDelta)
Ejemplo n.º 10
0
 def __init__(self, optional = False):
     CompositeType.__init__(self, optional = optional)
     self.code = UInt8()
     self.flag = UInt8(0)
     #always 8
     self.len = UInt16Le(0x0008, constant = True)
     self.selectedProtocol = UInt32Le(conditional = lambda: self.code == NegociationType.TYPE_RDP_NEG_RSP)
     self.failureCode = UInt32Le(conditional = lambda: self.code == NegociationType.TYPE_RDP_NEG_FAILURE)
Ejemplo n.º 11
0
Archivo: lic.py Proyecto: anees042/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     #preambule
     self.bMsgtype = UInt8()
     self.flag = UInt8()
     self.wMsgSize = UInt16Le(lambda: sizeof(self))
     self.errorMessage = LicensingErrorMessage(
         conditional=lambda: self.bMsgtype == MessageType.ERROR_ALERT)
Ejemplo n.º 12
0
Archivo: x224.py Proyecto: dnozay/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     self.len = UInt8(lambda:sizeof(self) - 1)
     self.code = UInt8(MessageType.X224_TPDU_CONNECTION_REQUEST, constant = True)
     self.padding = (UInt16Be(), UInt16Be(), UInt8())
     self.cookie = String(until = "\x0d\x0a", conditional = lambda:(self.len._is_readed and self.len.value > 14))
     #read if there is enough data
     self.protocolNeg = Negotiation(optional = True)
Ejemplo n.º 13
0
Archivo: lic.py Proyecto: anees042/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     #preambule
     self.bMsgtype = UInt8()
     self.flag = UInt8()
     self.wMsgSize = UInt16Le(lambda: sizeof(self))
     self.errorMessage = LicensingErrorMessage(conditional = lambda:self.bMsgtype == MessageType.ERROR_ALERT)
     
Ejemplo n.º 14
0
Archivo: order.py Proyecto: dnozay/rdpy
 def __init__(self, controlFlag):
     CompositeType.__init__(self)
     #only one field
     self.fieldFlag = UInt8(conditional = lambda:(controlFlag.value & ControlFlag.TS_ZERO_FIELD_BYTE_BIT0 == 0 and controlFlag.value & ControlFlag.TS_ZERO_FIELD_BYTE_BIT1 == 0))
     self.nLeftRect = CoordField(lambda:not controlFlag.value & ControlFlag.TS_DELTA_COORDINATES == 0)
     self.nTopRect = CoordField(lambda:not controlFlag.value & ControlFlag.TS_DELTA_COORDINATES == 0)
     self.nWidth = CoordField(lambda:not controlFlag.value & ControlFlag.TS_DELTA_COORDINATES == 0)
     self.nHeight = CoordField(lambda:not controlFlag.value & ControlFlag.TS_DELTA_COORDINATES == 0)
     self.bRop = CoordField(lambda:not controlFlag.value & ControlFlag.TS_DELTA_COORDINATES == 0)
Ejemplo n.º 15
0
 def __init__(self):
     CompositeType.__init__(self)
     self.BitsPerPixel = UInt8(32)
     self.Depth = UInt8(24)
     self.BigEndianFlag = UInt8(False)
     self.TrueColorFlag = UInt8(True)
     self.RedMax = UInt16Be(255)
     self.GreenMax = UInt16Be(255)
     self.BlueMax = UInt16Be(255)
     self.RedShift = UInt8(16)
     self.GreenShift = UInt8(8)
     self.BlueShift = UInt8(0)
     self.padding = (UInt16Be(), UInt8())
Ejemplo n.º 16
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.osMajorType = UInt16Le()
     self.osMinorType = UInt16Le()
     self.protocolVersion = UInt16Le(0x0200, constant = True)
     self.pad2octetsA = UInt16Le()
     self.generalCompressionTypes = UInt16Le(0, constant = True)
     self.extraFlags = UInt16Le()
     self.updateCapabilityFlag = UInt16Le(0, constant = True)
     self.remoteUnshareFlag = UInt16Le(0, constant = True)
     self.generalCompressionLevel = UInt16Le(0, constant = True)
     self.refreshRectSupport = UInt8()
     self.suppressOutputSupport = UInt8()
Ejemplo n.º 17
0
Archivo: rfb.py Proyecto: dnozay/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     self.BitsPerPixel = UInt8(32)
     self.Depth = UInt8(24)
     self.BigEndianFlag = UInt8(False)
     self.TrueColorFlag = UInt8(True)
     self.RedMax = UInt16Be(255)
     self.GreenMax = UInt16Be(255)
     self.BlueMax = UInt16Be(255)
     self.RedShift = UInt8(16)
     self.GreenShift = UInt8(8)
     self.BlueShift = UInt8(0)
     self.padding = (UInt16Be(), UInt8())
Ejemplo n.º 18
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.pad1 = UInt32Le()
     self.pad2 = UInt32Le()
     self.pad3 = UInt32Le()
     self.pad4 = UInt32Le()
     self.pad5 = UInt32Le()
     self.pad6 = UInt32Le()
     self.cache0Entries = UInt16Le()
     self.cache0MaximumCellSize = UInt16Le()
     self.cache1Entries = UInt16Le()
     self.cache1MaximumCellSize = UInt16Le()
     self.cache2Entries = UInt16Le()
     self.cache2MaximumCellSize = UInt16Le()
Ejemplo n.º 19
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.inputFlags = UInt16Le()
     self.pad2octetsA = UInt16Le()
     #same value as gcc.ClientCoreSettings.kbdLayout
     self.keyboardLayout = UInt32Le()
     #same value as gcc.ClientCoreSettings.keyboardType
     self.keyboardType = UInt32Le()
     #same value as gcc.ClientCoreSettings.keyboardSubType
     self.keyboardSubType = UInt32Le()
     #same value as gcc.ClientCoreSettings.keyboardFnKeys
     self.keyboardFunctionKey = UInt32Le()
     #same value as gcc.ClientCoreSettingrrs.imeFileName
     self.imeFileName = String("\x00" * 64, readLen = UInt8(64))
Ejemplo n.º 20
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.preferredBitsPerPixel = UInt16Le()
     self.receive1BitPerPixel = UInt16Le(0x0001)
     self.receive4BitsPerPixel = UInt16Le(0x0001)
     self.receive8BitsPerPixel = UInt16Le(0x0001)
     self.desktopWidth = UInt16Le()
     self.desktopHeight = UInt16Le()
     self.pad2octets = UInt16Le()
     self.desktopResizeFlag = UInt16Le()
     self.bitmapCompressionFlag = UInt16Le(0x0001, constant = True)
     self.highColorFlags = UInt8(0)
     self.drawingFlags = UInt8()
     self.multipleRectangleSupport = UInt16Le(0x0001, constant = True)
     self.pad2octetsB = UInt16Le()
Ejemplo n.º 21
0
Archivo: caps.py Proyecto: dnozay/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()
Ejemplo n.º 22
0
Archivo: order.py Proyecto: dnozay/rdpy
 def __init__(self, order = None):
     CompositeType.__init__(self)
     self.controlFlags = UInt8()
     self.orderType = UInt8()
     
     def OrderFactory():
         """
         Closure for capability factory
         """
         for c in [DstBltOrder]:
             if self.orderType.value == c._ORDER_TYPE_:
                 return c(self.controlFlags)
         log.debug("unknown Order type : %s"%hex(self.orderType.value))
         #read entire packet
         return String()
     
     if order is None:
         order = FactoryType(OrderFactory)
     elif not "_ORDER_TYPE_" in order.__class__.__dict__:
         raise InvalidExpectedDataException("Try to send an invalid order block")
Ejemplo n.º 23
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, capability = None):
     CompositeType.__init__(self)
     self.capabilitySetType = UInt16Le(lambda:capability.__class__._TYPE_)
     self.lengthCapability = UInt16Le(lambda:sizeof(self))
     
     def CapabilityFactory():
         """
         Closure for capability factory
         """
         for c in [GeneralCapability, BitmapCapability, OrderCapability, BitmapCacheCapability, PointerCapability, InputCapability, BrushCapability, GlyphCapability, OffscreenBitmapCacheCapability, VirtualChannelCapability, SoundCapability, ControlCapability, WindowActivationCapability, FontCapability, ColorCacheCapability, ShareCapability]:
             if self.capabilitySetType.value == c._TYPE_:
                 return c(readLen = self.lengthCapability - 4)
         log.debug("unknown Capability type : %s"%hex(self.capabilitySetType.value))
         #read entire packet
         return String(readLen = self.lengthCapability - 4)
     
     if capability is None:
         capability = FactoryType(CapabilityFactory)
     elif not "_TYPE_" in capability.__class__.__dict__:
         raise InvalidExpectedDataException("Try to send an invalid capability block")
         
     self.capability = capability
Ejemplo n.º 24
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 def __init__(self, dataBlock = None):
     CompositeType.__init__(self)
     self.type = UInt16Le(lambda:self.dataBlock.__class__._TYPE_)
     self.length = UInt16Le(lambda:sizeof(self))
     
     def DataBlockFactory():
         """
         build settings in accordance of type self.type.value
         """
         for c in [ClientCoreData, ClientSecurityData, ClientNetworkData, ServerCoreData, ServerNetworkData, ServerSecurityData]:
             if self.type.value == c._TYPE_:
                 return c(readLen = self.length - 4)
         log.debug("unknown GCC block type : %s"%hex(self.type.value))
         #read entire packet
         return String(readLen = self.length - 4)
     
     if dataBlock is None:
         dataBlock = FactoryType(DataBlockFactory)
     elif not "_TYPE_" in dataBlock.__class__.__dict__:
         raise InvalidExpectedDataException("Try to send an invalid GCC blocks")
     
     self.dataBlock = dataBlock
Ejemplo n.º 25
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.rdpVersion = UInt32Le(Version.RDP_VERSION_5_PLUS)
     self.desktopWidth = UInt16Le(1280)
     self.desktopHeight = UInt16Le(800)
     self.colorDepth = UInt16Le(ColorDepth.RNS_UD_COLOR_8BPP)
     self.sasSequence = UInt16Le(Sequence.RNS_UD_SAS_DEL)
     self.kbdLayout = UInt32Le(KeyboardLayout.FRENCH)
     self.clientBuild = UInt32Le(3790)
     self.clientName = String("rdpy" + "\x00"*11, readLen = UInt8(32), unicode = True)
     self.keyboardType = UInt32Le(KeyboardType.IBM_101_102_KEYS)
     self.keyboardSubType = UInt32Le(0)
     self.keyboardFnKeys = UInt32Le(12)
     self.imeFileName = String("\x00"*64, readLen = UInt8(64))
     self.postBeta2ColorDepth = UInt16Le(ColorDepth.RNS_UD_COLOR_8BPP)
     self.clientProductId = UInt16Le(1)
     self.serialNumber = UInt32Le(0)
     self.highColorDepth = UInt16Le(HighColor.HIGH_COLOR_24BPP)
     self.supportedColorDepths = UInt16Le(Support.RNS_UD_15BPP_SUPPORT | Support.RNS_UD_16BPP_SUPPORT | Support.RNS_UD_24BPP_SUPPORT | Support.RNS_UD_32BPP_SUPPORT)
     self.earlyCapabilityFlags = UInt16Le(CapabilityFlags.RNS_UD_CS_SUPPORT_ERRINFO_PDU)
     self.clientDigProductId = String("\x00"*64, readLen = UInt8(64))
     self.connectionType = UInt8()
     self.pad1octet = UInt8()
     self.serverSelectedProtocol = UInt32Le()
Ejemplo n.º 26
0
 def __init__(self):
     CompositeType.__init__(self)
     self.rdpVersion = Version.RDP_VERSION_5_PLUS
     self.desktopWidth = UInt16Le(1280)
     self.desktopHeight = UInt16Le(1024)
     self.colorDepth = ColorDepth.RNS_UD_COLOR_8BPP
     self.sasSequence = Sequence.RNS_UD_SAS_DEL
     self.kbdLayout = KeyboardLayout.FRENCH
     self.clientBuild = UInt32Le(3790)
     self.clientName = UniString("rdpy" + "\x00" * 11, readLen=UInt8(30))
     self.keyboardType = KeyboardType.IBM_101_102_KEYS
     self.keyboardSubType = UInt32Le(0)
     self.keyboardFnKeys = UInt32Le(12)
     self.imeFileName = String("\x00" * 64, readLen=UInt8(64))
     self.postBeta2ColorDepth = ColorDepth.RNS_UD_COLOR_8BPP
     self.clientProductId = UInt16Le(1)
     self.serialNumber = UInt32Le(0)
     self.highColorDepth = HighColor.HIGH_COLOR_24BPP
     self.supportedColorDepths = Support.RNS_UD_24BPP_SUPPORT | Support.RNS_UD_16BPP_SUPPORT | Support.RNS_UD_15BPP_SUPPORT
     self.earlyCapabilityFlags = CapabilityFlags.RNS_UD_CS_SUPPORT_ERRINFO_PDU
     self.clientDigProductId = String("\x00" * 64, readLen=UInt8(64))
     self.connectionType = UInt8()
     self.pad1octet = UInt8()
     self.serverSelectedProtocol = UInt32Le()
Ejemplo n.º 27
0
 def __init__(self):
     CompositeType.__init__(self)
     self.rdpVersion = Version.RDP_VERSION_5_PLUS
     self.clientRequestedProtocol = UInt32Le()
Ejemplo n.º 28
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 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))
Ejemplo n.º 29
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 def __init__(self, init = [], readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.settings = ArrayType(DataBlock, [DataBlock(i) for i in init])
Ejemplo n.º 30
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 def __init__(self, name = "", options = 0):
     CompositeType.__init__(self)
     #name of channel
     self.name = String(name[0:8] + "\x00" * (8 - len(name)), readLen = UInt8(8))
     #unknown
     self.options = UInt32Le()
Ejemplo n.º 31
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 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)
Ejemplo n.º 32
0
 def __init__(self, text=""):
     CompositeType.__init__(self)
     self.padding = (UInt16Be(), UInt8())
     self.size = UInt32Be(len(text))
     self.message = String(text)
Ejemplo n.º 33
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.helpKeyFlag = UInt16Le()
     self.helpKeyIndexFlag = UInt16Le()
     self.helpExtendedKeyFlag = UInt16Le()
     self.windowManagerKeyFlag = UInt16Le()
Ejemplo n.º 34
0
 def __init__(self):
     CompositeType.__init__(self)
     self.header = UInt8(2, constant = True)
     self.messageType = MessageType.X224_TPDU_DATA
     self.separator = UInt8(0x80, constant = True)
Ejemplo n.º 35
0
Archivo: lic.py Proyecto: anees042/rdpy
 def __init__(self, conditional=lambda: True):
     CompositeType.__init__(self, conditional=conditional)
     self.dwErrorCode = UInt32Le()
     self.dwStateTransition = UInt32Le()
     self.blob = LicenceBinaryBlob()
Ejemplo n.º 36
0
 def __init__(self, downFlag=False, key=0):
     CompositeType.__init__(self)
     self.downFlag = UInt8(downFlag)
     self.padding = UInt16Be()
     self.key = UInt32Be(key)
Ejemplo n.º 37
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.colorTableCacheSize = UInt16Le(0x0006)
     self.pad2octets = UInt16Le()
Ejemplo n.º 38
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.fontSupportFlags = UInt16Le(0x0001)
     self.pad2octets = UInt16Le()
Ejemplo n.º 39
0
 def __init__(self):
     CompositeType.__init__(self)
     self.encryptionMethods = UInt32Le()
     self.extEncryptionMethods = UInt32Le()
Ejemplo n.º 40
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.encryptionMethod = UInt32Le()
     self.encryptionLevel = UInt32Le() 
Ejemplo n.º 41
0
 def __init__(self):
     CompositeType.__init__(self)
     self.encryptionMethod = UInt32Le()
     self.encryptionLevel = UInt32Le()
Ejemplo n.º 42
0
 def __init__(self, mask=0, x=0, y=0):
     CompositeType.__init__(self)
     self.mask = UInt8(mask)
     self.x = UInt16Be(x)
     self.y = UInt16Be(y)
Ejemplo n.º 43
0
Archivo: lic.py Proyecto: anees042/rdpy
 def __init__(self):
     CompositeType.__init__(self)
     self.wBlobType = UInt16Le()
     self.wBlobLen = UInt16Le(lambda: sizeof(self.blobData))
     self.blobData = String(readLen=self.wBlobLen,
                            conditional=lambda: self.wBlobLen.value > 0)
Ejemplo n.º 44
0
Archivo: gcc.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.rdpVersion = UInt32Le(Version.RDP_VERSION_5_PLUS)
     self.clientRequestedProtocol = UInt32Le()
Ejemplo n.º 45
0
Archivo: caps.py Proyecto: dnozay/rdpy
 def __init__(self, readLen = None):
     CompositeType.__init__(self, readLen = readLen)
     self.nodeId = UInt16Le()
     self.pad2octets = UInt16Le()
Ejemplo n.º 46
0
 def __init__(self):
     CompositeType.__init__(self)
     self.width = UInt16Be()
     self.height = UInt16Be()
     self.pixelFormat = PixelFormat()