Open radare opened 5 years ago
Common Sunexpression Elimination, Constant Folding and other optimizations that require propagations are not easy or simple in the current r2dec design: there are too many corner cases that may be taken into account [e.g. instructions that affect registers implicitly, like DIV or MUL]. We are working on this in "core2" branch - stay tuned ;)
It is implemented already in radeco though...
On Thu, Mar 21, 2019, 9:59 PM Eli notifications@github.com wrote:
Common Sunexpression Elimination https://en.wikipedia.org/wiki/Common_subexpression_elimination, Constand Folding https://en.wikipedia.org/wiki/Constant_folding and other optimizations that require propagations are not easy or simple in the current r2dec design: there are too many corner cases that may be taken into account [e.g. instructions that affect registers implicitly, like DIV or MUL]. We are working on this in "core2" branch - stay tuned ;)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wargio/r2dec-js/issues/146#issuecomment-475239473, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMZ_YtCNKiVUKqPFTT6PHVN48JgsK2sks5vY5BSgaJpZM4bleRc .
i wrote a js file that parses the output of r2dec and performs the following substituions. we can use that as inspiration to improve the r2dec core.
I have initially though on that as a regex parser that takes the following:
into
And also we can support nested operations like this:
into:
ideally this can be evaluated because all the elements are constants