Tools for refactoring/obfuscation

J

Javier

I am looking for an automated tool for refactoring/obfuscation.
Something that changes names of functions, variables, or which would
merge all the functions of various modules in a single module.
The closest I have seen is http://bicyclerepair.sourceforge.net/

Does somebody know of something that can work from the command line or
simple data structures/text files?, like a python dictionary of functions
{"old":"new",...}
 
V

Vladimir Ignatov

Hi,

(sorry for replying to the old topic)

I am looking for an automated tool for refactoring/obfuscation.
Something that changes names of functions, variables, or which would
merge all the functions of various modules in a single module.
The closest I have seen is http://bicyclerepair.sourceforge.net/

Does somebody know of something that can work from the command line or
simple data structures/text files?, like a python dictionary of functions
{"old":"new",...}

I am not surprised what nobody answers. I think that such tool is
nearly impossible given the dynamic Python's nature.
But if you put little discipline/restrictions in your source code,
when doing obfuscation could be much more easier. Almost trivial I
would say.

Javier, you can contact me directly if you are interested in this topic.

Vladimir Ignatov
kmisoft at gmail com
 
S

Stefan Behnel

Javier, 07.03.2012 04:29:
I am looking for an automated tool for refactoring/obfuscation.

Sadly, there really is one thing that these two have in common: they modify
code while retaining its exact functionality. Apart from that, they are
diametric opposites. Refactoring aims at making the code "better" in some
way, e.g. by making it more readable or easier to extend. Obfuscation aims
for making it worse, as in unreadable and hard to access. It's generally
not a good idea to do that. Code is there for humans to read.

Stefan
 
J

Javier

Yes, in general I follow clear guidelines for writing code. I just use
modules with functions in the same directory and clear use of name
spaces. I almost never use classes. I wonder if you use some tool for
refactoring. I am mainly intersted in scripting tools, no eclipse-style
guis.

Just let me know if you use some scripting tool.

And, as somebody pointed in this thread obfuscating or refactoring the
code are very different things but they can be done with the same tools.

Javier
 
L

Lie Ryan

Yes, in general I follow clear guidelines for writing code. I just use
modules with functions in the same directory and clear use of name
spaces. I almost never use classes. I wonder if you use some tool for
refactoring. I am mainly intersted in scripting tools, no eclipse-style
guis.

Just let me know if you use some scripting tool.

And, as somebody pointed in this thread obfuscating or refactoring the
code are very different things but they can be done with the same tools.

<troll>if you're not using classes, your code is obfuscated already</troll>

Anyway, I think it's better if you describe why you want such a tool. If
you want to keep your code a secret, just distribute the .pyc file. If
you want to refactor your code to improve readability, there is rope.
 
J

Javier

Well, a .pyc file would be a too blatant obfuscation, and people at my
job would get angry. I need something more subtle. So I need a
refactoring tool, preferably with which I can do scripting. These is
what I found up to now in the CheeseShop:

http://pypi.python.org/pypi/bicyclerepair/0.7.1
http://pypi.python.org/pypi/rope/0.9.3

I need to check how to do scripting with them. There seems to be no
manual for them.

This code also looks interesting, but in its present state it is for
blatant obfuscation, although it could be changed to do some refactoring:

http://pypi.python.org/pypi/pyfuscate/0.1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top