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

pyobfuscate generates incorrect source code #7

Open
astrand opened this issue Aug 24, 2012 · 0 comments
Open

pyobfuscate generates incorrect source code #7

astrand opened this issue Aug 24, 2012 · 0 comments

Comments

@astrand
Copy link
Owner

astrand commented Aug 24, 2012

From http://bugzilla.lysator.liu.se/show_bug.cgi?id=1606:

Here is the source code "setup.py":

from distutils.core import setup
import py2exe

setup(
# The first three parameters are not required, if at least a
# 'version' is given, then a versioninfo resource is built from
# them and added to the executables.
version = "0.1.01",
description = "py2exe sample script",
name = "py2exe samples",

# targets to build
windows = ['IntServerApp.py']
#windows = ["test_wx.py"],
#console = ["hello.py"],
)

When I run this through pyobfuscate it produces:

if 64 - 64: i11iIiiIii
if 65 - 65: O0 / iIii1I11I1II1 % OoooooooOO - i1IIi
from distutils . core import setup
import py2exe
if 73 - 73: II111iiii
setup (

As you can expect, this won't compile.

Thanks.

tyl12 pushed a commit to tyl12/pyobfuscate that referenced this issue Nov 29, 2013
…-line

comment.

For below codeing style:
-------------------------------
1.   '''
2.   xxx
3.   xxx
4.   '''
5.
6.   some def A
7.   some def B
-------------------------------
line astrand#1 will be multi-pending lines, line astrand#5 will be 'tokenize.NL',
and 'tokennize.NEWLINE' will occur at end of line astrand#6 (before line astrand#7).
so the origin code will obfuscate it to below wrong style.
-------------------------------
1.   some def A
2.   no_op_line
3.   no_op_line
4.   no_op_line
5.   no_op_line
7.   some def B
-------------------------------
it will cause error when handling decorator expression.

Signed-off-by: Teng Yiliang <yiliang.teng@intel.com>
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