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

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.
Similar Threads
  1. umberto
    Replies:
    4
    Views:
    813
    umberto
    Oct 24, 2003
  2. Andrei Kouznetsov

    decompress Huffmann with java.util.zip?

    Andrei Kouznetsov, Dec 29, 2004, in forum: Java
    Replies:
    5
    Views:
    905
    ByteCoder
    Dec 29, 2004
  3. enrio@online.no

    zlib.decompress cannot, gunzip can

    enrio@online.no, Mar 1, 2005, in forum: Python
    Replies:
    2
    Views:
    1,547
    enrio@online.no
    Mar 1, 2005
  4. shabda raaj
    Replies:
    1
    Views:
    3,149
    Diez B. Roggisch
    Sep 10, 2007
  5. Matthew Brett
    Replies:
    4
    Views:
    1,619
    Matthew Brett
    May 9, 2010
  6. Steve Edlefsen

    can't decompress data; zlib not available

    Steve Edlefsen, Nov 13, 2011, in forum: Python
    Replies:
    0
    Views:
    922
    Steve Edlefsen
    Nov 13, 2011
  7. Daniel Berger
    Replies:
    5
    Views:
    578
    Roger Pack
    Jun 21, 2009
  8. Nicholas Wieland

    Most simple usage of zlib or pr-zlib

    Nicholas Wieland, Mar 9, 2011, in forum: Ruby
    Replies:
    4
    Views:
    682
    Jeremy Bopp
    Mar 10, 2011
Loading...