Closed analtevs closed 3 years ago
Would really appreciate if you could just PR this.
However YOU NEED 1 POP2
for popping LONG from the stack instead of 2 POP
. A POP
may not remove parts of a LONG from the stack. This will cause verify errors and likely the deobfuscator method execution simulation will throw an error as well.
The struggle with the single pop2 op was an unbalanced stack (at least in testing this was the case) in some cases. I think there were instances where pop2 was removing too much in situations where the final value was smaller than long.
Will try to recover that situation and post the offending byte code. but fwiw I did need to force two single pops .vs the "either or" behavior of pop2.
For the opcodes LSHL, LSHR and LUSHR the second operand (in the code named bottom), actually on top of the stack is not a long, but an int. So you need POP POP2 for LSHL, LSHR and LUSHR and for the other long opcodes you need POP2 POP2
I'll edit code and write some test cases for this. will submit pr afterwards. :-)
This has been added in the latest release.
Needed support for
longs
in the ConstantFolder transformer (com.javadeobfuscator.deobfuscator.transformers.general.peephole)This is my suggestion as it worked for me..
this example wasn't handled correctly by the existing code:
example code supporting the long variant(s):