No replies
1 Post

Pinned topic Modifying bytecodes at runtime

‏2012-03-18T22:27:05Z |
We are working on a project related to Java Bytecode Instrumentation (BCI). We would like to modify at runtime the execution path of java program due to conditonal statements in the program.

Thus our bytecode modifications will be limited to those corresponding to conditional statements (if_icmpne, if_icmpgt etc) and the modifications will be simple like if_icmpne would be changed to if_icmpeq (i.e conditonal bytecodes would be changed to their negated ones). Which conditional bytecodes (and when - for ex: the conditional statement might be present within a loop and we might want to change it only during nth iteration of the loop) to be changed can be assumed to come from a file.

Load time modification can be achieved through Jvmti, ASM or BCEL

Are you guys aware of any tool which can help to achieve the same at runtime ? Or would it require changing java virtual machine to achieve this.