Extracting bytecode out of frozen programs

Discussion in 'Python' started by David Kraeutmann, Feb 8, 2009.

  1. Hello,
    I need to extract the modules/packages out of a frozen script. It was
    compiled using Python 2.2.3 and the standard freeze.py.
    I managed to get a shell after execution using PYTHONINSPECT=y and find
    the start of a module/package using a hex editor (I got the sta, but
    these modules don't seem to be importable.
    Is there a way of extracting them so they are importable in a python shell?

    Regards,
    David Kraeutmann
    David Kraeutmann, Feb 8, 2009
    #1
    1. Advertising

  2. > Is there a way of extracting them so they are importable in a python shell?

    Try imp.get_frozen_object.

    Regards,
    Martin
    Martin v. Löwis, Feb 8, 2009
    #2
    1. Advertising

  3. En Sun, 08 Feb 2009 19:19:12 -0200, Martin v. Löwis <>
    escribió:

    >> Is there a way of extracting them so they are importable in a python
    >> shell?

    >
    > Try imp.get_frozen_object.


    Ouch... this looks better than using ctypes.
    get_frozen_object exists at least since 1.5.2, but has never been
    documented, and the source code says it's obsolete. Should be documented
    now? Any alternative?

    --
    Gabriel Genellina
    Gabriel Genellina, Feb 8, 2009
    #3
  4. > get_frozen_object exists at least since 1.5.2, but has never been
    > documented, and the source code says it's obsolete. Should be documented
    > now? Any alternative?


    get_frozen_object has been marked obsolete in 1997. Whether it can be
    un-deprecated should be discussed on python-dev; I can't guess the
    rationale for deprecating it.

    Regards,
    Martin
    Martin v. Löwis, Feb 8, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    12
    Views:
    1,602
    Dave Thompson
    Jan 10, 2005
  2. Coca
    Replies:
    7
    Views:
    715
    Aidan Grey
    Aug 24, 2004
  3. Replies:
    18
    Views:
    593
    Dave Thompson
    Jan 10, 2005
  4. est
    Replies:
    1
    Views:
    531
  5. LC Geldenhuys
    Replies:
    5
    Views:
    243
    Robert Klemme
    Feb 18, 2004
Loading...

Share This Page