[Discuss] Looking for a BSD licensed compressor/decompressor
like UPX
pw
p.willis at telus.net
Tue May 23 21:09:18 PDT 2006
David Wu wrote:
> Hi guys,
>
> Can anyone give me some suggestion on what are good BSD licensed
> compressor/decompressor programs. The requirement is that it should be
> able
> to compress ELF format files. Thanx all!
>
> David Wu
> _______________________________________________
> Discuss mailing list
> Discuss at vlug.org
> http://ladybug.vlug.org/cgi-bin/mailman/listinfo/discuss
>
Hello,
how about the following?
#!/bin/bash
#$1 is the input file
#USAGE scriptname <FILE_TO_COMPRESS>
#create the compressed binary
bzip2 -c $1 >temp.dat
SIZE=`find temp.dat -printf "%s"`
#create the combined shell script and binary
echo -e "#!/bin/bash\nUNCOMPRESSED=$1\nSIZE=$SIZE\ntail -c $SIZE $1.bin\
> temp.bz2\n bunzip2 -c temp.bz2 > new_hello\nchmod +x\
new_hello\nexit\n" > temp.txt
cat temp.txt temp.dat > $1.bin
chmod +x $1.bin
rm temp.* -f
More information about the Discuss
mailing list