淘宝助理的sqlite3数据库解密

来源:互联网 发布:xtrafinder mac 10.12 编辑:程序博客网 时间:2024/05/02 00:11

新版本的淘宝助理使用了sqlite3数据库,不过却是加密了的。采用了淘宝自己写的加密过程,用常用的sqlite3管理程序无法打开。

经过几天研究,发现了其加密算法,分析如下:

淘宝助理使用的 sqlitedll.dll 内包含有一个 sqlite3_thesys_callback 函数,这是其他sqlite的库文件所没有的。

跟踪发现,调用这个函数时会给他一个回调地址。

在这个回调地址指向的是一个加解密函数。

里面用了个256位的常量表,然后有规律的用这些常数来加减和异或,达到加密目的,过程并不复杂。由于是xor加密,解密时也是用的相同过程。

 

解密后得到的user4.db的表结构

table CategoryProperty CategoryProperty
table CategoryPropertyValue CategoryPropertyValue
table Category Category
table GoodsGroup GoodsGroup
table Goods Goods
table PropertyValueRelation PropertyValueRelation
table ShopCategory ShopCategory
table UpdateData UpdateData
table KeyValues KeyValues
table PostPages PostPages
table ShopCategoryMapGroup ShopCategoryMapGroup
table SkuUnit SkuUnit
table PicUnit PicUnit
table UserInfo UserInfo

 

得到的数据要 Utf8ToAnsi 转换一下,否则中文是乱码。