Skip to content

Instantly share code, notes, and snippets.

@JKetelaar
Created June 16, 2016 18:14
Show Gist options
  • Save JKetelaar/c2008eaec8a19d149fdb39367de0dca0 to your computer and use it in GitHub Desktop.
Save JKetelaar/c2008eaec8a19d149fdb39367de0dca0 to your computer and use it in GitHub Desktop.
Managing the OSRune loader and cracking their insane method to secure downloading their actual client
import com.osrune.Loader;
import com.osrune.b;
import com.osrune.c;
import com.osrune.f;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Hashtable;
import java.util.Map;
/**
* @author JKetelaar
*/
public class Test {
public static void main(String[] args) {
new Loader();
b.load();
Thread t = new Thread() {
@Override
public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Method[] methods = b.class.getMethods();
for (Method method : methods) {
if (method.getName().equals("a")) {
if (method.getReturnType().toString().equals("class com.osrune.b")) {
Object[] args = new Object[]{0};
try {
b localb = (b) method.invoke(null, args);
Method[] method1 = localb.getClass().getMethods();
for (Method method2 : method1) {
if (method2.getReturnType().toString().equals("class com.osrune.c")) {
c s = (c) method2.invoke(localb, args);
s.b();
Object[] args2 = new Object[]{1};
method2.invoke(localb, args2);
}
}
for (Field fa : f.class.getDeclaredFields()) {
if (fa.getName().equals("a") && fa.getType().toString().equals("class com.osrune.f")) {
fa.setAccessible(true);
f faa = (f) fa.get(null);
Field[] fields1 = faa.getClass().getDeclaredFields();
for (Field field : fields1) {
field.setAccessible(true);
if (field.getType().toString().equals("class java.util.Hashtable")) {
Hashtable hashtable = (Hashtable) field.get(faa);
for (Object o : hashtable.entrySet()) {
Map.Entry<String, byte[]> map = (Map.Entry<String, byte[]>) o;
String[] folders = map.getKey().split("\\.");
FileOutputStream fos = new FileOutputStream("test/client/" + folders[1] + ".class");
fos.write(map.getValue());
fos.close();
}
}
}
}
}
} catch (IllegalAccessException | InvocationTargetException | IOException e) {
e.printStackTrace();
}
}
}
}
}
};
t.start();
}
}
@JKetelaar
Copy link
Author

Make sure to add the loader as library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment