radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.67k stars 3k forks source link

Consider to use more formal and modern intermediate representation #13984

Open XVilka opened 5 years ago

XVilka commented 5 years ago

To be able to use something like Falcon RE IL (based in turn on RREIL and Binary Ninja's IL): https://github.com/falconre/falcon Or even grab some ideas from MLIR: https://github.com/tensorflow/mlir/blob/master/g3doc/LangRef.md

My proposal is to define two forms of it:

It should support also:

See also Radeco's IL: https://github.com/radareorg/radeco-lib/blob/master/src/middle/ir.rs + https://github.com/radareorg/radeco-lib/tree/master/src/middle/ir_reader

https://github.com/radare/radare2/issues/11421 https://github.com/radare/radare2/issues/4799 https://github.com/radare/radare2/issues/7437 https://github.com/radare/radare2/issues/6093 https://github.com/radare/radare2/issues/4327

It is even possible to make an intermediate ESIL->R2IL (this hypothetical new IL) as a temporary solution, and move uplifters (architectures) to the new infrastructure one by one.

XVilka commented 5 years ago

Good example on how good IR/IL boosts decompiler and extension development https://twitter.com/josh_watson/status/1127364618429452288?s=19