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

imported local lib, prevent obfuscation #28

Open
fgarit opened this issue Feb 26, 2018 · 0 comments
Open

imported local lib, prevent obfuscation #28

fgarit opened this issue Feb 26, 2018 · 0 comments

Comments

@fgarit
Copy link

fgarit commented Feb 26, 2018

Hi, I am very interested in this tool, however, some of its behavior is unexpected to me, likely because I don't fully understand how it works.

I have the following structure:

  • mylib.py
  • opy.py
  • opy_config.txt
  • test.py

test.py:

from mylib import myFct

for obj in myFct():
	if obj.prop == "val":
		print("success")

mylib.py:

class Thing():
    def __init__(self):
        self.prop = "val"


def myFct():
    return [Thing()]

opy_config:

obfuscate_strings = True
obfuscated_name_tail = '_opy_'
plain_marker = '_opy_'
pep8_comments = True 

source_extensions = '''
py
pyx
'''

skip_extensions = '''
pyc
'''

skip_path_fragments = '''
opy.py
'''

external_modules = '''
mylib
'''

plain_files = '''
opy_config.txt
'''

plain_names = '''
opy
test
'''

The problem is that is still goes and modifies my mylib.py file (eg self.prop turned into self.l1ll_opy_):

# coding: UTF-8
import sys
l11l_opy_ = sys.l1l_opy_ [0] == 2
l11l1_opy_ = 2048
l1llll_opy_ = 7
def l1l11_opy_ (l111l_opy_):
    global l11ll_opy_
    l11_opy_ = ord (l111l_opy_ [-1])
    ll_opy_ = l111l_opy_ [:-1]
    l1l1_opy_ = l11_opy_ % len (ll_opy_)
    l1ll1_opy_ = ll_opy_ [:l1l1_opy_] + ll_opy_ [l1l1_opy_:]
    if l11l_opy_:
        l1111_opy_ = l1_opy_ () .join ([l111_opy_ (ord (l1l1l_opy_) - l11l1_opy_ - (l1lll_opy_ + l11_opy_) % l1llll_opy_) for l1lll_opy_, l1l1l_opy_ in enumerate (l1ll1_opy_)])
    else:
        l1111_opy_ = str () .join ([chr (ord (l1l1l_opy_) - l11l1_opy_ - (l1lll_opy_ + l11_opy_) % l1llll_opy_) for l1lll_opy_, l1l1l_opy_ in enumerate (l1ll1_opy_)])
    return eval (l1111_opy_)
class Thing():
    def __init__(self):
        self.l1ll_opy_ = l1l11_opy_ (u"ࠨࡶࡢ࡮ࠥࠂ")
def myFct():
	return [Thing()]

Is this the intended behavior?
Thanks for the help.

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