magiclantern

This is work in progress and I don't have any formal background in this area, so don't believe all the stuff from here :)

Resources

SymPy

Symbolic math in Python. Will be very useful for data flow analysis.

metasm

A nice framework, but not for ARM. They have some interesting presentations and papers:

Misc

TODO: read them :)

Useful functions

See utils.py

Notations

Techniques

In theory, there is no difference between theory and practice. But, in practice, there is. [1]

Code flow analysis (code paths)

Look at conditional jumps and generate a list of possible code paths.

A path is a unique sequence of branches from the function entry to the exit [2]. Any module with a succession of n decisions in it can have up to 2^n paths within it [3].

Symbolic emulation of a code path

Since we don't (always) know the initial condititions, ARM emulators are not very helpful (at least not for me). Symbolic emulation assumes there are some unknowns there, and here SymPy shows it's mighty power :D

Backtracing

This is useful for guessing argument values in function calls. Much better than the old method, but also much slower.


Results