Skip to content

DIVERSIFY-project/maven-diversifier

Repository files navigation

This project contains some processors that use Spoon to diversify the source-code of Java projects.

Available processors

FantomProcessor

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.

InvertIfProcessor

This processor invert the if condition and the then and else blocks.

VariableDeclaration

This processor move variable declarations to the begin of block.

EncryptLiteralProcessor

This processor encrypt with AES all possibles Strings and primitives types in your source code.

Diversify a Maven project

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

TODO

  • add literal encrypt processor
  • add inlining method processor

About

A Maven plugin for automatic diversification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published