I am trying to find out if it is possible to get the bytecode of a function after it was loaded to the JVM.
I know I can get the code from the .class
file using ClassLoder and I can manipulate it using Instrumentation, but this is not the issue here.
Suppose I have a compiled Java program called Test.class
and I run, its bytecode will be loaded the JVM, from this point can I get the bytecode?
EDIT: Following the answers I want to point again, my intention is to inspect code which is running on the JVM but I dont have access to its compiled file.