[LLVMdev] Obfuscation Transformations Clobbered by Unkown Optimizations

Matt Fredrikson mfredrik at cs.wisc.edu
Thu Dec 13 00:22:49 PST 2007

Hello all,

I am implementing some simple obfuscation transformations in LLVM. One
of the obfuscations involves searching for particular constants, and
"unrolling" them throughout a procedure using arithmetic. In effect,
certain constants are broken up into smaller constants and recombined
as needed using the appropriate operators. I perform this on
intermediate LLVM instructions.

After I run opt on an un-obfuscated bitcode file to produce an
obfuscated bitcode file, I verify that my transformations were placed
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
all of the suspicious transformation passes run by llc, and nothing
changes. The same things happens if I run llvm-ld -native

Does anybody know what pass is clobbering my obfuscations?


Matt Fredrikson

More information about the llvm-dev mailing list