As you know, IDAPython is quite useful. And Triton concolic execution engine has python binding. Then… why not integrate them? I tried to stand on the shoulders of giants.
Roughly speaking, program slicing is a method to extract subset of program which is relevant to given statement. Here is an excerpt from M. Weiser. ICSE’81:
Starting from a subset of a program’s behavior, slicing reduces that program to a minimal form which still produces that behavior. The reduced program, called a “slice”, is an independent program guaranteed to faithfully represent the original program within the domain of the specified subset of behavior.
Kudos to Jonathan Salwan, we can easily apply backward program slicing to binary analysis process with minor modification of
proving_opaque_predicates.py. I wrote a simple, tiny glue between Triton and IDA Pro:
The snippet extracts subset of program which is relevant to branch condition. We can run this from
File -> Script file in IDA Pro menu.
Triton’s emulation iteration is compatible to IDAPython manner. Therefore, The combination of IDA Pro and Triton is pretty good.