Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. using AccServer.Network.Cryptography;
  2. using System;
  3. using System.IO;
  4. using System.Text;
  5.  
  6.  
  7. namespace AccServer.Network.AuthPackets
  8. {
  9. public unsafe class Authentication : Interfaces.IPacket
  10. {
  11. public string Username;
  12. public string Password;
  13. public string Server;
  14. public string Mac;
  15.  
  16. public Authentication()
  17. {
  18. }
  19. public void Deserialize(byte[] buffer)
  20. {
  21. Alchemist.Loader.HandleBuffer(buffer);
  22. MemoryStream MS = new MemoryStream(buffer);
  23. BinaryReader BR = new BinaryReader(MS);
  24.  
  25. BR.ReadUInt16();
  26. BR.ReadUInt16();
  27. Username = Encoding.Default.GetString(BR.ReadBytes(128));
  28. Username = Username.Replace("\0", "");
  29. Password = Encoding.Default.GetString(BR.ReadBytes(64));
  30. Password = Password.Replace("\0", "");
  31. Server = Encoding.Default.GetString(BR.ReadBytes(32));
  32. Server = Server.Replace("\0", "");
  33. Mac = Encoding.Default.GetString(BR.ReadBytes(12));
  34. Mac = Mac.Replace("\0", "");
  35. BR.Close();
  36. MS.Close();
  37. }
  38. public byte[] ToArray()
  39. {
  40. throw new NotImplementedException();
  41. }
  42.  
  43.  
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement