MOD: modified and code cleanup

This commit is contained in:
JohnE 2015-08-25 01:20:18 -07:00
parent f1b44dfbb8
commit f2e622d36a
12 changed files with 2158 additions and 39 deletions

4
README
View File

@ -14,4 +14,6 @@ The fingerprint is stored to disk in JSON format.
------------- -------------
BUILD BUILD
------------- -------------
This project is completely python. No building required.
There are no dependencies.
It has been tested on Python 2.7.10

View File

@ -2,21 +2,30 @@
--------------- ---------------
Future Work Future Work
--------------- ---------------
1. Fuzzy Logic database schema detection 1. Folder Support
a. Read fingerprints from a folder
b. Create fingerprints from files in a folder
- Fuzzy Logic database schema detection
- Finish adding hash of each database table CREATE string
------------ ------------
History History
------------ ------------
version 0.9 version 0.85
-modified format
-added "file-metadata", info about the scanner and fingerprint file
-added "fingerprint-hashes", each sql statement hashed
version 0.8
-added JSON import -added JSON import
-added database schema comparison. currently only compares -added database schema comparison. currently only compares
version 0.8 version 0.7
-updated fingerprint to include SQLite database commands to create the tables -updated fingerprint to include SQLite database commands to create the tables
-updated fingerprint to include file metadata which is version of the fingerprint JSON file format -updated fingerprint to include file metadata which is version of the fingerprint JSON file format
version 0.7 version 0.6
- export a database fingerprint to a JSON file - export a database fingerprint to a JSON file

View File

@ -8,7 +8,7 @@ from libs import fingerprint
def main(): def main():
(filein, fileout2, filejson, verbose) = parseArgs() (filein, fileout, filejson, verbose) = parseArgs()
db = fingerprint.DBSchema() db = fingerprint.DBSchema()
@ -18,7 +18,7 @@ def main():
elif (filein): elif (filein):
retVal = db.scanDBFile(filein) retVal = db.scanDBFile(filein)
if (retVal > 0): if (retVal > 0):
fh = open(fileout2, "w") fh = open(fileout, "w")
db.debugFingerprint() db.debugFingerprint()
db.writeFingerprint(fh) db.writeFingerprint(fh)
fh.close() fh.close()
@ -33,7 +33,7 @@ def parseArgs():
print '***** ***** ***** *****' print '***** ***** ***** *****'
print ' DB Fingerprint' print ' DB Fingerprint'
print '***** ***** ***** *****\n' print '***** ***** ***** *****\n'
fileout1 = '' fileout = ''
timestr = time.strftime('%Y-%m-%d_%H%M%S', time.localtime(time.time())) timestr = time.strftime('%Y-%m-%d_%H%M%S', time.localtime(time.time()))
parser = argparse.ArgumentParser(description='Fingerprint a sqlite database based on its schema') parser = argparse.ArgumentParser(description='Fingerprint a sqlite database based on its schema')
parser.add_argument('-f', '--file', required=False) parser.add_argument('-f', '--file', required=False)
@ -46,9 +46,9 @@ def parseArgs():
exit() exit()
if (args.file): if (args.file):
fileout1 = args.file + "_" + timestr + '.json' fileout = args.file + "_" + timestr + '.json'
return (args.file, fileout1, args.json, args.verbose) return (args.file, fileout, args.json, args.verbose)
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -6,7 +6,6 @@
------------- -------------
INTRO INTRO
------------- -------------
dbfp is a tool that will scan a sqlite database and generate a fingerprint. dbfp is a tool that will scan a sqlite database and generate a fingerprint.
The fingerprint is basically the database schema. The fingerprint is basically the database schema.
The fingerprint is stored to disk in JSON format. The fingerprint is stored to disk in JSON format.

View File

@ -10,13 +10,28 @@ delimeter = "|"
# #
# Database Schema # Database Schema
# The SQLite database schema is stored in page 1 of the database (root page).
# The sqlite_master table contains one row for each table, index, view, and trigger
# (collectively "objects") in the database schema.
# CREATE TABLE sqlite_master(
# type text,
# name text,
# tbl_name text,
# rootpage integer,
# sql text
# );
# #
class DBSchema: class DBSchema:
""" """
This class represents a complete database schema This class represents a complete database schema
Helper functions:
Writing of the database schema as a "fingerprint"
Comparing of a database schema (fingerprint loaded from file)
""" """
sqlmaster = "SELECT name, sql FROM sqlite_master WHERE type='table'" sqlmaster = "SELECT name, sql FROM sqlite_master WHERE type='table'"
scanner_ver = ".85"
format_ver = ".90"
def __init__(self): def __init__(self):
self.conn = None self.conn = None
@ -49,16 +64,16 @@ class DBSchema:
def importJson(self, filejson): def importJson(self, filejson):
self.tablesJson = self.__importDBSchema(filejson) self.tablesJson = self.__importJsonDBSchema(filejson)
def compareDB(self, filejson): def compareDB(self, filejson):
self.tablesJson = self.__importDBSchema(filejson) self.tablesJson = self.__importJsonDBSchema(filejson)
result = self.__DBSchemaCompare() result = self.__DBSchemaCompare()
return result return result
def __importDBSchema(self, filein): def __importJsonDBSchema(self, filejson):
tables = {} tables = {}
try: try:
fh = open(filein, "r") fh = open(filein, "r")
@ -178,8 +193,8 @@ class DBSchema:
# metadata # metadata
mhash['scanner-name'] = 'dbfp' mhash['scanner-name'] = 'dbfp'
mhash['scanner-ver'] = '0.50' mhash['scanner-ver'] = self.scanner_ver
mhash['format-ver'] = '0.90' mhash['format-ver'] = self.format_ver
# database configuration information # database configuration information
dhash['dn-name'] = self.dbName dhash['dn-name'] = self.dbName
@ -338,16 +353,9 @@ class TableDefinition:
field['unique'] = True field['unique'] = True
if (field): if (field):
self.uniqueFlag = False self.uniqueFlag = False
return False return False
print 'INFO: field definition not recognized: "' + sqltext + '"' print 'WARN: field definition not recognized: "' + sqltext + '"'
# photo_id INTEGER REFERENCES data(_id)
# results = re.match(r'', sqltext)
# if results:
# newField['name'] = results.group(1)
# newField['datatype'] = results.group(2)
# return newField
except Exception, e: except Exception, e:
return None return None

18
libs/fingerprint_comp.py Normal file
View File

@ -0,0 +1,18 @@
#
#
#
class FingerprintRunner:
"""
Compare Finger Prints
"""
#
def __init__(self):
return
#
def folderCompare(self, folder):
return

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
{
"tables": {
"table_def_1": {
},
"table_def_2": {
},
"table_def_3": {
}
}
}

View File

@ -0,0 +1,209 @@
{
"db-config": {
"dn-name": "test-data/profilecache.db"
},
"db-metadata": {
"profiles": "CREATE TABLE `profiles` (`key` TEXT PRIMARY KEY, `value` TEXT)",
"profiletable": "CREATE TABLE `profiletable` (`itemUserId` TEXT PRIMARY KEY, `itemFirstName` TEXT NOT NULL, `itemLastName` TEXT NOT NULL, `itemBirthday` TEXT NOT NULL, `itemGender` TEXT NOT NULL, `itemStatus` TEXT NOT NULL, `itemLongitude` DOUBLE NOT NULL, `itemLatitude` DOUBLE NOT NULL, `itemDistance` DOUBLE NOT NULL, `itemAvatarUrl` TEXT NOT NULL, `itemThumbnailUrl` TEXT NOT NULL, `itemVideoUrl` TEXT NOT NULL, `itemVideoThumbnailUrl` TEXT NOT NULL, `itemBackgroundUrl` TEXT NOT NULL, `itemPrivacy` INTEGER NOT NULL, `itemIsLocationOn` INTEGER NOT NULL, `itemIsFriend` INTEGER NOT NULL, `itemIsBlocked` INTEGER NOT NULL, `itemFriendRequestType` TEXT NOT NULL, `itemReverseRelationships` TEXT NOT NULL, `itemFeedCount` INTEGER NOT NULL, `itemRefereneCount` INTEGER NOT NULL, `itemLevel1DataSyncTime` BIGINT NOT NULL, `itemLevel2DataSyncTime` BIGINT NOT NULL, `itemLevel3DataSyncTime` BIGINT NOT NULL, `itemLevel4DataSyncTime` BIGINT NOT NULL, `itemLevel5DataSyncTime` BIGINT NOT NULL, `itemLastLocalAccessTime` BIGINT NOT NULL, `itemLastServerModifyTime` BIGINT NOT NULL, `itemLastLocationServerModifyTime` BIGINT NOT NULL, `itemLastStatusServerModifyTime` BIGINT NOT NULL, `itemFriendRequestId` TEXT NOT NULL, `itemFriendRequestMessage` TEXT NOT NULL, `itemFriendRequestTime` BIGINT NOT NULL, `itemIsNewFriendRequest` INTEGER NOT NULL, `itemFriendRequestTCMessageId` INTEGER NOT NULL)"
},
"file-metadata": {
"format-ver": "0.90",
"scanner-name": "dbfp",
"scanner-ver": "0.50"
},
"tables": {
"profiles": {
"key": {
"datatype": "TEXT",
"name": "key",
"primarykey": true
},
"value": {
"datatype": "TEXT",
"name": "value"
}
},
"profiletable": {
"itemAvatarUrl": {
"datatype": "TEXT",
"name": "itemAvatarUrl",
"notnull": true
},
"itemBackgroundUrl": {
"datatype": "TEXT",
"name": "itemBackgroundUrl",
"notnull": true
},
"itemBirthday": {
"datatype": "TEXT",
"name": "itemBirthday",
"notnull": true
},
"itemDistance": {
"datatype": "DOUBLE",
"name": "itemDistance",
"notnull": true
},
"itemFeedCount": {
"datatype": "INTEGER",
"name": "itemFeedCount",
"notnull": true
},
"itemFirstName": {
"datatype": "TEXT",
"name": "itemFirstName",
"notnull": true
},
"itemFriendRequestId": {
"datatype": "TEXT",
"name": "itemFriendRequestId",
"notnull": true
},
"itemFriendRequestMessage": {
"datatype": "TEXT",
"name": "itemFriendRequestMessage",
"notnull": true
},
"itemFriendRequestTCMessageId": {
"datatype": "INTEGER",
"name": "itemFriendRequestTCMessageId",
"notnull": true
},
"itemFriendRequestTime": {
"datatype": "BIGINT",
"name": "itemFriendRequestTime",
"notnull": true
},
"itemFriendRequestType": {
"datatype": "TEXT",
"name": "itemFriendRequestType",
"notnull": true
},
"itemGender": {
"datatype": "TEXT",
"name": "itemGender",
"notnull": true
},
"itemIsBlocked": {
"datatype": "INTEGER",
"name": "itemIsBlocked",
"notnull": true
},
"itemIsFriend": {
"datatype": "INTEGER",
"name": "itemIsFriend",
"notnull": true
},
"itemIsLocationOn": {
"datatype": "INTEGER",
"name": "itemIsLocationOn",
"notnull": true
},
"itemIsNewFriendRequest": {
"datatype": "INTEGER",
"name": "itemIsNewFriendRequest",
"notnull": true
},
"itemLastLocalAccessTime": {
"datatype": "BIGINT",
"name": "itemLastLocalAccessTime",
"notnull": true
},
"itemLastLocationServerModifyTime": {
"datatype": "BIGINT",
"name": "itemLastLocationServerModifyTime",
"notnull": true
},
"itemLastName": {
"datatype": "TEXT",
"name": "itemLastName",
"notnull": true
},
"itemLastServerModifyTime": {
"datatype": "BIGINT",
"name": "itemLastServerModifyTime",
"notnull": true
},
"itemLastStatusServerModifyTime": {
"datatype": "BIGINT",
"name": "itemLastStatusServerModifyTime",
"notnull": true
},
"itemLatitude": {
"datatype": "DOUBLE",
"name": "itemLatitude",
"notnull": true
},
"itemLevel1DataSyncTime": {
"datatype": "BIGINT",
"name": "itemLevel1DataSyncTime",
"notnull": true
},
"itemLevel2DataSyncTime": {
"datatype": "BIGINT",
"name": "itemLevel2DataSyncTime",
"notnull": true
},
"itemLevel3DataSyncTime": {
"datatype": "BIGINT",
"name": "itemLevel3DataSyncTime",
"notnull": true
},
"itemLevel4DataSyncTime": {
"datatype": "BIGINT",
"name": "itemLevel4DataSyncTime",
"notnull": true
},
"itemLevel5DataSyncTime": {
"datatype": "BIGINT",
"name": "itemLevel5DataSyncTime",
"notnull": true
},
"itemLongitude": {
"datatype": "DOUBLE",
"name": "itemLongitude",
"notnull": true
},
"itemPrivacy": {
"datatype": "INTEGER",
"name": "itemPrivacy",
"notnull": true
},
"itemRefereneCount": {
"datatype": "INTEGER",
"name": "itemRefereneCount",
"notnull": true
},
"itemReverseRelationships": {
"datatype": "TEXT",
"name": "itemReverseRelationships",
"notnull": true
},
"itemStatus": {
"datatype": "TEXT",
"name": "itemStatus",
"notnull": true
},
"itemThumbnailUrl": {
"datatype": "TEXT",
"name": "itemThumbnailUrl",
"notnull": true
},
"itemUserId": {
"datatype": "TEXT",
"name": "itemUserId",
"primarykey": true
},
"itemVideoThumbnailUrl": {
"datatype": "TEXT",
"name": "itemVideoThumbnailUrl",
"notnull": true
},
"itemVideoUrl": {
"datatype": "TEXT",
"name": "itemVideoUrl",
"notnull": true
}
}
}
}

View File

@ -0,0 +1,164 @@
{
"db-config": {
"dn-name": "test-data/tc.db"
},
"db-metadata": {
"conversations": "CREATE TABLE `conversations` (`conv_id` TEXT PRIMARY KEY, `payload` BLOB, `last_msg_id` INTEGER, `unread_count` INTEGER, `last_read_sent_msg_id` INTEGER, `conv_type` INTEGER DEFAULT 0, `conv_del_status` INTEGER DEFAULT 0, `deleting_ts` BIGINT DEFAULT 0)",
"messages": "CREATE TABLE `messages` (`msg_id` INTEGER PRIMARY KEY, `conv_id` TEXT, `type` INTEGER, `media_id` TEXT, `share_id` TEXT, `create_time` BIGINT, `send_time` BIGINT, `direction` INTEGER, `status` INTEGER, `payload` BLOB, `del_status` INTEGER)",
"profiles": "CREATE TABLE `profiles` (`key` TEXT PRIMARY KEY, `value` TEXT)",
"receipts": "CREATE TABLE `receipts` (`conv_id` TEXT PRIMARY KEY, `msg_id` INTEGER, `sender_msg_id` INTEGER, `type` INTEGER, `create_time` BIGINT, `status` INTEGER, `payload` BLOB)",
"sms": "CREATE TABLE `sms` (`msg_id` INTEGER PRIMARY KEY, `phonenumber` TEXT, `text` TEXT)"
},
"file-metadata": {
"format-ver": "0.90",
"scanner-name": "dbfp",
"scanner-ver": "0.50"
},
"tables": {
"conversations": {
"conv_del_status": {
"datatype": "INTEGER",
"default": "0",
"name": "conv_del_status",
"notnull": true
},
"conv_id": {
"datatype": "TEXT",
"name": "conv_id",
"primarykey": true
},
"conv_type": {
"datatype": "INTEGER",
"default": "0",
"name": "conv_type",
"notnull": true
},
"deleting_ts": {
"datatype": "BIGINT",
"default": "0",
"name": "deleting_ts",
"notnull": true
},
"last_msg_id": {
"datatype": "INTEGER",
"name": "last_msg_id"
},
"last_read_sent_msg_id": {
"datatype": "INTEGER",
"name": "last_read_sent_msg_id"
},
"payload": {
"datatype": "BLOB",
"name": "payload"
},
"unread_count": {
"datatype": "INTEGER",
"name": "unread_count"
}
},
"messages": {
"conv_id": {
"datatype": "TEXT",
"name": "conv_id"
},
"create_time": {
"datatype": "BIGINT",
"name": "create_time"
},
"del_status": {
"datatype": "INTEGER",
"name": "del_status"
},
"direction": {
"datatype": "INTEGER",
"name": "direction"
},
"media_id": {
"datatype": "TEXT",
"name": "media_id"
},
"msg_id": {
"datatype": "INTEGER",
"name": "msg_id",
"primarykey": true
},
"payload": {
"datatype": "BLOB",
"name": "payload"
},
"send_time": {
"datatype": "BIGINT",
"name": "send_time"
},
"share_id": {
"datatype": "TEXT",
"name": "share_id"
},
"status": {
"datatype": "INTEGER",
"name": "status"
},
"type": {
"datatype": "INTEGER",
"name": "type"
}
},
"profiles": {
"key": {
"datatype": "TEXT",
"name": "key",
"primarykey": true
},
"value": {
"datatype": "TEXT",
"name": "value"
}
},
"receipts": {
"conv_id": {
"datatype": "TEXT",
"name": "conv_id",
"primarykey": true
},
"create_time": {
"datatype": "BIGINT",
"name": "create_time"
},
"msg_id": {
"datatype": "INTEGER",
"name": "msg_id"
},
"payload": {
"datatype": "BLOB",
"name": "payload"
},
"sender_msg_id": {
"datatype": "INTEGER",
"name": "sender_msg_id"
},
"status": {
"datatype": "INTEGER",
"name": "status"
},
"type": {
"datatype": "INTEGER",
"name": "type"
}
},
"sms": {
"msg_id": {
"datatype": "INTEGER",
"name": "msg_id",
"primarykey": true
},
"phonenumber": {
"datatype": "TEXT",
"name": "phonenumber"
},
"text": {
"datatype": "TEXT",
"name": "text"
}
}
}
}

View File

@ -0,0 +1,171 @@
{
"db-metadata": {
"conversations": "CREATE TABLE `conversations` (`conv_id` TEXT PRIMARY KEY, `payload` BLOB, `last_msg_id` INTEGER, `unread_count` INTEGER, `last_read_sent_msg_id` INTEGER, `conv_type` INTEGER DEFAULT 0, `conv_del_status` INTEGER DEFAULT 0, `deleting_ts` BIGINT DEFAULT 0)",
"messages": "CREATE TABLE `messages` (`msg_id` INTEGER PRIMARY KEY, `conv_id` TEXT, `type` INTEGER, `media_id` TEXT, `share_id` TEXT, `create_time` BIGINT, `send_time` BIGINT, `direction` INTEGER, `status` INTEGER, `payload` BLOB, `del_status` INTEGER)",
"profiles": "CREATE TABLE `profiles` (`key` TEXT PRIMARY KEY, `value` TEXT)",
"receipts": "CREATE TABLE `receipts` (`conv_id` TEXT PRIMARY KEY, `msg_id` INTEGER, `sender_msg_id` INTEGER, `type` INTEGER, `create_time` BIGINT, `status` INTEGER, `payload` BLOB)",
"sms": "CREATE TABLE `sms` (`msg_id` INTEGER PRIMARY KEY, `phonenumber` TEXT, `text` TEXT)"
},
"file-metadata": {
"dn-name": "test-data/tc.db",
"scan-date": "2015-08-06_105953",
"format-ver": "0.90",
"scanner-name": "dbfp",
"scanner-ver": "0.50"
},
"fingerprint-hashes": {
"--file--hash--": "2fb4d49311b816b07863a67fbcc96557",
"conversations": "d6b2bbcc608a312dc76612d33332bfb5",
"messages": "d6e27f167c6e5f5f00ac97a676628cda",
"profiles": "6b4029da986d475d72cd2fe805531814",
"receipts": "494a13c1ddb965d16c225f64b77f5f27",
"sms": "9a6169c8979ea50d8fd024c6df169e0e"
},
"tables": {
"conversations": {
"conv_del_status": {
"datatype": "INTEGER",
"default": "0",
"name": "conv_del_status",
"notnull": true
},
"conv_id": {
"datatype": "TEXT",
"name": "conv_id",
"primarykey": true
},
"conv_type": {
"datatype": "INTEGER",
"default": "0",
"name": "conv_type",
"notnull": true
},
"deleting_ts": {
"datatype": "BIGINT",
"default": "0",
"name": "deleting_ts",
"notnull": true
},
"last_msg_id": {
"datatype": "INTEGER",
"name": "last_msg_id"
},
"last_read_sent_msg_id": {
"datatype": "INTEGER",
"name": "last_read_sent_msg_id"
},
"payload": {
"datatype": "BLOB",
"name": "payload"
},
"unread_count": {
"datatype": "INTEGER",
"name": "unread_count"
}
},
"messages": {
"conv_id": {
"datatype": "TEXT",
"name": "conv_id"
},
"create_time": {
"datatype": "BIGINT",
"name": "create_time"
},
"del_status": {
"datatype": "INTEGER",
"name": "del_status"
},
"direction": {
"datatype": "INTEGER",
"name": "direction"
},
"media_id": {
"datatype": "TEXT",
"name": "media_id"
},
"msg_id": {
"datatype": "INTEGER",
"name": "msg_id",
"primarykey": true
},
"payload": {
"datatype": "BLOB",
"name": "payload"
},
"send_time": {
"datatype": "BIGINT",
"name": "send_time"
},
"share_id": {
"datatype": "TEXT",
"name": "share_id"
},
"status": {
"datatype": "INTEGER",
"name": "status"
},
"type": {
"datatype": "INTEGER",
"name": "type"
}
},
"profiles": {
"key": {
"datatype": "TEXT",
"name": "key",
"primarykey": true
},
"value": {
"datatype": "TEXT",
"name": "value"
}
},
"receipts": {
"conv_id": {
"datatype": "TEXT",
"name": "conv_id",
"primarykey": true
},
"create_time": {
"datatype": "BIGINT",
"name": "create_time"
},
"msg_id": {
"datatype": "INTEGER",
"name": "msg_id"
},
"payload": {
"datatype": "BLOB",
"name": "payload"
},
"sender_msg_id": {
"datatype": "INTEGER",
"name": "sender_msg_id"
},
"status": {
"datatype": "INTEGER",
"name": "status"
},
"type": {
"datatype": "INTEGER",
"name": "type"
}
},
"sms": {
"msg_id": {
"datatype": "INTEGER",
"name": "msg_id",
"primarykey": true
},
"phonenumber": {
"datatype": "TEXT",
"name": "phonenumber"
},
"text": {
"datatype": "TEXT",
"name": "text"
}
}
}
}

View File

@ -0,0 +1,345 @@
{
"db-config": {
"dn-name": "test-data/test1.db"
},
"db-metadata": {
"chat_settings": "CREATE TABLE chat_settings(uid INTEGER PRIMARY KEY, participants BLOB)",
"chats": "CREATE TABLE chats(uid INTEGER PRIMARY KEY, name TEXT, data BLOB)",
"contacts": "CREATE TABLE contacts(uid INTEGER PRIMARY KEY, mutual INTEGER)",
"dialogs": "CREATE TABLE dialogs(did INTEGER PRIMARY KEY, date INTEGER, unread_count INTEGER, last_mid INTEGER)",
"enc_chats": "CREATE TABLE enc_chats(uid INTEGER PRIMARY KEY, user INTEGER, name TEXT, data BLOB, g BLOB, authkey BLOB, ttl INTEGER)",
"enc_tasks": "CREATE TABLE enc_tasks(date INTEGER, data BLOB)",
"media": "CREATE TABLE media(mid INTEGER PRIMARY KEY, uid INTEGER, date INTEGER, data BLOB)",
"media_counts": "CREATE TABLE media_counts(uid INTEGER PRIMARY KEY, count INTEGER)",
"messages": "CREATE TABLE messages(mid INTEGER PRIMARY KEY, uid INTEGER, read_state INTEGER, send_state INTEGER, date INTEGER, data BLOB, out INTEGER, ttl INTEGER)",
"params": "CREATE TABLE params(id INTEGER PRIMARY KEY, seq INTEGER, pts INTEGER, date INTEGER, qts INTEGER, lsv INTEGER, sg INTEGER, pbytes BLOB)",
"pending_read": "CREATE TABLE pending_read(uid INTEGER PRIMARY KEY, max_id INTEGER)",
"randoms": "CREATE TABLE randoms(random_id INTEGER PRIMARY KEY, mid INTEGER)",
"sent_files_v2": "CREATE TABLE sent_files_v2(uid TEXT, type INTEGER, data BLOB, PRIMARY KEY (uid, type))",
"user_contacts_v6": "CREATE TABLE user_contacts_v6(uid INTEGER PRIMARY KEY, fname TEXT, sname TEXT)",
"user_phones_v6": "CREATE TABLE user_phones_v6(uid INTEGER, phone TEXT, sphone TEXT, deleted INTEGER, PRIMARY KEY (uid, phone))",
"user_photos": "CREATE TABLE user_photos(uid INTEGER, id INTEGER, data BLOB, PRIMARY KEY (uid, id))",
"users": "CREATE TABLE users(uid INTEGER PRIMARY KEY, name TEXT, status INTEGER, data BLOB)",
"wallpapers": "CREATE TABLE wallpapers(uid INTEGER PRIMARY KEY, data BLOB)"
},
"file-metadata": {
"format-ver": "0.90",
"scanner-name": "dbfp",
"scanner-ver": "0.50"
},
"tables": {
"chat_settings": {
"participants": {
"datatype": "BLOB",
"name": "participants"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"chats": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"name": {
"datatype": "TEXT",
"name": "name"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"contacts": {
"mutual": {
"datatype": "INTEGER",
"name": "mutual"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"dialogs": {
"date": {
"datatype": "INTEGER",
"name": "date"
},
"did": {
"datatype": "INTEGER",
"name": "did",
"primarykey": true
},
"last_mid": {
"datatype": "INTEGER",
"name": "last_mid"
},
"unread_count": {
"datatype": "INTEGER",
"name": "unread_count"
}
},
"enc_chats": {
"authkey": {
"datatype": "BLOB",
"name": "authkey"
},
"data": {
"datatype": "BLOB",
"name": "data"
},
"g": {
"datatype": "BLOB",
"name": "g"
},
"name": {
"datatype": "TEXT",
"name": "name"
},
"ttl": {
"datatype": "INTEGER",
"name": "ttl"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
},
"user": {
"datatype": "INTEGER",
"name": "user"
}
},
"enc_tasks": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"date": {
"datatype": "INTEGER",
"name": "date"
}
},
"media": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"date": {
"datatype": "INTEGER",
"name": "date"
},
"mid": {
"datatype": "INTEGER",
"name": "mid",
"primarykey": true
},
"uid": {
"datatype": "INTEGER",
"name": "uid"
}
},
"media_counts": {
"count": {
"datatype": "INTEGER",
"name": "count"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"messages": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"date": {
"datatype": "INTEGER",
"name": "date"
},
"mid": {
"datatype": "INTEGER",
"name": "mid",
"primarykey": true
},
"out": {
"datatype": "INTEGER",
"name": "out"
},
"read_state": {
"datatype": "INTEGER",
"name": "read_state"
},
"send_state": {
"datatype": "INTEGER",
"name": "send_state"
},
"ttl": {
"datatype": "INTEGER",
"name": "ttl"
},
"uid": {
"datatype": "INTEGER",
"name": "uid"
}
},
"params": {
"date": {
"datatype": "INTEGER",
"name": "date"
},
"id": {
"datatype": "INTEGER",
"name": "id",
"primarykey": true
},
"lsv": {
"datatype": "INTEGER",
"name": "lsv"
},
"pbytes": {
"datatype": "BLOB",
"name": "pbytes"
},
"pts": {
"datatype": "INTEGER",
"name": "pts"
},
"qts": {
"datatype": "INTEGER",
"name": "qts"
},
"seq": {
"datatype": "INTEGER",
"name": "seq"
},
"sg": {
"datatype": "INTEGER",
"name": "sg"
}
},
"pending_read": {
"max_id": {
"datatype": "INTEGER",
"name": "max_id"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"randoms": {
"mid": {
"datatype": "INTEGER",
"name": "mid"
},
"random_id": {
"datatype": "INTEGER",
"name": "random_id",
"primarykey": true
}
},
"sent_files_v2": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"type": {
"datatype": "INTEGER",
"name": "type"
},
"uid": {
"datatype": "TEXT",
"name": "uid",
"primarykey": true
}
},
"user_contacts_v6": {
"fname": {
"datatype": "TEXT",
"name": "fname"
},
"sname": {
"datatype": "TEXT",
"name": "sname"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"user_phones_v6": {
"deleted": {
"datatype": "INTEGER",
"name": "deleted"
},
"phone": {
"datatype": "TEXT",
"name": "phone"
},
"sphone": {
"datatype": "TEXT",
"name": "sphone"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"user_photos": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"id": {
"datatype": "INTEGER",
"name": "id"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"users": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"name": {
"datatype": "TEXT",
"name": "name"
},
"status": {
"datatype": "INTEGER",
"name": "status"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
},
"wallpapers": {
"data": {
"datatype": "BLOB",
"name": "data"
},
"uid": {
"datatype": "INTEGER",
"name": "uid",
"primarykey": true
}
}
}
}