wok-next diff dev86/stuff/com2exe @ rev 15906
Add python-elaphe python-barcode
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Feb 15 11:50:25 2014 +0000 (2014-02-15) |
parents | a13a6c5b176e |
children | 12326fc2d995 |
line diff
1.1 --- a/dev86/stuff/com2exe Sun Aug 12 15:55:25 2012 +0200 1.2 +++ b/dev86/stuff/com2exe Sat Feb 15 11:50:25 2014 +0000 1.3 @@ -1,10 +1,10 @@ 1.4 #!/bin/sh 1.5 1.6 -[ ! -s "$1" ] && echo "Usage: $0 file.com > file.exe" && exit 1 1.7 -S=$(stat -c %s $1) 1.8 +[ ! -s "$1" ] && echo "Usage: $0 file.com [extra_ss]> file.exe" && exit 1 1.9 +S=$((32+$(stat -c %s $1))) 1.10 P=$((($S+511)/512)) 1.11 E=$((4096-(32*$P))) 1.12 -for i in 0x5A4D $(($S%512)) $P 0 2 $E $E $((($P/128)*256-16)) -2 0 256 -16 28 0 0 0 1.13 +for i in 0x5A4D $(($S%512)) $P 0 2 $E $E $((${2:-0}-16)) -2 0 256 -16 28 0 0 0 1.14 do printf '\\\\x%02X\\\\x%02X' $(($i&255)) $((($i>>8)&255)) | xargs echo -en 1.15 done 1.16 cat $1