HikariObfuscator / Hikari

LLVM Obfuscator
1.93k stars 549 forks source link

Mark obfuscated functions are no-opt accordingly #16

Closed Naville closed 6 years ago

Naville commented 6 years ago

Currently globally we rely on the user is not naive enough to pass -O3 so the aggressive DCE won't kick in. This can be fixed by adding attributes to the functions we are obfuscating instead. Similar to what we did in lib/Transforms/Obfuscation/AntiDebugging.cpp

xiangzhai commented 6 years ago

ScaffCC use -Xclang -disable-O0-optnone -S -emit-llvm, then use opt -PASS and opt -load ScaffCC-Library -PASS separately.

Naville commented 6 years ago

True. However Xcode and similar IDEs don't provide options like this without explicitly introducing loads of scripts. So it's probably best we make it seamlessly

xiangzhai commented 6 years ago

Is Xcode open source? hack Xcode :)

Naville commented 6 years ago

Nope. Further than that even the llvm used in Xcode is not open-source, unless you consider source from almost two years ago open

Naville commented 6 years ago

Seems like various backends still takes opt-level and ignore function attribute in some cases. Let's not attempt to fix issues raised by idiotic programmers

xiangzhai commented 6 years ago

I experienced that http://lists.llvm.org/pipermail/llvm-dev/2017-October/118419.html