the real .pyc file

Bengt Richter bokr at oz.net
Wed Nov 27 14:04:51 EST 2002


On Wed, 27 Nov 2002 00:21:26 -0500, Peter Hansen <peter at engcorp.com> wrote:

>Gustavo Niemeyer wrote:
>> 
>> Yes, I was bored.. ;-)
>> 
>> int
>> a=1//1;main=lambda:1
>> +1;
>> #define a
>> int
>> main()
>> {a//a:a};import sys;printf=sys.stdout.write
>> printf("Hello world!\n");a//a;{
>> }
>
>Nice! :-)  I think I can safely say this is the first truly
>obfuscated Python code that I've seen.  The funny thing is
 ^^^^^^^^^^^^^^^^^^^^^^[1] 
>that the obfuscation primarily hides the fact that it even
>*is* Python, because you can "of course" tell what it does
>just by looking at it (if you know C).
>
>I had to run it to be sure it would even execute as Python.  
>(Using a syntax highlighting editor sure helps readability 
>though, versus reading it in plain ASCII in Netscape.)
>

[1] It's also obfuscated C ;-)

[11:03] C:\pywk\junk>type candpy.py
int
a=1//1;main=lambda:1
+1;
#define a
int
main()
{a//a:a};import sys;printf=sys.stdout.write
printf("Hello world!\n");a//a;{
}

[11:04] C:\pywk\junk>candpy.py
Hello world!

==[1]========================================
[11:04] C:\pywk\junk>cl /nologo /Tc candpy.py
candpy.py

[11:04] C:\pywk\junk>candpy.exe
Hello world!

Regards,
Bengt Richter



More information about the Python-list mailing list