mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-07-04 23:15:33 +02:00
parallel threaded search for RC4 key speed-up
This commit is contained in:
parent
dbea4608e1
commit
809b68869a
|
@ -155,13 +155,17 @@ public class LinuxHabboClient implements HabboClient {
|
||||||
|
|
||||||
private List<LinuxMemorySnippet> createMemorySnippetListForRC4() {
|
private List<LinuxMemorySnippet> createMemorySnippetListForRC4() {
|
||||||
|
|
||||||
int offset = 4;
|
Object lock = new Object();
|
||||||
|
|
||||||
refreshMemoryMaps();
|
refreshMemoryMaps();
|
||||||
String memoryPath = "/proc/" + PID + "/mem";
|
String memoryPath = "/proc/" + PID + "/mem";
|
||||||
|
|
||||||
|
int[] count = {0};
|
||||||
|
|
||||||
List<LinuxMemorySnippet> result = new ArrayList<>();
|
List<LinuxMemorySnippet> result = new ArrayList<>();
|
||||||
for (long[] map : maps) {
|
for (long[] map : maps) {
|
||||||
|
new Thread(() -> {
|
||||||
|
int offset = 4;
|
||||||
long start = map[0];
|
long start = map[0];
|
||||||
long end = map[1];
|
long end = map[1];
|
||||||
|
|
||||||
|
@ -229,7 +233,22 @@ public class LinuxHabboClient implements HabboClient {
|
||||||
if (matchStart != -1) {
|
if (matchStart != -1) {
|
||||||
result.add(new LinuxMemorySnippet(start + matchStart, new byte[matchEnd - matchStart + 4]));
|
result.add(new LinuxMemorySnippet(start + matchStart, new byte[matchEnd - matchStart + 4]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized (lock) {
|
||||||
|
count[0] ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
while (count[0] < maps.size()) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user