summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-02-14 03:24:55 +0100
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-02-14 03:24:55 +0100
commit08b8bb37465991f91f72aae7a073e95d9dedef83 (patch)
tree630e97e300632fd7a348a0642aa36255718983a7 /tools
parent6bc9aaeca4327cae4109e9664a7a70897f3c41e8 (diff)
downloadmsitools-08b8bb37465991f91f72aae7a073e95d9dedef83.zip
msitools-08b8bb37465991f91f72aae7a073e95d9dedef83.tar.gz
msitools-08b8bb37465991f91f72aae7a073e95d9dedef83.tar.xz
msidump: learn --signature
Diffstat (limited to 'tools')
-rw-r--r--tools/msidump.in17
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