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.
Related
i work on image copy move forgery detection field. i downloaded GRIP dataset form https://www.grip.unina.it/, there is some modification needed for the images and can be done with perl functions downloaded with the dataset. it is the first time for me to work with .pl functions. i downloaded the program form this website https://platform.activestate.com/create-project?language=perl, and followed the setup steps.
now i have two problems: the first one, when i tried to run the function this error appeared "Can't open perl script "all_gen_cmf_image": No such file or directory", i have added the scripts directory using cd.
the second problem i don't know what he mean with this line "update the "vole" variable in the configuration file db_configs.pl, it should point to your vole binary of CMFD framework." in reedme file.
can any one helping me solving this problem?
Perl doesn't automatically try the .pl extension when you pass it the name of a script on the command line.[1] So, it fails because there isn't a script named "all_gen_cmf_image"; it's actually named "all_gen_cmf_image.pl". To run all_gen_cmf_image.pl you have to include the .pl part of the extension. Assuming you are in the scripts folder, the following should work:
perl all_gen_cmf_image.pl
or in the parent directory:
perl scripts/all_gen_cmf_image.pl
However, when Perl runs a use Module; statement, perl automatically adds .pm on the end and replaces any :: in the module name with a slash.
Hi this question seems to be answered but answers don't resolve my problem.
I try to include lua script into executable by copying it into exe
copy -b a.exe+test.lua output.exe
but when i launch output.exe luaL_dofile() cannot find lua script.
I dont want to use any third party apps to achieve this.
Copying files seems to work because Love2D projects works and I copy files in the same way but i treats them as zip archive (for sake of file hierarchy).
You can append a Lua script to your .exe but you'll need some way to load it into your program. The main problem is how to find the Lua script at the end of the .exe. srlua appends a small signature that contains the size of the Lua script so that the program can read the script at the right offset in the .exe file. Fortunately, the Lua API provides a function to load scripts from arbitrary sources. The convenience function luaL_dofile uses that function. You can use the same technique in your own program.
Compressing a folder into a .zip file is a common way to treat a folder as file, for example, uploading a folder. Is there a faster way to "pack" the contents of a folder into a file (without taking the time to compress)?
You should use a tarfile. In unix or mac, its the tar command. On Windows there is a tool called 7-zip.
You can see more details here.
I have a .bin file that will comprise of 3 files
1. tar.gz file
2. .zip file
3. install.sh file
For now the install.sh file is empty. I am trying to write a shell script that should be able to extract the .zip file and copy the tar.gz file to a specific location when the *.bin file is executed on an Ubuntu machine. There is a Jenkins job that will pull in these 3 files to create the *.bin file
My Question is how do I access the tar.gz and .zip file from my shell script ?
There are two general tricks that I'm aware of for this sort of thing.
The first is to use a file format that will ignore invalid data and find the correct file contents automatically (I believe zip is one such format/tool).
When this is the case you just run the tool on the packed/concatenated file and let the tool do its job.
For formats and tools where that doesn't work and/or isn't possible the general trick is to embed markers in the concatenated file such that the original script ignores the data but can operate on itself to "extract" the embedded data so the other tool can operate on the extracted contents.
I have zip file containing my installation files. I'm extracting this zip and copying these files into installation directory with the script shown below:
ZipDLL::extractall "$OUTDIR\demo.zip" "C:\myapp\demo\"
if I remove zip file from $OUTDIR than installer is not able to find zip file as expected. What I want to do is embedding this zip or its extracted folders into exe itself. I added
File -r "$OUTDIR/demo"
but this script didn't worked as well.
When you use the ZipDll plugin, you are referring to the file you want to process (demo.zip) by using its place at run time: along the installer.exe.
When you use the File statement to embed some files into the produced installer, you need to refer to the files by using their place at compile time.
Replace the $OUTDIR in the File statement by the path relative to the .nsi script.
BTW, you should take the habit to check at the compilation log, NSIS probably tells you about that kind of problem when paths are incorrect at compile-time.