[cfe-dev] RE : AST Transformation

John McCall rjmccall at apple.com
Thu Mar 31 00:43:25 PDT 2011


On Mar 31, 2011, at 12:24 AM, Ruch Grégory wrote:
> Thank you for you reply
> 
> I want to make AST transformation. My goal is to change the program control flow. One example is controle flow flattening. http://www.inf.u-szeged.hu/~akiss/pub/pdf/laszlo_obfuscating_journal.pdf. But there are many other techniques.
> I think that if I can directly build an executable from the modified AST it's interesting. And rebuild the source code also interest me. I want to make harder the reverse engineering.
> 
> someone else is he convinced by the idea or not ?
> 
> But the question is more technical about Clang. Can we just implement AST transformation plugin and let the normal execution of Clang to build the executable ? I've read that pretty-print do not garantee to get reparsable code, therefore I throught that it will be better to build directly the executable.

If you don't particularly care about getting source code back, I would suggest doing this as a transformation on LLVM IR rather than on Clang's ASTs.

John.



More information about the cfe-dev mailing list