From 46aee07bc13e2f92a8099bb8bcbcf71d729af4e0 Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Wed, 4 Apr 2018 16:51:20 +0200 Subject: [PATCH] remove things --- .gitignore | 3 ++ src/main/protocol/memory/FlashClient.java | 26 ------------ src/main/protocol/memory/Rc4Obtainer.java | 49 ++++++++++++----------- 3 files changed, 29 insertions(+), 49 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a520cf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.idea/ +out/ +G-Earth2.iml diff --git a/src/main/protocol/memory/FlashClient.java b/src/main/protocol/memory/FlashClient.java index 0276472..335a9f7 100644 --- a/src/main/protocol/memory/FlashClient.java +++ b/src/main/protocol/memory/FlashClient.java @@ -151,32 +151,6 @@ public class FlashClient { return result; } - @SuppressWarnings("Duplicates") - public void pauseProcess() { - String[] args = new String[] {"kill", "-STOP", PID+""}; - Process proc; - try { - proc = new ProcessBuilder(args).start(); - proc.waitFor(); - proc.destroy(); - } catch (IOException | InterruptedException e) { - e.printStackTrace(); - } - } - - @SuppressWarnings("Duplicates") - public void resumeProcess() { - String[] args = new String[] {"kill", "-CONT", PID+""}; - Process proc; - try { - proc = new ProcessBuilder(args).start(); - proc.waitFor(); - proc.destroy(); - } catch (IOException | InterruptedException e) { - e.printStackTrace(); - } - } - public static void main(String[] args) throws InterruptedException { FlashClient client = FlashClient.create(); client.refreshMemoryMaps(); diff --git a/src/main/protocol/memory/Rc4Obtainer.java b/src/main/protocol/memory/Rc4Obtainer.java index 5358119..6d84c89 100644 --- a/src/main/protocol/memory/Rc4Obtainer.java +++ b/src/main/protocol/memory/Rc4Obtainer.java @@ -56,10 +56,8 @@ public class Rc4Obtainer { // STEP ONE: filtering to obtain one area containing the rc4 data field int foundbuffersize = 0; while (foundbuffersize == 0) { - client.pauseProcess(); diff = client.createMemorySnippetList(); client.fetchMemory(diff); - client.resumeProcess(); this.addedBytes = 0; Random rand = new Random(); @@ -123,35 +121,45 @@ public class Rc4Obtainer { outgoingHandler.fakePongAlert(); sleep(70); - byte[] data1 = new byte[256]; - for (int i = 0; i < 256; i++) data1[i] = snippet1.getData()[i*4 + result_start_index]; - byte[] lastPongPacket = new byte[6]; List encodedbytelistraw = outgoingHandler.getEncryptedBuffer(); for (int i = 0; i < 6; i++) { lastPongPacket[i] = encodedbytelistraw.get(encodedbytelistraw.size() - 6 + i); } + int counter = 0; RC4 result = null; - //dont panic this runs extremely fast xo - outerloop: - for (int x = 0; x < 256; x++) { - for (int y = 0; y < 256; y++) { - byte[] copy = new byte[256]; - for (int i = 0; i < 256; i++) { - copy[i] = data1[i]; - } - RC4 rc4Tryout = new RC4(copy, x, y); + while (result == null && counter < 4) { - HPacket tryout = new HPacket(rc4Tryout.rc4(lastPongPacket)); - if (!tryout.isCorrupted()) { - result = rc4Tryout; - break outerloop; + byte[] data1 = new byte[256]; + for (int i = 0; i < 256; i++) data1[i] = snippet1.getData()[i*4 + result_start_index]; + + //dont panic this runs extremely fast xo + outerloop: + for (int x = 0; x < 256; x++) { + for (int y = 0; y < 256; y++) { + byte[] copy = new byte[256]; + for (int i = 0; i < 256; i++) { + copy[i] = data1[i]; + } + RC4 rc4Tryout = new RC4(copy, x, y); + + HPacket tryout = new HPacket(rc4Tryout.rc4(lastPongPacket)); + if (!tryout.isCorrupted()) { + result = rc4Tryout; + break outerloop; + } } } + if (result == null) { + result_start_index -= 4; + } + counter++; } + //if result = null ud better reload + // STEP FOUR: undo all sent packets in the rc4 stream @@ -180,15 +188,10 @@ public class Rc4Obtainer { } - - - private List searchForPossibleRC4Tables(List snippets) { List result; - client.pauseProcess(); result = client.differentiate2(snippets, ((addedBytes * 2) / 3), addedBytes * 2, 1028); addedBytes = 0; - client.resumeProcess(); return result; }