wok view dev86/stuff/com2exe @ rev 14376
move from undigest python-apsw, python-llfuse, python-py, python-pycryptopp, python-pyliblzma, python-pytest, python-unittest2, s3ql
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Apr 22 18:19:33 2013 +0200 (2013-04-22) |
parents | a13a6c5b176e |
children | 12326fc2d995 |
line source
1 #!/bin/sh
3 [ ! -s "$1" ] && echo "Usage: $0 file.com [extra_ss]> file.exe" && exit 1
4 S=$((32+$(stat -c %s $1)))
5 P=$((($S+511)/512))
6 E=$((4096-(32*$P)))
7 for i in 0x5A4D $(($S%512)) $P 0 2 $E $E $((${2:-0}-16)) -2 0 256 -16 28 0 0 0
8 do printf '\\\\x%02X\\\\x%02X' $(($i&255)) $((($i>>8)&255)) | xargs echo -en
9 done
10 cat $1