Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. public void Deserialize(byte[] buffer)
  2. {
  3. if (buffer.Length == 312)
  4. {
  5. ushort length = BitConverter.ToUInt16(buffer, 0);
  6.  
  7. if (length == 312)
  8. {
  9.  
  10. ushort type = BitConverter.ToUInt16(buffer, 2);
  11. byte[] temp = new byte[16];
  12. if (type == 1542)
  13. {
  14. MemoryStream MS = new MemoryStream(buffer);
  15. BinaryReader BR = new BinaryReader(MS);
  16.  
  17. BR.ReadUInt16();
  18. BR.ReadUInt16();
  19. Username = Program.Encoding.GetString(BR.ReadBytes(32));
  20. Username = Username.Replace("\0", "");
  21. BR.ReadBytes(36);
  22. byte[] PasswordArray = BR.ReadBytes(32);
  23. Password = Program.Encoding.GetString(PasswordArray);
  24. Password = Password.Replace("\0", "");
  25. BR.ReadBytes(32);
  26. Server = Program.Encoding.GetString(BR.ReadBytes(16));
  27. Server = Server.Replace("\0", "");
  28. Mac = Program.Encoding.GetString(BR.ReadBytes(12));
  29. BR.Close();
  30. MS.Close();
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement