diff --git a/README.md b/README.md index 9a55cbc..7e2ec5c 100644 --- a/README.md +++ b/README.md @@ -89,11 +89,9 @@ class MyRDPFactory(rdp.ClientFactory): def clientConnectionLost(self, connector, reason): reactor.stop() - app.exit() def clientConnectionFailed(self, connector, reason): reactor.stop() - app.exit() def buildObserver(self, controller, addr): class MyObserver(rdp.RDPClientObserver) diff --git a/rdpy/protocol/rdp/pdu/data.py b/rdpy/protocol/rdp/pdu/data.py index 6c62a7b..8435fc6 100644 --- a/rdpy/protocol/rdp/pdu/data.py +++ b/rdpy/protocol/rdp/pdu/data.py @@ -490,7 +490,7 @@ class RDPInfo(CompositeType): #code page self.codePage = UInt32Le() #support flag - self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_AUTOLOGON | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS) + self.flag = UInt32Le(InfoFlag.INFO_MOUSE | InfoFlag.INFO_UNICODE | InfoFlag.INFO_LOGONNOTIFY | InfoFlag.INFO_LOGONERRORS) self.cbDomain = UInt16Le(lambda:sizeof(self.domain) - 2) self.cbUserName = UInt16Le(lambda:sizeof(self.userName) - 2) self.cbPassword = UInt16Le(lambda:sizeof(self.password) - 2) diff --git a/rdpy/protocol/rdp/rdp.py b/rdpy/protocol/rdp/rdp.py index 7a8c38b..527acf9 100644 --- a/rdpy/protocol/rdp/rdp.py +++ b/rdpy/protocol/rdp/rdp.py @@ -95,6 +95,7 @@ class RDPClientController(pdu.layer.PDUClientListener): Set password for session @param password: password of session """ + self.setAutologon() self._pduLayer._info.password.value = password def setDomain(self, domain): @@ -104,6 +105,12 @@ class RDPClientController(pdu.layer.PDUClientListener): """ self._pduLayer._info.domain.value = domain + def setAutologon(self): + """ + @summary: enable autologon + """ + self._pduLayer._info.flag |= pdu.data.InfoFlag.INFO_AUTOLOGON + def addClientObserver(self, observer): """ Add observer to RDP protocol