Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Perl Decompile

by tachyon (Chancellor)
on Sep 21, 2004 at 01:29 UTC ( #392544=note: print w/replies, xml ) Need Help??


in reply to Perl Decompile

In all probability it will have been made into a exe with either Indigo Star's Perl2exe or ActiveState's PerlApp. Contrary to what Aristotle said the original source code is not stored internally in verbatim form. It is encoded. Some monks cracked PerlApp in public at A real challenge and then AS changed the encoding. So the encoding algorithms have changed over time, and thus the decode depends not only on which program was used but also which version. There are similar published decrypts on Perl2exe if you Google for them.

Of the free perl tools PAR does store the code verbatim but is unlikely to have been used based on timing and motivations. The B:: compiler backends basically don't work for anything past trivia so are very unlikely to have been used either.

It is almost certainly possible to retrieve the original source code. It is also almost certainly not worth the time and effort.

cheers

tachyon

Replies are listed 'Best First'.
Re^2: Perl Decompile
by Aristotle (Chancellor) on Sep 21, 2004 at 04:46 UTC

    the original source code is not stored internally in verbatim form. It is encoded.

    That is why I said “more or less”. :-) My point was that the actual Perl source is stored in the binary, whether it is encoded or not, while the internal representation differs greatly with B::C/B::CC.

    Makeshifts last the longest.

      Pray, tell me Aristotle why would a compiled binary save the source text (encoded or not)? It seems to me that it would just eat up space, unless they use the source text as input to an embedded Perl-system. But that would be cheating wouldn't it?

      CountZero

      "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

        That's what they do. The source is decrypted on the fly and fed to an embedded perl interpreter.
        Why? Well, this is Perl we're talking about, where apparently we want to parse anything we please, anytime we please. Using your source at runtime may bring to mind evil Obfuscated Perl contest entries, but it's sometimes very useful, and is in fact how modules like Pod::Usage work.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://392544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2021-12-02 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (20 votes). Check out past polls.

    Notices?