[LLVMdev] Obfuscation Transformations Clobbered by Unkown Optimizations

Matt Fredrikson mattfredrikson at gmail.com
Thu Dec 13 18:51:07 PST 2007


Excellent. Thanks, everyone, for the helpful advice.

-Matt

On Dec 13, 2007 8:01 PM, Chris Lattner <sabre at nondot.org> wrote:
> On Thu, 13 Dec 2007, Matt Fredrikson wrote:
> > After I run opt on an un-obfuscated bitcode file to produce an
> > obfuscated bitcode file, I verify that my transformations were placed
>
> ok
>
> > in the file using llvm-dis. At this point, the changes appear to have
> > been made. However, if I run the obfuscated bitcode file through llc
> > to produce x86 assembly, the obfuscations vanish. I manually disabled
>
> llc does a lot of transformations implicitly, including constant folding,
> as anton says.  There is no way to disable some of these, pieces of the
> code generator work under the assumption that it can generate "foldable"
> constants and that they will get folded.
>
> > all of the suspicious transformation passes run by llc, and nothing
> > changes. The same things happens if I run llvm-ld -native
> > -disable-opt.
> > Does anybody know what pass is clobbering my obfuscations?
>
> If you really want to guarantee that they won't go away, the best thing to
> do is to make an alloca (stack memory) and use volatile load/store
> instructions to access it.
>
>
> -Chris
>
> --
> http://nondot.org/sabre/
> http://llvm.org/
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list