MCPcopy Create free account
hub / github.com/GraxCode/zelixkiller / get

Method get

src/me/lpk/analysis/Sandbox.java:368–389  ·  view source on GitHub ↗
(String name, byte[] bytes)

Source from the content-addressed store, hash-verified

366 }
367
368 public Class<?> get(String name, byte[] bytes) {
369 if (loaded.containsKey(name))
370 throw new RuntimeException();
371 try {
372 Method define = ClassLoader.class.getDeclaredMethod("defineClass0", String.class, byte[].class, int.class,
373 int.class, ProtectionDomain.class);
374 define.setAccessible(true);
375 Class<?> c = (Class<?>) define.invoke(this, name, bytes, 0, bytes.length, null);
376 resolveClass(c);
377 return c;
378 } catch (Exception e) {
379 e.printStackTrace();
380 }
381 try {
382 Class<?> c = defineClass(name, bytes, 0, bytes.length);
383 resolveClass(c);
384 return c;
385 } catch (Throwable t) {
386 t.printStackTrace();
387 return null;
388 }
389 }
390
391 @Override
392 public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {

Callers 8

createProxyMethod · 0.95
loadClassMethod · 0.95
executeMethod · 0.45
analyzeMethod · 0.45
findSubroutineMethod · 0.45
mergeMethod · 0.45
getIsolatedReturnMethod · 0.45
loadMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected