vimasig / Bozar

Java bytecode obfuscator with GUI
MIT License
152 stars 19 forks source link

Heavy flow obfuscation results in invalid bytecode #22

Open Storyyeller opened 1 year ago

Storyyeller commented 1 year ago

Describe the bug When I try to obfuscate using heavy flow obfuscation, the result is invalid bytecode which fails bytecode verification when I try to run it. It does work if I use "light" flow obfuscation instead.

To Reproduce Run bozar on attached Primes.jar with heavy flow obfuscation. This zip has the input jar I used, as well as the broken output jar. bug.zip

Expected behavior it works

Bozar version 1.7.0 (latest)

Additional context

Error: Unable to initialize main class Primes
Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    Primes.<init>([I[III)V @629: pop2
  Reason:
    Type top (current frame, stack[1]) is not assignable to category1 type
  Current Frame:
    bci: @629
    flags: { flagThisUninit }
    locals: { uninitializedThis, '[I', '[I', integer, integer, top, top, top, top, 'java/lang/invoke/MethodType' }
    stack: { uninitializedThis, top, integer }