Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private String getPath()
- {
- Preferences userRoot = Preferences.userRoot();
- Preferences systemRoot = Preferences.systemRoot();
- Class clz = userRoot.getClass();
- try {
- Method openKey = clz.getDeclaredMethod("openKey", new Class[] { [B.class, Integer.TYPE, Integer.TYPE });
- openKey.setAccessible(true);
- Method closeKey = clz.getDeclaredMethod("closeKey", new Class[] { Integer.TYPE });
- closeKey.setAccessible(true);
- Method winRegQueryValue = clz.getDeclaredMethod("WindowsRegQueryValueEx", new Class[] { Integer.TYPE, [B.class });
- winRegQueryValue.setAccessible(true);
- Method winRegEnumValue = clz.getDeclaredMethod("WindowsRegEnumValue1", new Class[] { Integer.TYPE, Integer.TYPE, Integer.TYPE });
- winRegEnumValue.setAccessible(true);
- Method winRegQueryInfo = clz.getDeclaredMethod("WindowsRegQueryInfoKey1", new Class[] { Integer.TYPE });
- winRegQueryInfo.setAccessible(true);
- byte[] valb = null;
- String vals = null;
- String key = null;
- Integer handle = Integer.valueOf(-1);
- key = "SOFTWARE" + File.separatorChar + "Blizzard Entertainment" + File.separatorChar + "World of Warcraft" + File.separatorChar;
- handle = (Integer)openKey.invoke(systemRoot, new Object[] { toCstr(key), Integer.valueOf(131097), Integer.valueOf(131097) });
- valb = (byte[])(byte[])winRegQueryValue.invoke(systemRoot, new Object[] { handle, toCstr("InstallPath") });
- vals = valb != null ? new String(valb).trim() : "";
- closeKey.invoke(Preferences.systemRoot(), new Object[] { handle });
- return vals + "Wow.exe"; } catch (Exception e) {
- }
- return "";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement