Advertisement
Guest User

Normal Loader

a guest
Jun 28th, 2017
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.01 KB | None | 0 0
  1. // ☺ Created by Eslam Reda
  2. // ☺ Copyright © 2010 - 2016 TQ Digital
  3. // ☺ Emulator - Project
  4.  
  5. using System;
  6. using System.IO;
  7. using System.Text;
  8.  
  9. namespace COServer.Network.AuthPackets
  10. {
  11.     public unsafe class Authentication : Interfaces.IPacket
  12.     {
  13.         public string Password, Username, Server, MacAddress;
  14.         public Authentication()
  15.         {
  16.         }
  17.         public byte[] ToArray()
  18.         {
  19.             throw new NotImplementedException();
  20.         }
  21.         public void Deserialize(byte[] buffer)
  22.         {
  23.             if (buffer.Length == 312)
  24.             {
  25.                 ushort length = BitConverter.ToUInt16(buffer, 0);
  26.                 if (length == 312)
  27.                 {
  28.                     ushort type = BitConverter.ToUInt16(buffer, 2);
  29.                     byte[] temp = new byte[16];
  30.                     if (type == 1542)
  31.                     {
  32.                         MemoryStream MS = new MemoryStream(buffer);
  33.                         BinaryReader BR = new BinaryReader(MS);
  34.                         BR.ReadUInt16();
  35.                         BR.ReadUInt16();
  36.                         BR.ReadUInt32();
  37.                         Username = Encoding.Default.GetString(BR.ReadBytes(64)).Replace("\0", "");
  38.                         byte[] PasswordArray = BR.ReadBytes(64);
  39.                         //Cryptography.LoginCryptData.DoLogin(PasswordArray, 32);
  40.                         Password = Encoding.Default.GetString(PasswordArray).Replace("\0", "");
  41.                         Server = Encoding.Default.GetString(BR.ReadBytes(16)).Replace("\0", "");
  42.                         MacAddress = Encoding.Default.GetString(BR.ReadBytes(12)).Replace("\0", "");
  43.                         BR.Close();
  44.                         MS.Close();
  45.                     }
  46.                 }
  47.             }
  48.         }
  49.         public void Send(Client.GameState client)
  50.         {
  51.             throw new NotImplementedException();
  52.         }
  53.     }
  54. }
  55.  
  56. المفتاح
  57.         GameCryptographyKey = "C238xs65pjy7HU9Q",
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement