I am working with this awesome little piece of code, and I need some help figuring it out.
Basically it has a big byte array, which is used to load a new class:
Class class = class1.loadClass(name, byteArray);
class.getMethod("run", new Class[0]).invoke(null, new Object[0]);
This is loadClass:
public Class<?> loadClass(String paramString, byte[] paramArrayOfByte) throws ClassNotFoundException
return defineClass(paramString, paramArrayOfByte, 0, paramArrayOfByte.length);
And then it calls the 'run' in this class. Now, besides this being an awesome way to hide your classes, how do I get a look into this class? I have the actual class in 'class', but I don't get further than the attributes and their values and the function names. I want to know what 'run' actually does. Is there any way to somehow print the content of this method or whatever? Or maybe I can transform the byte array containing the class in something readable?
Thanks!
What if you write this byteArray in a .class file and open it with a Java Decompiler tool (like jd-gui) ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With