abstract public class bug_21227 {
// Jam anything you want in here, it will be cast to a You_Have_Been_P0wned
public static void main(String argv[]) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
// Make a Class 'many_loader' under the default loader
// Some classes under a new Loader, LOADER2, including another version of 'many_loader'
// Set the victim, a String of length 6
String s = "victim";
_p0wnee = s;
// Go cast '_p0wnee' to type You_Have_Been_P0wned
// Make it clear that the runtime type many_loader (what we get from the
// array X2) varies from the static type of many_loader.
// Read the victims guts out
You_Have_Been_P0wned q = b._p0wnee;
// On 32-bit HotSpot Java6 this sets the victim String length shorter, then crashes the VM
//q._c = 3;
q._a = -1;
}
// I need to compile (hence call in a loop) a function which returns a value
// loaded from classloader other than the system one. The point of this
// call is to give me an abstract 'hook' into a function loaded with a
// foreign loader.
}