javassist icon indicating copy to clipboard operation
javassist copied to clipboard

Add "insertAfterLocalVariable" method on CtBehavior

Open Adahel opened this issue 1 year ago • 1 comments

The purpose of this method is to make changes to code where the line number or variable name is unknown or does not exist. I use it for some obfuscated code, but it doesn't work for all obfuscated code. For unobfuscated code it obviously works. The implementation is included with a test.

Adahel avatar Mar 30 '23 22:03 Adahel

Good Day, @chibash. I don't know if I was able to fully understand the example you showed me, I hope the test I wrote is enough.

For example,

void foo(int x) {
    int y;
    do {
       int z;
       bar(x, y, z);
    } while (expr);
       :
}

Thank you, Átila César.

Adahel avatar Mar 30 '23 22:03 Adahel