Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Decompile Perl2EXE back to original source

by flyingmoose (Priest)
on Mar 29, 2004 at 21:43 UTC ( [id://340765]=note: print w/replies, xml ) Need Help??


in reply to Decompile Perl2EXE back to original source

I just googled on this topic out of curiosity, and I didn't find anything. Perl2Exe, being rather proprietary, isn't going to be documented in terms of how it works...of course, it IS possible (can you read decompiled assembler?) but it's not going to be fun, and I don't think you are guaranteed to get the original source back exactly as you want it. You'd have better luck if it was made by PAR, but even then, I'm not sure it would result in readable code.

What diotalevi says above is correct...but that's assuming you can get Perl source out of it. If that source is somehow encoded in something non-trivial (i.e. not ROT13 or BASE64 or something like that), you may have a hard time getting something to feed to the DeParser. Start by trying to extract the strings from the executable (look at a hexeditor to see if they are there, or try 'strings') -- hopefully you will see something that looks like Perl code, but probably not.

Replies are listed 'Best First'.
Re: Re: Decompile Perl2EXE back to original source
by diotalevi (Canon) on Mar 29, 2004 at 22:06 UTC
    I didn't assume the person could access the source anywhere. If the original poster can do the equivalent of -MO=Deparse or -MO=Deobfuscate then perl can read itself out of memory from the opcodes.
      Ok, I did not realize it was storing opcodes and not perl. Interesting.

      Anyway, this is still assuming the opcodes are there as opcodes...it could (well it could do anything) store them encoded in some format as a weak attempt at obfuscation. I don't think you can run -MO=Deparse directly on a PAR executable either (or can you?).

        You further misunderstand. That is how perl itself and those modules work. Whether perl2exe includes source or a serialized form of the optree is unknown to me. I'd guess it stores source though since that's at least doable.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-19 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found