Extending MetaRenamer in llvm 3.2 to support obfuscation of Spir 1.2 iR

Michael Eiler via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 30 13:06:52 PDT 2017


Hi everyone,

I'm using the clang branch from https://github.com/KhronosGroup/SPIR
to create SPIR1.2 binaries.

When doing so I soon realized that SPIR1.2 keeps all variable and type
names which makes reverse engineering easier than it should be.
Therefore I expanded the metarenamer in llvm 3.2 (which is used by the
clang version mentioned above) to ignore SPIR kernel functions and
also update the SPIR metadata. With these changes the metarenamer
plugin for opt can be used to further obfuscate SPIR1.2 binaries.

I also added a test case as part of the patch.

Let me know what you think about this change and whether it is
possible to include it in upstream llvm. Since this is my first time
contributing to llvm I also have no idea whether the code fulfills
your coding conventions or other requirements. Just drop me a line
whether some adjustments are needed.

Thanks in advance!

Best Regards
Michael

(In case attachments do not work on this mailing list:
https://paste.ubuntu.com/24488198/ )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm32_metarenamer_spir12obfuscation.patch
Type: text/x-patch
Size: 10006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170430/c2ec4ebd/attachment.bin>


More information about the llvm-commits mailing list