32bit support

This commit is contained in:
ppwwyyxx
2014-12-26 00:17:23 +08:00
parent f35e4248f6
commit 91c8b63875
3 changed files with 30 additions and 20 deletions
+12 -13
View File
@@ -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 <[email protected]>
# 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
+18 -7
View File
@@ -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 <[email protected]>
MMSGDB=$1
MSGDB=$1
imei=$2
uin=$3
output=decoded.db
if [[ -z "$1" || -z "$2" || -z "$3" ]]; then
echo "Usage: $0 <path to EnMicroMsg.db> <imei> <uin>"
@@ -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 decoded 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 "decoded_database.db" AS decoded_db KEY "";
SELECT sqlcipher_export("decoded_db");
DETACH DATABASE decoded_db;
ATTACH DATABASE "$output" AS db KEY "";
SELECT sqlcipher_export("db");
DETACH DATABASE db;
EOF
echo "Database dumped to $output"
BIN
View File
Binary file not shown.