Advertisement
DrjiMMy

Untitled

Mar 3rd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. // ☺ jiMMy 01289023490
  2. // ☺ Copyright © 2013 - 2016 TQ Digital
  3. // ☺ Arrow - Project
  4.  
  5. using AccServer.Network.Cryptography;
  6. using System;
  7. using System.IO;
  8. using System.Text;
  9.  
  10. namespace AccServer.Network.AuthPackets
  11. {
  12. public unsafe class Authentication : Interfaces.IPacket
  13. {
  14. public string Password, Username, Server, MacAddress;
  15. public Authentication()
  16. {
  17. }
  18. public void Deserialize(byte[] buffer)
  19. {
  20. if (buffer.Length == 312)
  21. {
  22. ushort length = BitConverter.ToUInt16(buffer, 0);
  23. if (length == 312)
  24. {
  25. ushort type = BitConverter.ToUInt16(buffer, 2);
  26. byte[] temp = new byte[16];
  27. if (type == 1542)
  28. {
  29. MemoryStream MS = new MemoryStream(buffer);
  30. BinaryReader BR = new BinaryReader(MS);
  31. BR.ReadUInt16();
  32. BR.ReadUInt16();
  33. Username = Encoding.Default.GetString(BR.ReadBytes(64)).Replace("\0", "");
  34. byte[] PasswordArray = BR.ReadBytes(64);
  35. LoaderEncryption.Decrypt(PasswordArray, 32);
  36. Password = Encoding.Default.GetString(PasswordArray).Replace("\0", "");
  37. Server = Encoding.Default.GetString(BR.ReadBytes(16)).Replace("\0", "");
  38. MacAddress = Encoding.Default.GetString(BR.ReadBytes(12)).Replace("\0", "");
  39. BR.Close();
  40. MS.Close();
  41. }
  42. }
  43. }
  44. }
  45. public byte[] ToArray()
  46. {
  47. throw new NotImplementedException();
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement