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

Not working #1

Closed
mithuncoder opened this issue May 2, 2022 · 1 comment
Closed

Not working #1

mithuncoder opened this issue May 2, 2022 · 1 comment

Comments

@mithuncoder
Copy link

Output will be same as input script..Its not obfuscate input script.Please add a option of input method to obfuscate script instead argparse.

@sternmull
Copy link
Owner

It should work. But for now all it does is renaming variables, functions, classes, parameters and attributes that can be assumed to be "private" to the module (where all usages are known and are renamed as well):

a.py

def _add(a, _b): # use a leading underscore to mark names that are "private" and should be renamed
    tmp = a # locals don't need an underscore, they are always renamed
    return tmp + _b

def _multiply(x, y,/): # use posonly-parameters to allow renaming
    return x * y

def main(): # no leading underscore, so it will not be renamed
    print(_add(11, 22))
    print(_multiply(23, 42))

if __name__ == '__main__':
    main()

python pyfuscator.py a.py -o b.py

b.py

def _a1(a, _p1):
    _v1 = a
    return _v1 + _p1

def _a2(_v2, _v3, /):
    return _v2 * _v3

def main():
    print(_a1(11, 22))
    print(_a2(23, 42))
if __name__ == '__main__':
    main()

But please be aware that you are quite early. I pushed this code in a prototyping state just to show/discuss it. That's the reason there is no license and no documentation. It is not yet ready for production use! I plan to polish it and document its usage and limitations within the next days. Of course you are welcome if you want to play around with it in its current state. Any feedback is welcome!

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