This project contains some processors that use Spoon to diversify the source-code of Java projects.
This processor add randomly some "Fantom" method and invocations. The fantom method do nothing, it just add some garbage to increase the difficulty to reverse-engineer the application.
This processor invert the if condition and the then and else blocks.
This processor move variable declarations to the begin of block.
This processor encrypt with AES all possibles Strings and primitives types in your source code.
To process a Java-Maven project with the processor, you can add the following snippet to the pom.xml file:
<profiles>
<profile>
<id>diversify</id>
<build>
<plugins>
<plugin>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-maven-plugin</artifactId>
<version>3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<processors>
<processor>${processor}</processor>
</processors>
<compliance>8</compliance>
</configuration>
<dependencies>
<dependency>
<groupId>fr.inria.diversify</groupId>
<artifactId>SpoonProcessors</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>fr.inria.gforge.spoon</groupId>
<artifactId>spoon-core</artifactId>
<version>4.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
You can compile a diversified version by enabling the diversify profile:
mvn install -Pdiversify
- add literal encrypt processor
- add inlining method processor