diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/msidump.in | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tools/msidump.in b/tools/msidump.in index c675f02..5edab46 100644 --- a/tools/msidump.in +++ b/tools/msidump.in @@ -23,6 +23,7 @@ set -e tables= streams= +signature= destdir=. version() @@ -50,11 +51,12 @@ Usage: msidump [OPTION]... MSI-FILE Options: -t, --tables Dump tables. This is the default. -s, --streams Dump streams + -S, --signature Dump asn1parse of digital signature. -d, --directory DIR Dump to given directory DIR -h, --help Print help message and exit. -v, --version Print version information and exit. -More than one of -t or -s may be specified. +More than one of -t, -s or -S may be specified. EOF } @@ -66,6 +68,9 @@ while true ; do -s|--streams) streams=true ;; + -S|--signature) + signature=true + ;; -d|--directory) destdir=$2 shift @@ -103,12 +108,13 @@ if [[ ! -d $destdir ]] ; then fi # Tables mode is the default. -if [[ -z $tables$streams ]] ; then +if [[ -z $tables$streams$signature ]] ; then tables=true else tables=${tables:-false} fi streams=${streams:-false} +signature=${signature:-false} # Here we go @@ -129,3 +135,10 @@ if $streams ; then msiinfo extract "$1" "$i" > "$destdir/_Streams/$i" done fi + +if $signature ; then + signature="$destdir/signature" + echo "Exporting asn1parsed $signature ..." + rm -f "$signature" + (msiinfo extract "$1" $'\005DigitalSignature' 2>/dev/null | openssl asn1parse -i -inform de > "$signature") || true +fi |