public
Created

  • Download Gist
puzzle.py
Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
#!/usr/bin/env python
# Needs php and java in executable path
B64="""
UEsDBBQAAAAIAIVyUjx/yWgsbQIAAP0CAAAHABwAcHJvYmxlbVVUCQADeTB9S3ow
fUt1eAsAAQToAwAABOgDAAAdUsmumlAA3fcrGtNFX1zABblgXm2jOACXSRBEY9Jc
5knmSb6+vi7OkJyzO+fXnx8T6W4WrB3LbiuOBxXMfNRNW8Wn9NipMa4QbVv8MQVL
05STYRfqADEysKpWFm/3mViqu5EtXlzGPVl6zauMly7vUNt3S9ji1LESwdn63jCN
DZkNHrzCc78lb8/mucZtFFM45ckrs1XnmtOYo34WENfnXkzC9vQ6s3sJEpCifalp
BtvFDjI50bJunpHhegTuhAKuKsh49uGhN9tXPJpkNxknpCaHjgoxivp4MNg4YQSG
V+K8IXs3KvSzK2IcaJOxvWny89ztEn66vIpYcNpw1jnkr7CplWUCGGNneZ0Y3mdK
du/0Ss2S8Zqve2ZQWWQcIsDMh/spoPTCEujcunKTWHZ9JZryK6YlAqi7Z+4noaHM
+SC2KyYws6Vk3gqt4FuqESqyfQ6jSjfkIO0yXJgXr6zUI0L6+CKOcmjZvkFyrmxd
92QoKQ0WHcmRqgiKJ7+I6J0xK8d70ALbNBQh8LMlPLlBefMRVfOVkupsao181s+X
alqrQprbp3QH0CuTxEminYhUtGLm8htNsEVWaVvbzxrTTGTuAqlSEbsXQiMdjSCh
SxWaNYe6hknmS6ND+6g01+aoFnZ/qaURCYTRQBEf9vEp9UmrIxTb7bnzMOFzaFE1
cagV4M+WbexrQrDLPf/eqjROlTqeNYFVbwpYLvV+HTgdbcxavlan9ZhtFp/vb3qb
hYsfE0sHcPXXf0yQeYAV/dbQfxvmfyfYLKIHYKkHYMA7Cd6Ab3i4Cxaf34MB5z+/
Wl/kfZH78fHx+ef3t39QSwECHgMUAAAACACFclI8f8loLG0CAAD9AgAABwAYAAAA
AAABAAAApIEAAAAAcHJvYmxlbVVUBQADeTB9S3V4CwABBOgDAAAE6AMAAFBLBQYA
AAAAAQABAE0AAACuAgAAAAA=
"""
from StringIO import StringIO as S
from base64 import b64decode as B
from binascii import unhexlify as U
from subprocess import Popen as P
from subprocess import PIPE as PI
from zipfile import ZipFile as Z
_=1;l=list;_O=open;C=chr;J=''.join;_G=getattr;ID=lambda _:_;
T=lambda *a: J(map(C, a));_S=lambda s:s.strip;_R=lambda _:_.replace
_C=lambda p: _G(p, T(99,111,109,109,117,110,105,99,97,116,101))
F=lambda f,m:_O(f,m);O=lambda f:F(f,T(*(114,98)));I=lambda _,__:__();
W=lambda f:F(f,T(*(119,98))).write;R=lambda f:f.read();
RP=lambda f:f.read(T(*(112,114,111,98,108,101,109)));
X=lambda a:P(*((a, 0)+(None, PI, PI)));XP=X(T(*(112,104,112)))
PC=lambda t:RP(Z(S(B(R(O(t))))));SP=lambda _:_.split()
XJ=lambda:X(l((T(106,97,118,97),T(77,97,105,110))));ZZ=lambda v:v[0]
N1=lambda _: J(SP(_R(_S(_)())(T(*(48,120)),'')));N2=lambda _:J(SP(_))
CS=lambda:T(77,97,105,110,46,99,108,97,115,115);o=ID;p=lambda _:_S(_)()
d=lambda _:ZZ(_C(XP)(PC2(_)));e=lambda _:U(N2(U(N1(_))));
n=lambda _: I(W(CS())(_),XJ);w=lambda _:ZZ(_C(_)());
PC2=lambda b:RP(Z(S(B(R(S(b)))))); _puzzle_=B64
if __name__ == '__main__':
print p(o(w(n(e(d(_puzzle_))))))

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.