This project is divided into three simple programs:
- A simple app to simulate something like an ATM.
- A Java agent that uses Javassist to make low-level changes (bytecode) at runtime.
- An injector that uses the Attach API to attach the agent to the JVM.
Instrumentation in Java is not as simple as it sounds, even using Javassist.
If you are going to use instrumentation in a more complex project, I recommend using ASM
and understanding the Java Virtual Machine Instruction Set.
superblaubeere27 for lighting the Attach API.