mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-26 18:30:52 +01: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() {
|
||||
|
||||
int offset = 4;
|
||||
Object lock = new Object();
|
||||
|
||||
refreshMemoryMaps();
|
||||
String memoryPath = "/proc/" + PID + "/mem";
|
||||
|
||||
int[] count = {0};
|
||||
|
||||
List<LinuxMemorySnippet> result = new ArrayList<>();
|
||||
for (long[] map : maps) {
|
||||
new Thread(() -> {
|
||||
int offset = 4;
|
||||
long start = map[0];
|
||||
long end = map[1];
|
||||
|
||||
@ -229,7 +233,22 @@ public class LinuxHabboClient implements HabboClient {
|
||||
if (matchStart != -1) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user