diff --git a/G-WinMem/G-WinMem/G-WinMem.cpp b/G-WinMem/G-WinMem/G-WinMem.cpp index 52b1e10..d24761e 100644 Binary files a/G-WinMem/G-WinMem/G-WinMem.cpp and b/G-WinMem/G-WinMem/G-WinMem.cpp differ diff --git a/src/main/protocol/memory/habboclient/windows/WindowsHabboClient.java b/src/main/protocol/memory/habboclient/windows/WindowsHabboClient.java index 1c5ab16..969ca26 100644 --- a/src/main/protocol/memory/habboclient/windows/WindowsHabboClient.java +++ b/src/main/protocol/memory/habboclient/windows/WindowsHabboClient.java @@ -31,6 +31,10 @@ public class WindowsHabboClient extends HabboClient { private static final int PRODUCTIONID = 4000; private String production = ""; + private String getOffsetsCacheKey() { + return production + "-RC4Offsets"; + } + @Override public List getRC4cached() { List result = new ArrayList<>(); @@ -50,7 +54,7 @@ public class WindowsHabboClient extends HabboClient { private ArrayList readPossibleBytes(boolean useCache) throws IOException, URISyntaxException { ProcessBuilder pb = null; - List cachedOffsets = (List) Cacher.get("RC4Offsets"); + List cachedOffsets = (List) Cacher.get(getOffsetsCacheKey()); StringJoiner joiner = new StringJoiner(" "); if (useCache) { @@ -75,19 +79,24 @@ public class WindowsHabboClient extends HabboClient { String line; ArrayList possibleData = new ArrayList<>(); - cachedOffsets = new ArrayList<>(); + if (cachedOffsets == null) { + cachedOffsets = new ArrayList<>(); + } + int count = 0; while((line = reader.readLine()) != null) { if (line.length() > 1) { if (!useCache && (count++ % 2 == 0)) { - cachedOffsets.add(line); + if (!cachedOffsets.contains(line)) { + cachedOffsets.add(line); + } } else possibleData.add(line); } } - Cacher.put("RC4Offsets", cachedOffsets); + Cacher.put(getOffsetsCacheKey(), cachedOffsets); p.destroy(); return possibleData; }