Advertisement
Guest User

Untitled

a guest
Sep 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. if (buffer.readableBytes() > 2) {
  2. buffer.readByte();
  3. int size = buffer.readByte() & 0xff;
  4. if (size == buffer.readableBytes()) {
  5. //feeble attempts at RSA below
  6. /* byte[] encryptionBytes = new byte[size];
  7. buffer.readBytes(encryptionBytes);*/
  8. /* ChannelBuffer rsaBuffer = ChannelBuffers.copiedBuffer(new BigInteger(encryptionBytes)
  9. .modPow(RSA_EXPONENT, RSA_MODULUS).toByteArray());*/
  10. int version = buffer.readInt();
  11. if (version == 414) {
  12. boolean isLowMemory = (buffer.readByte() & 0xFF) == 1;
  13. /*for(int i = 0; i < 24; i++) {
  14. buffer.readByte();
  15. }
  16. for(int i = 0; i < 16; i++) {
  17. buffer.readInt();
  18. }
  19. int reportedSize = buffer.readByte() & 0xff;
  20. if(reportedSize != 10) {
  21. buffer.readByte();
  22. }
  23. for (int i = 0; i < 4; i++) {
  24. buffer.readInt();
  25. }*/
  26. for(int i = 0; i < 12; i++) {
  27. buffer.readInt();
  28. }
  29.  
  30. int reportedSize = buffer.readByte();
  31. if(reportedSize != 10) {
  32. buffer.readByte();
  33. }
  34. int uid = buffer.readInt();
  35. for (int i = 0; i < 4; i++) {
  36. buffer.readInt();
  37. }
  38. long name = buffer.readLong();
  39. String username = Utils.longToPlayerName(name), password = Utils.getRS2String(buffer);
  40. logger.info("Username: "+username+", password: "+password);
  41. System.out.println("Before");
  42. Login.loginRequest(channel, username, name, password, isLowMemory);
  43. System.out.println("After");
  44. }
  45. } else {
  46. channel.write((ByteBuffer)ByteBuffer.allocate(1).put((byte) 22).flip());
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement