回答:
私はそれらのSkypeアバターも取得したかったので、私はwhitequarkの回答を使用して、まさにそれを行う小さなbashスクリプトを作成しました。ここにあります:
#!/ bin / bash
if [\($#-lt 1 \)];
その後
echo "使用法:$ 0フォルダ";
echo "フォルダーの形式は/home/username/.Skype/username";
出口;
fi;
`ls $ 1`内のi;
行う
if [-f $ 1 / $ i];
その後
#echo "i:$ i";
filedump = `hexdump -v -e '" "1/1"%02x "" "' $ 1 / $ i | sed -e 's / ffd8ffe0 / \ nffd8ffe0 / g'`;
nocc = `echo" $ filedump "| wc -l`; #\ n文字の出現。私たちの言葉のnocc-1の出現がないことを意味します
#echo "nocc:$ nocc";
if ["$ nocc" -ge 2];
その後
k = 0;
old_IFS = $ IFS; #field separator
IFS = $ '\ n';
オフセット= 0;
$ filedumpのjの場合。
行う
w = `echo $ j | wc -m`; #実際にレターカウント+1を与える
w = $ [w-1];
offset = $ [offset + w];
#echo "offset:$ offset";
filename1 = "$ {i} _ $ {k} _notclean.jpg";
filename2 = "$ {i} _ $ {k} .jpg";
dd ibs = 1 if = $ 1 / $ i of = $ filename1 skip = `echo" $ offset / 2 "| bc` status = noxfer;
if [`du $ filename1 | カット-f1` -gt 0];
その後
$ filename1 $ filename2を変換します。#convertは、実際には画像の後のデータを削除するためにのみ使用されます
fi;
rm $ filename1;
k = $ [k + 1];
完了。
IFS = $ old_IFS;
fi;
fi;
終わった
main.dbファイルから低解像度と高解像度の両方のアバターを抽出し、対応するSkypeユーザー名にちなんで名付けられたファイルに保存する、よりクリーンなスクリプトを次に示します。
このスクリプトを実行するには、sqlite3とxxdが必要です。
main.dbデータベースの内容はかなり理解しやすく、少し想像するだけで、そこから抽出できるものはたくさんあります。
#!/bin/bash
if (( $# != 1 ))
then
echo "Usage: $0 folder"
echo "Where folder is of the form /home/username/.Skype/username"
exit 1
fi
# Magic string used at the beginning of JPEG files
magic=FFD8FFE0
# We read main.db and extract the Skype name, the avatar image and the
# attachments (which often contain a high-def version of the avatar image)
sqlite3 "$1/main.db" "select skypename,hex(avatar_image),hex(profile_attachments) from Contacts;" |\
while read line
do
IFS='|'
# We convert the line into an array
a=($line)
if [[ -n ${a[1]} ]] # There is an avatar_image
then
# We strip everything before the magic string, convert it back to binary, and save it to a file
echo $magic${a[1]#*$magic} | xxd -r -p > ${a[0]}_small.jpg
fi
if [[ -n ${a[2]} ]] # There is a profile_attachments
then
# Same as above
echo $magic${a[2]#*$magic} | xxd -r -p > ${a[0]}.jpg
fi
done
このSkypeフォーラムスレッドはアバターに関するものです:http : //forum.skype.com/index.php?showtopic=99471。
JFIF)でヘッダーを提供すると述べています。for i in *; do echo $i; hd $i | grep 'ff d8 ff e0'; doneコマンドを使用してすべてのSkypeファイルの16進ダンプをgrepすることにより、.Skype / userNNN.dbbファイルでこのヘッダーの多くの発生が明らかになりました。NNNはいくつかの数字です。このファイルには、完全に文書化されていない独自の形式があり、おそらくユーザーに関するすべてのキャッシュ情報を保持しています。ヘッダーをスキャンし、ファイルの終わりまですべてを他のファイルにコピーすることで、アバター自体を抽出できます。すべての画像ビューアは、画像自体(RARJPGに基づくテクノロジ)の後のデータをスキップし、それらからジャンクを削除したい場合は、例えばimagemagickとコマンドを使用して、変更せずに「変更」できます。convert file.jpg file_clean.jpg。ImageMagickは、説明されているビューアのように動作します。画像を読み取り、それに続くものをスキップして、画像自体のみを書き込みます。