osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Obfuscated Python hack


On Tue, Jun 3, 2014 at 1:47 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> On Mon, Jun 2, 2014 at 9:38 AM, Steven D'Aprano
> <steve+comp.lang.python at pearwood.info> wrote:
>> On Mon, 02 Jun 2014 23:23:53 +1000, Chris Angelico wrote:
>>
>>> On Mon, Jun 2, 2014 at 10:27 PM, Tim Chase
>>> <python.list at tim.thechases.com> wrote:
>>>> 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.
>>>
>>> And not on Windows inside IDLE, where attempting to use 4 results in a
>>> ===== RESTART ===== crash.
>>
>> Sounds like a bug in IDLE.
>>
>> What happens if you try it in Windows without IDLE, just using the
>> standard interactive interpreter?
>
> Actually, probably a 32/64-bit issue.  The code as supplied caused a
> segfault on my 64-bit Linux install.  I had to change the offset to 16
> to see it work.

My test was a 32-bit Python 2.7.4, for what it's worth.

ChrisA