Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (buffer.readableBytes() > 2) {
- buffer.readByte();
- int size = buffer.readByte() & 0xff;
- if (size == buffer.readableBytes()) {
- //feeble attempts at RSA below
- /* byte[] encryptionBytes = new byte[size];
- buffer.readBytes(encryptionBytes);*/
- /* ChannelBuffer rsaBuffer = ChannelBuffers.copiedBuffer(new BigInteger(encryptionBytes)
- .modPow(RSA_EXPONENT, RSA_MODULUS).toByteArray());*/
- int version = buffer.readInt();
- if (version == 414) {
- boolean isLowMemory = (buffer.readByte() & 0xFF) == 1;
- /*for(int i = 0; i < 24; i++) {
- buffer.readByte();
- }
- for(int i = 0; i < 16; i++) {
- buffer.readInt();
- }
- int reportedSize = buffer.readByte() & 0xff;
- if(reportedSize != 10) {
- buffer.readByte();
- }
- for (int i = 0; i < 4; i++) {
- buffer.readInt();
- }*/
- for(int i = 0; i < 12; i++) {
- buffer.readInt();
- }
- int reportedSize = buffer.readByte();
- if(reportedSize != 10) {
- buffer.readByte();
- }
- int uid = buffer.readInt();
- for (int i = 0; i < 4; i++) {
- buffer.readInt();
- }
- long name = buffer.readLong();
- String username = Utils.longToPlayerName(name), password = Utils.getRS2String(buffer);
- logger.info("Username: "+username+", password: "+password);
- System.out.println("Before");
- Login.loginRequest(channel, username, name, password, isLowMemory);
- System.out.println("After");
- }
- } else {
- channel.write((ByteBuffer)ByteBuffer.allocate(1).put((byte) 22).flip());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement