skidfuscatordev / skidfuscator-java-obfuscator

Public proof-of-concept obfuscator using the MapleIR framework designed by cts & bibl
MIT License
579 stars 59 forks source link

Program behavior changed after running obfuscator #47

Closed uf0wxxel closed 10 months ago

uf0wxxel commented 1 year ago

Hi, thanks for the great project! I have encountered an issue when trying obfuscation with this obfuscator on some specific code.

One minimal example is:

import java.util.List;

public class Main {
    private static final List<Integer> list = List.of(1, 2, 3);

    public static void main(String[] args) {
        Integer i = null;
        for (Integer j : list) {
            if (j == 0) {
                i = j;
                break;
            }
        }
        System.out.println(i);
    }
}

The original program prints null. After obfuscation, the program prints 3 instead.

The problem should be in the syntax parsing and transforming part because it still happens when I turn off all obfuscation options.

Sample jar's for the code above, compiled by OpenJDK 17: sample.zip

terminalsin commented 1 year ago

Thank you for reporting! Must be due to our IR framework. Will add this as a test case and figure out the source of the issue.