Skip to content
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

[Bug] Mishandling of scope #42

Open
Semnodime opened this issue May 22, 2023 · 1 comment
Open

[Bug] Mishandling of scope #42

Semnodime opened this issue May 22, 2023 · 1 comment

Comments

@Semnodime
Copy link

In the following example, the declaration of bar via const bar = function(){…} is not incorporated in the deobfuscation result of function body foo:

function foo() {
    const bar = function () {
        for (;;){
            return 0;
        }
    };

    const x = bar();
    return x
}

function bar() {
    return 42;
}

deobfuscation should result in foo returning 0 either directly or indirectly instead.

@Semnodime
Copy link
Author

Weirdly enough, it works when the complexity of the refered-to bar function is reduced to a plain return 0 without the for-loop wrapper:

function foo() {
    const bar = function () {
        return 0;
    };

    const x = bar();
    return x
}

function bar() {
    return 42;
}

correctly results in

function foo() {
  const x = 0;
  return x;
}

@Semnodime Semnodime changed the title [bug] Mishandling of scope [Bug] Mishandling of scope May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant