A Java-based tool designed to extract bytecode from running JVM processes using the Java Attach API and Instrumentation.
It attaches to a target JVM process at runtime, injects a Java agent via agentmain, and uses a ClassFileTransformer to intercept and capture the bytecode of all loaded classes. The collected .class files are then packaged into a JAR archive and saved to disk. All activities are logged to both the console and a log file.
Key Components:
It attaches to a target JVM process at runtime, injects a Java agent via agentmain, and uses a ClassFileTransformer to intercept and capture the bytecode of all loaded classes. The collected .class files are then packaged into a JAR archive and saved to disk. All activities are logged to both the console and a log file.
Key Components:
- RemoteBytecodeExtractor – The entry point that lists running JVMs, prompts for selection, and loads the agent.
- BytecodeAgent – The agent responsible for driving class retransformation.
- BytecodeCollector – The transformer that captures raw bytecode and writes it into the JAR file.
- LogUtils – Provides thread-safe logging to the console and files.