Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; 'cc:addr:python-list': 0.11; 'python': 0.11; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'lambda': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; "d'aprano": 0.31; 'steven': 0.31; 'run': 0.32; 'but': 0.35; 'charset:us-ascii': 0.36; 'explain': 0.39; "you're": 0.61; 'first': 0.61; 'transparent': 0.68; 'home!': 0.84; 'received:50.22': 0.84 Date: Mon, 2 Jun 2014 07:27:18 -0500 From: Tim Chase To: Steven D'Aprano Subject: Re: Obfuscated Python hack In-Reply-To: <538c69d5$0$29978$c3e8da3$5496439d@news.astraweb.com> References: <538c69d5$0$29978$c3e8da3$5496439d@news.astraweb.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401712081 news.xs4all.nl 2858 [2001:888:2000:d::a6]:37477 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72409 On 2014-06-02 12:11, Steven D'Aprano wrote: > Kids, don't try this at home! > > In Python 2.7, run this: > > exec((lambda *fs: reduce(lambda f, g: lambda x: f(g(x)), > fs))(*([lambda s: > s[1::2]+s[-2::-2]]*54))('motcye;cye._n8fo_drs(d4+)vle=5 ua.8) > (isedamr.ticspt spt rpi')) > > > Then run these: > > 10 - 6 == 10 - 5 > 4 + 1 == 7 - 1 > 2*2 == 10//2 > > A shiny penny for the first person to explain what's going on.[1] Stripping off the exec() call makes it pretty transparent that you're attempting (successfully on some platforms) to set the value of "4" to "5". But a cute hack. -tkc