Exemplo n.º 1
0
 public static void HelloConnectMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
 {
     account.SetStatus(Status.None);
     if (!account.IsMITM)
     {
         HelloConnectMessage helloConnectMessage = (HelloConnectMessage)message;
         using (BigEndianReader reader = new BigEndianReader(packetDatas))
         {
             helloConnectMessage.Deserialize(reader);
         }
         sbyte[] credentials = RSAKey.Encrypt(helloConnectMessage.key,
                                              account.AccountName,
                                              account.AccountPassword,
                                              helloConnectMessage.salt);
         IdentificationMessage msg = new IdentificationMessage(GameConstants.AutoConnect, GameConstants.UseCertificate, GameConstants.UseLoginToken, new Common.Protocol.Types.VersionExtended(GameConstants.Major, GameConstants.Minor, GameConstants.Release, GameConstants.Revision, GameConstants.Patch, GameConstants.BuildType, GameConstants.Install, GameConstants.Technology), GameConstants.Lang, credentials, GameConstants.ServerID, GameConstants.SessionOptionalSalt, new System.Collections.Generic.List <short>());
         account.SocketManager.Send(msg);
     }
     account.Log(new ConnectionTextInformation("Identification en cours."), 0);
 }
Exemplo n.º 2
0
 /// <summary> Encrypts the given bytes </summary>
 protected override byte[] EncryptBlock(byte[] blob)
 {
     return(RSAKey.Encrypt(blob, false));
 }