mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-03-18 15:14:10 +01:00
Bridge the classloaders using self-reference
This commit is contained in:
parent
0a71bcd5ea
commit
dba2cb9263
@ -50,6 +50,12 @@ public class JarFileClassLoader extends ClassLoader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class loadClass(String name) throws ClassNotFoundException {
|
public Class loadClass(String name) throws ClassNotFoundException {
|
||||||
|
// The dynamic loading requires knowledge of this classloader, but
|
||||||
|
// the default classloader doesn't know about it; so we bridge that
|
||||||
|
// gap by returning our own class when requested.
|
||||||
|
if (name.equals(getClass().getName())) {
|
||||||
|
return getClass();
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
return super.loadClass(name);
|
return super.loadClass(name);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user