open-obfuscator / o-mvll

:electron: O-MVLL is a LLVM-based obfuscator for native code (Android & iOS)
https://obfuscator.re/omvll
Apache License 2.0
631 stars 68 forks source link

usage of omvll.StringEncOptStack() causes application crash #62

Closed akoreiko closed 1 month ago

akoreiko commented 1 month ago

Hi, I'm trying the release version 1.1.0 from https://github.com/open-obfuscator/o-mvll/releases/download/1.1.0/omvll_ndk_r26d.tar.gz

Enabling "stack string obfuscation" via omvll.StringEncOptStack() causes application crash. If I use omvll.StringEncOptGlobal() instead, everything works fine.

Romain told me that it might be caused by the latest changes in the code. Could you please take a look at it?

antoniofrighetto commented 1 month ago

Please make sure that this conforms with what you're trying to do. As from the documentation, when StringEncOptStack is enabled, the decoded string lives in a stack-allocated buffer. This implies that the lifetime of the buffer is tied to the lifetime of the function where the string is used. We plan to upstream an option which decodes strings on-the-fly and doesn't use neither stack-allocated buffers nor global constructors some time soon.