New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-bcf crashes when compiling ndk project #78
Comments
I see the same issue using bogus control flow option. |
This is specifically an issue with llvm / android-ndk when compiling with thumb mode. You'll either need to disable thumb compilation (annoying) or patch the llvm to not generate this type of instructions; it's not actually an obfuscator-llvm issue. Potentially try upgrading your ndk as well, though I'm doubtful that will fix this issue. If I have extra time later I can try to find the patch I needed to create for llvm to specifically work around this issue. |
met the same problem |
I set LOCAL_ARM_MODE := arm in Android.mk and it has no effect |
met the same problem with -mllvm -bcf |
maybe the version missmatch. when using android-ndk-r13b and latest code of obfuscator-llvm, it occurred this when downgrade obfuscator-llvm version to the highlight version, it work! PS: i don't know why the latest obfuscator-llvm source from github not contain the commit and the log in the screen shot, what happen in these 2 year... |
do you have va_start in your code? |
I met the same problem, and va_start is used in my codes. |
Quick Solution: disable bcf on functions using va_start Long Answer: using when a bcf obfuscation applied to a function with va_start, it will break the stack management lifecycle, stack allocation and recovery would be not balanced in the machine code, but in fact, the unbalanced code should never be executed at runtime as it's in a bogus block.
the code is trying to grow up the stack in the middle of a function, it is not broken for llvm. llvm assembler can process such code elegantly, but NDK use GNU assembler by default (you can see the argument -fno-integrated-as in the verbosed cmdline), which does not support such behavior. so the build failed. notice that it only happens in the armv7 arch. it's probably a compatibility issue of GNU assembler. |
Hey guys, any updates in this case? |
armv5 arch
armv5 arch still has the same problem. |
If we can tell the NDK to use the llvm-as, it should be fine. |
Addition, if we compile our code in debug mode or with |
when i add obfuscator-ollvm into android-ndk-r14d and set -bcf
Android.mdk:
crash info
The text was updated successfully, but these errors were encountered: