Opy icon indicating copy to clipboard operation
Opy copied to clipboard

imported local lib, prevent obfuscation

Open fgarit opened this issue 7 years ago • 0 comments

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.

fgarit avatar Feb 26 '18 14:02 fgarit