redtophank has asked for the wisdom of the Perl Monks concerning the following question:

I have an exe that I created a few months back with Perl2Exe from a perl script. Unfortunately I lost the perl script, and I can't bare the thought of re-scripting the entire thing. Please help! Is there any way to decompile/extract the original perl script from the exe?

Replies are listed 'Best First'.
Re: Perl2Exe Decompile?
by planetscape (Chancellor) on Apr 11, 2007 at 07:19 UTC

    It looks as though Limbic~Region has already done much of the legwork I was about to do, and has assembled his results in this thread, which I now list here in hopes that some of the ideas therein might prove helpful.

    Alternatively, Super Searching for all the reasons why Hiding your Script is nearly impossible with interpreted languages such as Perl, might also give you some ideas on how to undo what has been done by Perl2Exe.

    The good news is, once you've written a program, even though much time has elapsed since then and now, the re-write is usually substantially improved.

    Good luck.

    HTH,

    planetscape
Re: Perl2Exe Decompile?
by f00li5h (Chaplain) on Apr 11, 2007 at 04:31 UTC

    Surely the perl script is in your CVS repository, and you can just check out another copy

    ... and if not, it must be on a backup tape somewhere

    @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;
Re: Perl2Exe Decompile?
by TOD (Friar) on Apr 11, 2007 at 06:28 UTC
    if you can recall how you constructed your script once you maybe better re-write it. on the other hand, if you find a tool which disassembles your exe to assembler code the B::Deparse module should be helpful. you won't get commented code, however, but it will be readable at least.
Re: Perl2Exe Decompile?
by nega (Scribe) on Apr 11, 2007 at 19:29 UTC
    Unfortunately what you want to do is entirely dependent on the version of perl2exe, by both version number and platform. Once upon a time, perl2exe basically packaged your script and a perl interpreter and dumped it all to a temporary directory. Then, you could just find that temporary directory and you'd have your script. It's not quite that simple anymore.

    Recode it. You'll be better off, and you'll find a newer/better/faster way to do what your old script did.

Re: Perl2Exe Decompile?
by Anonymous Monk on Apr 11, 2007 at 06:21 UTC
    Suspicious ... search