Obfuscating Python code

Daniel Wilcox dmw at yubasolutions.com
Wed Mar 16 02:40:57 EDT 2016


If you really want to learn about obfuscating python bytecode so it can't
be reverse engineered (easily) -- there are people who are doing it.
Search for 'pyasm' on github as a starting point.  tldr; yes people are
patching .pyc files. yes you can make them a nightmare to disassemble. and
yes it slows down your code.

=D

also yes, you can be tricked into running a patched .pyc file that has
nothing to do with your .py file, you have been warned.  be careful out
there.

On Tue, Mar 15, 2016 at 2:51 PM, Thomas 'PointedEars' Lahn <
PointedEars at web.de> wrote:

> Chris Angelico wrote:
>
> > On Wed, Mar 16, 2016 at 5:59 AM, Thomas 'PointedEars' Lahn
> > <PointedEars at web.de> wrote:
> >> That said, not distributing the source code of a program as well (or at
> >> least making it available to users in some way) strikes me as unpythonic
> >> since Python is at least Open Source software, and Python 2.0.1, 2.1.1
> >> and newer are GPL-compatible Free Software.
> >
> > gcc is also free software. Does that mean that all C programs should
> > be free software? No.
>
> IMNSHO, yes.  At the very least because in using gcc you benefited from the
> free software community, so you should give back to the free software
> community accordingly.
>
> > However, since all software can be reverse-compiled (particularly
>
> You mean _decompiled_.
>
> > byte-code like .pyc files),
>
> Yes, it is easier with bytecode *if you know the VM*.
>
> > the only truly reliable way to make completely closed software is to
> > restrict access to it in all forms.
>
> ACK.
>
> > In today's world, that usually means providing it as a web service.
>
> ACK.  That’s why RMS calls it SaaSS, Service as a Software Substitute :)
>
> > Otherwise, you have to assume that anyone can see your source. The
> > only difference between open-source and closed-source is the license,
> > not the ability to see stuff.
>
> If that were the case and reverse engineering were an easy task that
> everyone could do, we would have a lot more free software variants of
> proprietary software.  Particularly, we would have a lot less proprietary
> device drivers.  ISTM that you do not know what you are talking about here.
>
> --
> PointedEars
>
> Twitter: @PointedEars2
> Please do not cc me. / Bitte keine Kopien per E-Mail.
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list