Python Forum

Full Version: Help with mystery data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm attempting to read data from SQLite file and getting this from one of the fields.

After some googling I thought it was a 'plist' structure, but after feeding it through 'readPlist' in plistlib, I just get 'InvalidPlistException: Encountered integer longer than 16 bytes.'

Can anyone help me decode it?

b'bplist00\xd4\x01\x02\x03\x04\x05}~\x7fX$objectsY$archiverX$versionT$top\xaf\x10\x13\x06\x07\x16\x1b"\'.3:?FKRW^cjovU$null\xd3\x08\t\n\x0b\x10\x15WNS.keysZNS.objectsV$class\xa4\x0c\r\x0e\x0f\x80\x02\x80\x04\x80\x06\x80\x08\xa4\x11\x12\x13\x14\x80\n\x80\x0c\x80\x0e\x80\x10\x80\x12\xd2\x17\x18\x19\x1aYNS.stringV$classXfullname\x80\x03\xd2\x1c\x1d\x1e!X$classesZ$classname\xa2\x1f XNSStringXNSObjectXNSString\xd2#$%&YNS.stringV$classWaddress\x80\x05\xd2()*-X$classesZ$classname\xa2+,XNSStringXNSObjectXNSString\xd2/012YNS.stringV$classUphone\x80\x07\xd24569X$classesZ$classname\xa278XNSStringXNSObjectXNSString\xd2;<=>YNS.stringV$classUemail\x80\t\xd2@ABEX$classesZ$classname\xa2CDXNSStringXNSObjectXNSString\xd2GHIJYNS.stringV$class[Test Client\x80\x0b\xd2LMNQX$classesZ$classname\xa2OPXNSStringXNSObjectXNSString\xd2STUVYNS.stringV$class^123 ABC Street\x80\r\xd2XYZ]X$classesZ$classname\xa2[\\XNSStringXNSObjectXNSString\xd2_`abYNS.stringV$classT1234\x80\x0f\xd2defiX$classesZ$classname\xa2ghXNSStringXNSObjectXNSString\xd2klmnYNS.stringV$class][email protected]\x80\x11\xd2pqruX$classesZ$classname\xa2stXNSStringXNSObjectXNSString\xd2wxy|X$classesZ$classname\xa2z{\\NSDictionaryXNSObject\\NSDictionary_\x10\x0fNSKeyedArchiver\x12\x00\x01\x86\xa0\xd1\x80\x81Troot\x80\x01\x00\x08\x00\x11\x00\x1a\x00$\x00-\x002\x00H\x00N\x00U\x00]\x00h\x00o\x00t\x00v\x00x\x00z\x00|\x00\x81\x00\x83\x00\x85\x00\x87\x00\x89\x00\x8b\x00\x90\x00\x9a\x00\xa1\x00\xaa\x00\xac\x00\xb1\x00\xba\x00\xc5\x00\xc8\x00\xd1\x00\xda\x00\xe3\x00\xe8\x00\xf2\x00\xf9\x01\x01\x01\x03\x01\x08\x01\x11\x01\x1c\x01\x1f\x01(\x011\x01:\x01?\x01I\x01P\x01V\x01X\x01]\x01f\x01q\x01t\x01}\x01\x86\x01\x8f\x01\x94\x01\x9e\x01\xa5\x01\xab\x01\xad\x01\xb2\x01\xbb\x01\xc6\x01\xc9\x01\xd2\x01\xdb\x01\xe4\x01\xe9\x01\xf3\x01\xfa\x02\x06\x02\x08\x02\r\x02\x16\x02!\x02$\x02-\x026\x02?\x02D\x02N\x02U\x02d\x02f\x02k\x02t\x02\x7f\x02\x82\x02\x8b\x02\x94\x02\x9d\x02\xa2\x02\xac\x02\xb3\x02\xb8\x02\xba\x02\xbf\x02\xc8\x02\xd3\x02\xd6\x02\xdf\x02\xe8\x02\xf1\x02\xf6\x03\x00\x03\x07\x03\x15\x03\x17\x03\x1c\x03%\x030\x033\x03<\x03E\x03N\x03S\x03\\\x03g\x03j\x03w\x03\x80\x03\x8d\x03\x9f\x03\xa4\x03\xa7\x03\xac\x00\x00\x00\x00\x00\x00\x02\x01\x00\x00\x00\x00\x00\x00\x00\x82\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xae'
It contains name and address data, nothing personal, just a demo entry.
An sqlite file can only properly be read by sqlite3.
There is embedded binary data along with text data.
It's a complex structure.

You can use something like:
sqlite is built into python 3.6.2 (perhaps earlier)
but to read unknown data, you should download sqlite3 from: https://www.sqlite.org/
you can then find out what the schema (data structure) of the database directly: https://stackoverflow.com/questions/4654...-in-sqlite
Sorry, I didn't explain fully. I am using SQLite commands to read the file, and most of the fields read perfactly well, as plain text or numbers. But this particular field (the contact details of an individual), whenever it's used, always contains a jumble of characters like the above, as if another data format has been embedded within the SQLite file. In effect a database within a database.
You might try a program like DB Browser to see if there is something hinky going on.
There's nothing strange happening, it's just another kind of data embedded within a normal SQLite file. I'd like to be able to read the embedded data shown above; I have no trouble reading the rest of the SQLite file.