mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +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
|
||||
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 {
|
||||
return super.loadClass(name);
|
||||
} catch (ClassNotFoundException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user