Zlib decompress >> Extract to a directory?

Discussion in 'Python' started by noname005, Feb 18, 2013.

  1. noname005

    noname005

    Joined:
    Feb 18, 2013
    Messages:
    1
    Likes Received:
    0
    Hello. I'm newbie in python.

    Here is a code, but this code allows to inject zlib compress file to memory. (I think so, if it isn't tell me please.)
    Booting etc. I don't know exactly what does this code?

    import imp
    s = ''
    if (imp.get_magic() != 'm\xf2\r\n'):
    raise RuntimeError, s
    try:
    import zlib
    except:
    raise RuntimeError, ''

    import marshal
    import sys
    import os
    for p in filter(os.path.exists, map(lambda p: os.path.join(p, 'ind.pyz'), sys.path)):
    f = open(p, 'rb')
    exec marshal.loads(zlib.decompress(f.read(905)))
    boot('ind', f, 63916)
    break

    Now, I want to import ind.pyz file to a directory.? I'm using python windows. 2.2 or 2.6.

    I'll very glad, if you could help me.
     
    noname005, Feb 18, 2013
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.