javaagent combat (using javassist)


foreword

  • Introduction to javaagent:

javaagent is a JVMTI Agent called instrument that relies on the bottom layer of java. Simply put, javaagent is a "plug-in" for the JVM. javaagent is a parameter in the java run command to specify the agent.

The JavaAgent loaded at startup is a new feature introduced after JDK1.5. This feature provides users with the ability to use the corresponding byte stream to generate a Class object in the Java heap after the JVM reads the bytecode file into the memory. The user can modify its bytecode, so the JVM will also use the bytecode modified by the user to create Class objects.

  • Introduction to javassit:

Javaassist is a class library for processing Java bytecode. It can add new methods in a compiled class, or modify existing methods, and does not require in-depth knowledge of bytecode. At the same time, you can also generate a new class object in a completely manual way.

javaassist is a class library for processing Java bytecode.
javassist is also known as dynamic compilation

Guess you like

Origin blog.csdn.net/weixin_42551921/article/details/131324181