bug fixing

This commit is contained in:
citronneur
2014-07-16 22:51:02 +02:00
parent 36e96c1db5
commit 5f65425095
3 changed files with 8 additions and 11 deletions

View File

@@ -108,7 +108,7 @@ if __name__ == '__main__':
height = 800
try:
opts, args = getopt.getopt(sys.argv[1:], "hu:p:d:w:l")
opts, args = getopt.getopt(sys.argv[1:], "hu:p:d:w:l:")
except getopt.GetoptError:
help()
for opt, arg in opts:

View File

@@ -93,7 +93,7 @@ class CapabilityFlags(object):
RNS_UD_CS_WANT_32BPP_SESSION = 0x0002
RNS_UD_CS_SUPPORT_STATUSINFO_PDU = 0x0004
RNS_UD_CS_STRONG_ASYMMETRIC_KEYS = 0x0008
RN_UD_CS_UNUSED = 0x0010
RNS_UD_CS_UNUSED = 0x0010
RNS_UD_CS_VALID_CONNECTION_TYPE = 0x0020
RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU = 0x0040
RNS_UD_CS_SUPPORT_NETCHAR_AUTODETECT = 0x0080

View File

@@ -484,7 +484,7 @@ class RDPInfo(CompositeType):
#code page
self.codePage = UInt32Le()
#support flag
self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_LOGONERRORS | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_ENABLEWINDOWSKEY | InfoFlag.INFO_DISABLECTRLALTDEL | InfoFlag.INFO_AUTOLOGON)
self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_AUTOLOGON)
self.cbDomain = UInt16Le(lambda:sizeof(self.domain) - 2)
self.cbUserName = UInt16Le(lambda:sizeof(self.userName) - 2)
self.cbPassword = UInt16Le(lambda:sizeof(self.password) - 2)
@@ -524,7 +524,7 @@ class ShareControlHeader(CompositeType):
def __init__(self, totalLength, pduType, userId):
"""
Set pduType as constant
@param totalLength: total length of pdu packet
@param totalLength: total length of PDU packet
"""
CompositeType.__init__(self)
#share control header
@@ -577,7 +577,7 @@ class ConfirmActivePDU(CompositeType):
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.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)
@@ -744,10 +744,6 @@ class UpdateDataPDU(CompositeType):
def UpdateDataFactory():
if self.updateType.value == UpdateType.UPDATETYPE_BITMAP:
return BitmapUpdateDataPDU()
elif self.updateType.value == UpdateType.UPDATETYPE_SYNCHRONIZE:
return SynchronizeUpdatePDU()
else:
return String()
@@ -1076,9 +1072,8 @@ class PDU(LayerAutomata, tpkt.FastPathListener):
message = "Unknown code %s"%hex(dataPDU.pduData.errorInfo.value)
if ErrorInfo._MESSAGES_.has_key(dataPDU.pduData.errorInfo):
message = ErrorInfo._MESSAGES_[dataPDU.pduData.errorInfo]
raise ErrorReportedFromPeer("Receive PDU Error info : %s"%message)
print "Error INFO PDU : %s"%message
def recvDemandActivePDU(self, data):
"""
@@ -1147,6 +1142,8 @@ class PDU(LayerAutomata, tpkt.FastPathListener):
@param data: Stream from transport layer
"""
dataPDU = self.readDataPDU(data)
if dataPDU is None:
return
if dataPDU.shareDataHeader.pduType2.value == PDUType2.PDUTYPE2_UPDATE and dataPDU.pduData.updateType.value == UpdateType.UPDATETYPE_BITMAP:
self._clientListener.onUpdate(dataPDU.pduData.updateData.rectangles._array)