I'm trying to get a Perl script (.pl) out of an executable (.exe) file. The .exe file was originally coded in Perl but the .pl file was not kept. Is there a quick way to do this? I'm using Strawberry Perl for windows.

Thanks

有帮助吗?

解决方案

Rename .exe to .zip and check if files can be extracted

其他提示

From the PAR FAQ:

How do I extract my script out of packed executable?

In other words, "I did a `pp foo.pl' and I lost foo.pl, how do I get it back?".

The answer is to just use unzip/winzip/winrar/whatever to decompress the executable, treating it like a normal Zip file. You may need to rename the executable into a .zip extension first.

pp relies on PAR to create the executable. PAR relies on Archive::Zip, so at some level the file contains zipped copies of the perl scripts used to create the executable.

Typically, these programs attach a loader to the front of a zip archive which unzips the files to a temporary directory and invokes the script indicated as the program's entry point.

I'd try two things:

  • root around in all the typical Temp directories (\Users\Username\AppData\Local\Temp for instance) for a directory containing your script and it's prerequsites.

  • try to uncompress the exe as a zip, possibly removing the loader from the start of he program first, using a byte editor.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top