Spade is a toolkit for facilitating the analysis and modification of compiled Java applications. It can process entire applications including library code to provide extra contextual information to the analyses. The idea is to create a high level, stackless intermediate representation of the Java bytecode language which can then be analysed and transformed in a much easier and more predictable way. A lot of the ideas in this project are heavily influenced from earlier work done in Maple-IR and the creation of Spade can be almost fully attributed to various pain-points we identified in maple-ir as it grew and became more unmaintainable.
Contrasting directly with maple-ir for a moment, Spade provides the following benefits:
- Extensive unit testing of core components, aiming towards 100% coverage, including a graph algorithm invariant framework
- Pipeline transformation framework for facilitating higher order component composition
- Dependency injection integration(via Guice) and containerisation
- Immutable CodeUnit's with predictable hashCode/equals
- User-focused OO design including code visitors and reducers/folding
- No edge cases for users to consider when implementing transformers
- and much more (coming soon)!
- Bytecode to SSA IR generator
- SSA IR to bytecode backtranslater (using Boissinot et al. style destructor)
- Text based language for IR
- Dataflow analysis framework using Soufflé