-
Notifications
You must be signed in to change notification settings - Fork 66
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
Stack underflow using obfuscate_constants #39
Comments
Thanks @matbrik for the report. We will look into this and come back to you as soon as possible. |
We should not break the correctness of the program, even when the compiler may be able to remove infinite loops with no side-effects. As constants get reconstructed with a stack-allocated variable, do not conceal loop-variant constants when possibly in presence of infinite loops; this otherwise could lead to stack-overflow issues. Fixes: open-obfuscator#39.
We should not break the correctness of the program, even when the compiler may be able to remove infinite loops with no side-effects. As constants get reconstructed with a stack-allocated variable, do not conceal loop-variant constants when possibly in presence of infinite loops; this otherwise could lead to stack-overflow issues. Fixes: open-obfuscator#39.
@matbrik, thanks for reporting, and please bear with us for coming back just now. I fixed the issue since we clearly cannot segfault when the original program did not, although be aware of how optimizers can pick their own choice in presence of UB in infinite loops in C++ (see: https://godbolt.org/z/1jv99es8P, llvm/llvm-project#60622). |
@antoniofrighetto thanks for the fix, it effectively solves the problem in the case of while(1) but it segfaults in the same way if there is a for loop with a lot of iterations Should I open a new issue or reopen this one? |
@matbrik, unfortunately this is a bit of expected by design, as this is how the pass works. I think we could try preventing opaque within loops, but you would likely have the same issue with recursive functions. Feel free to open a new issue, I'll think about what we can do here. |
Target: iOS arm64e
OMVLL Version: 1.1.0-b5f1bee / 14.0.0git ( (c41f13252ed4b49f246729b4d91ff521d5a6bf9d))
Compilation of O-MVLL: CI
I've noticed that the stack grows until reaching the maximum size using obfuscate_constants on a function while in a loop:
if I try this function:
and the following config.py
"""
class MyConfig(omvll.ObfuscationConfig):
def init(self):
super().init()
"""
sp grows(decreases) by 0x20 for every iteration in the loop crashing the program
The text was updated successfully, but these errors were encountered: