diff --git a/README.md b/README.md index a99d0c3..74c58f3 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ + `adb shell dumpsys iphonesubinfo | grep 'Device ID' | grep -o '[0-9]*'` #### Run: -+ Decrypt database, will produce decrypted_db.db (for now, Linux x64 only): ++ Decrypt database, will produce decrypted_db.db (for now, Linux only): ``` ./decrypt_db.sh ``` @@ -41,6 +41,5 @@ ### TODO + Group message + Change max size for custom emoji -+ Fix smiley spacing in html + Show name of emoji in text output + Search by uid/username.. diff --git a/android-interact.sh b/android-interact.sh index 4704c55..c1b31cb 100755 --- a/android-interact.sh +++ b/android-interact.sh @@ -1,9 +1,9 @@ #!/bin/bash -e # File: android-interact.sh -# Date: Thu Dec 25 00:25:07 2014 +0800 +# Date: Thu Dec 25 23:26:56 2014 +0800 # Author: Yuxin Wu -# Please check that your path is the same, since this might be differnt on devices +# Please check that your path is the same, since this might be different among devices RES_DIR="/mnt/sdcard/tencent/MicroMsg" MM_DIR="/data/data/com.tencent.mm" @@ -43,17 +43,16 @@ elif [[ $1 == "db" || $1 == "res" ]]; then echo "Pulling resources... this might take a long time..." mkdir resource cd resource - adb pull $RES_DIR/$chooseUser/image2 - adb pull $RES_DIR/$chooseUser/voice2 - adb pull $RES_DIR/$chooseUser/emoji - adb pull $RES_DIR/$chooseUser/avatar - [[ -d image2 && -d voice2 && -d emoji && -d avatar ]] && { - echo "Resource pulled." - echo "Total size: $(du -sh $chooseUser | cut -f1)" - } || { - echo "Failed to download resource directory: $RES_DIR/$chooseUser" - exit 1 - } + for d in image2 voice2 emoji avatar; do + adb pull $RES_DIR/$chooseUser/$d + [[ -d $d ]] || { + echo "Failed to download resource directory: $RES_DIR/$chooseUser/$d" + exit 1 + } + done + cd .. + echo "Resource pulled at ./resource" + echo "Total size: $(du -sh resource | cut -f1)" else echo "Pulling database file..." adb pull $MM_DIR/MicroMsg/$chooseUser/EnMicroMsg.db diff --git a/decrypt_db.sh b/decrypt_db.sh index f028bfe..3135019 100755 --- a/decrypt_db.sh +++ b/decrypt_db.sh @@ -1,11 +1,12 @@ #!/bin/bash -e # File: decrypt_db.sh -# Date: Thu Dec 25 00:30:10 2014 +0800 +# Date: Fri Dec 26 00:16:12 2014 +0800 # Author: Yuxin Wu -MMSGDB=$1 +MSGDB=$1 imei=$2 uin=$3 +output=decrypted.db if [[ -z "$1" || -z "$2" || -z "$3" ]]; then echo "Usage: $0 " @@ -15,11 +16,21 @@ fi KEY=$(echo -n "$imei$uin" | md5sum | cut -b 1-7) echo "KEY: $KEY" -export LD_LIBRARY_PATH=./lib -./lib/sqlcipher $MMSGDB << EOF +uname -m | grep x86_64 > /dev/null || version=32bit && version=64bit +echo "Use $version sqlcipher." + +echo "Dump decrypted database... " +echo "Don't worry about libcrypt.so version warning." + + +SQLCIPHER=./sqlcipher/$version +export LD_LIBRARY_PATH=$SQLCIPHER +$SQLCIPHER/sqlcipher $MSGDB << EOF PRAGMA key='$KEY'; PRAGMA cipher_use_hmac = off; -ATTACH DATABASE "decrypted_database.db" AS decrypted_db KEY ""; -SELECT sqlcipher_export("decrypted_db"); -DETACH DATABASE decrypted_db; +ATTACH DATABASE "$output" AS db KEY ""; +SELECT sqlcipher_export("db"); +DETACH DATABASE db; EOF + +echo "Database dumped to $output" diff --git a/sqlcipher/32bit/libsqlcipher.so.0 b/sqlcipher/32bit/libsqlcipher.so.0 new file mode 100644 index 0000000..b7991c9 Binary files /dev/null and b/sqlcipher/32bit/libsqlcipher.so.0 differ diff --git a/sqlcipher/32bit/sqlcipher b/sqlcipher/32bit/sqlcipher new file mode 100755 index 0000000..b2b94cb Binary files /dev/null and b/sqlcipher/32bit/sqlcipher differ diff --git a/lib/libsqlcipher.so.0 b/sqlcipher/64bit/libsqlcipher.so.0 similarity index 100% rename from lib/libsqlcipher.so.0 rename to sqlcipher/64bit/libsqlcipher.so.0 diff --git a/lib/sqlcipher b/sqlcipher/64bit/sqlcipher similarity index 100% rename from lib/sqlcipher rename to sqlcipher/64bit/sqlcipher