17 lines
591 B
Java
17 lines
591 B
Java
package org.example;
|
|
|
|
import net.bytebuddy.agent.builder.AgentBuilder;
|
|
import net.bytebuddy.implementation.FixedValue;
|
|
import net.bytebuddy.matcher.ElementMatchers;
|
|
|
|
import java.lang.instrument.Instrumentation;
|
|
|
|
public class MasulsaAgent {
|
|
|
|
public static void premain(String agentArgs, Instrumentation inst) {
|
|
new AgentBuilder.Default()
|
|
.type(ElementMatchers.any())
|
|
.transform((builder, typeDescription, classLoader, javaModule) -> builder.method(ElementMatchers.named("pullOut")).intercept(FixedValue.value("Rabbit!!"))).installOn(inst);
|
|
}
|
|
}
|