#!/bin/sh # ===== # Done by cyt0plas DIR=$1 TMPDIR=`mktemp -d XXXXXX` find "${DIR}" -type f -exec cp {} ${TMPDIR} \; mkdir -p out cd ${TMPDIR} # Extract the manifest cat Manifest.plist | awk '//,/<\/data>/ { print $1 }' | grep -v \< | tail -n +3 > manifest.tmp openssl enc -d -base64 < manifest.tmp > manifest.xml plutil -convert xml1 manifest.xml mv manifest.xml ../out rm manifest.tmp for BACKUP in *.mdbackup; do plutil -convert xml1 ${BACKUP}; FILE=`cat ${BACKUP} | awk '//,/<\/string>/ { print $1 }' | grep -v 1.0 | sed 's///g' | sed 's/<\/string>//g'` echo "Extracting ${FILE}" # Make sure the directory exists SPATH=`dirname ${FILE}` mkdir -p ../out/${SPATH} cat ${BACKUP} | awk '//,/<\/data>/ { print $1 }' | grep -v \< > ../out/file.tmp openssl enc -d -base64 < ../out/file.tmp > ../out/${FILE} done # Cleanup cd .. rm -rf "${TMPDIR}" rm -rf out/file.tmp