Advertisement
MostafaLotfy1999

Packetss

Sep 11th, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.60 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Text;
  4.  
  5. namespace BlackOps.Game.AuthPackets
  6. {
  7.     public class Authentication : Interfaces.IPacket
  8.     {
  9.         public string Username;
  10.         public string Password;
  11.         public string Server;
  12.         public string MacAddress;
  13.         public Authentication()
  14.         {
  15.         }
  16.         public void Deserialize(byte[] buffer)
  17.         {
  18.             if (buffer.Length == 312)
  19.             {
  20.                 ushort length = BitConverter.ToUInt16(buffer, 0);
  21.                 if (length == 312)
  22.                 {
  23.                     ushort type = BitConverter.ToUInt16(buffer, 2);
  24.                     byte[] temp = new byte[16];
  25.                     if (type == 1636)
  26.                     {
  27.                         Username = Program.Encoding.GetString(buffer, 4, 16);
  28.                         Username = Username.Replace("\0", "");
  29.                         Password = Program.Encoding.GetString(buffer, 72, 16);
  30.                         Password = Password.Replace("\0", "");
  31.                         Server = Program.Encoding.GetString(buffer, 2, 16);
  32.                         Server = Server.Replace("\0", "");
  33.                         MacAddress = Program.Encoding.GetString(buffer, 152, 16);
  34.                         MacAddress = MacAddress.Replace("\0", "");
  35.                     }
  36.                 }
  37.             }
  38.         }
  39.         public byte[] ToArray()
  40.         {
  41.             throw new NotImplementedException();
  42.         }
  43.         public void Send(State.GameState client)
  44.         {
  45.             throw new NotImplementedException();
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement