From f7f59c28e4ca1b8915c379410a7e3926d6ce0fc2 Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Tue, 22 Jan 2019 17:35:47 +0100 Subject: [PATCH] and that --- .../gearth/protocol/memory/Rc4Obtainer.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/G-Earth/src/main/java/gearth/protocol/memory/Rc4Obtainer.java b/G-Earth/src/main/java/gearth/protocol/memory/Rc4Obtainer.java index b1a3c8b..b74d227 100644 --- a/G-Earth/src/main/java/gearth/protocol/memory/Rc4Obtainer.java +++ b/G-Earth/src/main/java/gearth/protocol/memory/Rc4Obtainer.java @@ -57,17 +57,18 @@ public class Rc4Obtainer { if (DEBUG) System.out.println("[+] send encrypted"); - List cached = client.getRC4cached(); - boolean worked = onSendFirstEncryptedMessage(handler, cached); - - if (!worked) { - worked = onSendFirstEncryptedMessage(handler, client.getRC4possibilities()); - if (!worked) { - System.err.println("COULD NOT FIND RC4 TABLE"); - } + boolean worked = false; + int i = 0; + while (!worked && i < 4) { + worked = (i % 2 == 0) ? + onSendFirstEncryptedMessage(handler, client.getRC4cached()) : + onSendFirstEncryptedMessage(handler, client.getRC4possibilities()); + i++; } - + if (!worked) { + System.err.println("COULD NOT FIND RC4 TABLE"); + } incomingHandler.unblock(); outgoingHandler.unblock();