0

When I have a class like this:

public class Test {
  public String injectVariable;

  void test()   {
    String name = "code";
  }
}

How can I use ASM to inject code to the test method and get the local variable name?

public class Test {
  public String injectVariable;

  void test()   {
    String name = "code";
    this.injectVariable = name;
  }
}
kriegaex
  • 63,017
  • 15
  • 111
  • 202
DSM
  • 1
  • 2
    Is this Java? If it is then it should be tagged with [java-bytecode-asm] instead of [assembly]. – Thomas Jager Aug 21 '20 at 14:50
  • 2
    Welcome to SO. Please give your own questions some more love in the future and note that the English alphabet also comes with upper-case letters. I fixed code formatting, indentation, syntax highlighting, grammar, spelling and punctuation for you. No offence meant, but please make sure to take care of it by yourself next time. Enjoy StackOverflow and thanks for the interesting question. :-) As for your question, would you please update it by the ASM code you used and explain what the problem was? It would be good to see what you tried so far. – kriegaex Aug 23 '20 at 02:28

0 Answers0