appimage: fix r2 commands with newer radare2 version

This commit is contained in:
Jörg Thalheim 2020-05-01 12:36:18 +01:00
parent 91b71a7b60
commit d67098ec2e
No known key found for this signature in database
GPG key ID: 003F2096411B5F92

View file

@ -17,7 +17,7 @@ unpack() {
local appimageType=0
# https://github.com/AppImage/libappimage/blob/ca8d4b53bed5cbc0f3d0398e30806e0d3adeaaab/src/libappimage/utils/MagicBytesChecker.cpp#L45-L63
eval "$(r2 "$src" -nn -Nqc "p8j 3 @ 8" |
eval "$(r2 -nn -Nqc "p8j 3 @ 8" "$src"|
jq -r '{appimageSignature: (.[:-1]|implode), appimageType: .[-1]}|
@sh "appimageSignature=\(.appimageSignature) appimageType=\(.appimageType)"')"
@ -38,7 +38,7 @@ unpack() {
# multiarch offset one-liner using same method as AppImage
# see https://gist.github.com/probonopd/a490ba3401b5ef7b881d5e603fa20c93
offset=$(r2 "$src" -nn -Nqc "pfj.elf_header @ 0" |\
offset=$(r2 -nn -Nqc "pfj.elf_header @ 0" "$src"|\
jq 'map({(.name): .value}) | add | .shoff + (.shnum * .shentsize)')
echo "Uncompress $(basename "$src") of type $appimageType @ offset $offset."