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

Obfuscation changes __name__ variable name #14

Open
joaopfg opened this issue Jun 6, 2022 · 1 comment
Open

Obfuscation changes __name__ variable name #14

joaopfg opened this issue Jun 6, 2022 · 1 comment

Comments

@joaopfg
Copy link

joaopfg commented Jun 6, 2022

I am trying to obfuscate a very simple file like the following:

from file1 import f1
from file2 import f2

if __name__ == "__main__":
    f1()
    f2()
    print("f3")

The __name__ variable name is converted to a garbage string and it avoids the program to run. Any idea where is the bug ? I can try a PR.

@billythegoat356
Copy link

It seems to me that the vars are renamed with a regex, so you would have to fully change how the script works.
Renaming vars with a regex results in a lot of bugs, you should try tokenize or ast.

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

2 participants