diff --git a/2019/03/16/qq数据库的加密解密/index.html b/2019/03/16/qq数据库的加密解密/index.html index a4d5131b..e0259204 100644 --- a/2019/03/16/qq数据库的加密解密/index.html +++ b/2019/03/16/qq数据库的加密解密/index.html @@ -87,12 +87,12 @@ - - + + - + @@ -305,7 +305,7 @@
DENGTA_META.xml—IMEI:867179032952446
databases/2685371834.db——数据库文件
明文msg_t 密文msg_Data key:IMEI
msg_t = msg_Data[i]^IMEI[i%15]
实验:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24import sqlite3
IMEI = '867179032952446'
conn = sqlite3.connect('2685371834.db')
c = conn.cursor()
def _decrypt(foo):
substr = ''
#print(len(foo))
for i in range(0,len(foo)):
substr += chr(ord(foo[i]) ^ ord(IMEI[i%15]))
return substr
#rem = c.execute("SELECT uin, remark, name FROM Friends")
Msg = c.execute("SELECT msgData, senderuin, time FROM mr_friend_0FC9764CD248C8100C82A089152FB98B_New")
for msg in Msg:
uid = _decrypt(msg[1])
print("\n"+uid+":")
try:
msgData = _decrypt(msg[0]).decode('utf-8')
print(msgData)
except:
pass
DENGTA_META.xml—IMEI:867179032952446
databases/2685371834.db——数据库文件
明文msg_t 密文msg_Data key:IMEI
msg_t = msg_Data[i]^IMEI[i%15]
实验:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24import sqlite3
IMEI = '867179032952446'
conn = sqlite3.connect('2685371834.db')
c = conn.cursor()
def _decrypt(foo):
substr = ''
#print(len(foo))
for i in range(0,len(foo)):
substr += chr(ord(foo[i]) ^ ord(IMEI[i%15]))
return substr
#rem = c.execute("SELECT uin, remark, name FROM Friends")
Msg = c.execute("SELECT msgData, senderuin, time FROM mr_friend_0FC9764CD248C8100C82A089152FB98B_New")
for msg in Msg:
uid = _decrypt(msg[1])
print("\n"+uid+":")
try:
msgData = _decrypt(msg[0]).decode('utf-8')
print(msgData)
except:
pass