bash selfextractor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir sfx | |
$ cd sfx | |
$ mkdir payload test | |
$ touch payload/{foo,bar} | |
$ zip -r payload.zip payload | |
adding: payload/ (stored 0%) | |
adding: payload/bar (stored 0%) | |
adding: payload/foo (stored 0%) | |
$ cat > extractor.sh | |
#!/bin/bash | |
exec unzip "$0" | |
#(press ctrl-d here) | |
$ cat extractor.sh payload.zip > test/selfextractor | |
$ cd test | |
$ chmod +x selfextractor | |
$ ./selfextractor | |
Archive: ./selfextractor | |
warning [./selfextractor]: 30 extra bytes at beginning or within zipfile | |
(attempting to process anyway) | |
creating: payload/ | |
extracting: payload/bar | |
extracting: payload/foo | |
$ find | |
. | |
./payload | |
./payload/bar | |
./payload/foo | |
./selfextractor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment