Python Challenge level 19: “please!”

For level 19 I used two scripts.

Hint 1: there is an email in the source with an attached file

#!/usr/bin/env python
import email
mail=email.message_from_file(open('19.txt'))
for part in mail.walk():
    if part.get_content_maintype()=='audio':
        audio=part.get_payload(decode=1)
        open('19_indian.wav', 'wb').write(audio)

The only understandable thing in the file was the word “sorry”, and that page is not really useful. Theres more to the riddle than meets the ear.

Hint 2: the colors of the map seem to be inverted.

After trying reversing the info (utter jibberish), the hint is to be reinterpreted as “inverted India”, which I take as “inverted endian”. Nice longshot. And correct, for what it’s worth.

#!/usr/bin/env python
import array,wave
wi = wave.open('19_indian.wav','rb')
wo = wave.open('19_indian_inv.wav', 'wb')
wo.setparams(wi.getparams())
a = array.array('i')
a.fromstring(wi.readframes(wi.getnframes()))
a.byteswap()
wo.writeframes(a.tostring())
wi.close(),wo.close()

This part of the challenge was completely unexpected. I hadn’t even used the wave module untill today! And we get a nice file with these lyrics:

you are an idiot

And with a message from Leopold, we go to Level 20.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>