mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-23 12:27:14 +00:00
zzexe: autodetect header size in decomp
This commit is contained in:
parent
e064bb457f
commit
ff5f7690bc
4
zzexe
4
zzexe
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e # exit on failure
|
set -e # exit on failure
|
||||||
IFS=$(printf '\n\t') # smarter ifs
|
IFS=$(printf '\n\t') # smarter ifs
|
||||||
[ "$1" = "-d" ] && tail -n+10 "$2" | zstd -cd | ifne sponge "$2" && exit
|
[ "$1" = "-d" ] && awk 'f;/^exit/{f=1}' "$2" | head -c-1 | zstd -cd | ifne sponge "$2" && exit
|
||||||
[ "$1" = "-p" ] && p="$2" && shift 2 # save prefix if present
|
[ "$1" = "-p" ] && p="$2" && shift 2 # save prefix if present
|
||||||
{ cat << 'EOF'; zstdmt -c19 "$@"; } | sed "2s/$/${1##*[./]})/;7s/^/$p /" | sponge "$1"
|
{ cat << 'EOF'; zstdmt -c19 "$@"; } | sed "2s/$/${1##*[./]})/;7s/^/$p /" | sponge "$1"
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
dir=$(dirname "$0") out=$(mktemp -t .zzXXXX.
|
dir=$(dirname "$0") out=$(mktemp -t .zzXXXX.
|
||||||
tail -n+10 "$0" | zstd -cd > "$out"
|
awk 'f;/^exit/{f=1}' "$0" | head -c-1 | zstd -cd > "$out"
|
||||||
chmod +x "$out"
|
chmod +x "$out"
|
||||||
ln -s "$out" "$dir"
|
ln -s "$out" "$dir"
|
||||||
trap "res=$?" 0 1 2 3 5 10 13 15
|
trap "res=$?" 0 1 2 3 5 10 13 15
|
||||||
|
|
Loading…
Reference in a new issue