cions/leveldb-cli

Some more exemple?

Closed this issue · 4 comments

Hi!
Could you add more exemple on how to open/read/write or dump an IndexedDB database please?

cions commented

Pass -i flag to open IndexedDB database like leveldb -i show. There is no support for auto-detection of IndexedDB.

I could figure out the most important command you did'nt speak about in the readme:

leveldb help 😉

The rest follows....

BTW Chromium's IndexedDB are readable with your tool (:+1:) but the result is full of escaped chars, the structure is not obvious though!

$ leveldb --dbpath data/Default/IndexedDB/https_developer.mozilla.org_0.indexeddb.leveldb/ -i show
"\0\0\0\0\0": "\x05"
"\0\0\0\0\x01": "\x01"
"\0\0\0\0\x02": "\x14\0\0\0\x0f"
"\0\0\0\02\0": "\b\x01"
"\0\0\0\0\xc9\x1f\0h\0t\0t\0p\0s\0_\0d\0e\0v\0e\0l\0o\0p\0e\0r\0.\0m\0o\0z\0i\0l\0l\0a\0.\0o\0r\0g\0_\00\0@\01\x05\0G\0l\0e\0a\0n": "\x01"
"\0\x01\0\0\x03": "\x01"
"\0\x01\0\0\x04": "\x01"
"\0\x01\0\0\x05": "\x02"
"\0\x01\0\02\x01\0": "\0M\0a\0i\0n"
"\0\x01\0\02\x01\x01": "\0\0\0"
"\0\x01\0\02\x01\x02": "\0"
"\0\x01\0\02\x01\x03": "\0"
"\0\x01\0\02\x01\x04": "x"
"\0\x01\0\02\x01\x05": "\x1e"
"\0\x01\0\02\x01\x06": "\0"
"\0\x01\0\02\x01\a": "\x01"
"\0\x01\0\0\xc8\x04\0M\0a\0i\0n": "\x01"
"\0\x01\x01\x01\x01\x12\0a\0p\0p\0L\0i\0f\0e\0t\0i\0m\0e\0M\0e\0t\0r\0i\0c\0s": "t\xff\x14\xff\x0fo\"\x11glean_client_infoo\"\x06stringo\"\x02os\"\x05Linux\"\nos_version\"\aUnknown\"\farchitecture\"\aUnknown\"\x06locale\"\x05fr-FR\"\tapp_build\"\aUnknown\"\x13app_display_version\"\aUnknown\"\vapp_channel\"\x04prod{\a{\x01\"\x06ac..."
"\0\x01\x01\x01\x01\x13\0p\0i\0n\0g\0L\0i\0f\0e\0t\0i\0m\0e\0M\0e\0t\0r\0i\0c\0s": "_\xff\x14\xff\x0fo\"\x06actiono\"\acountero\"1glean.error.invalid_overflow/navigator.user_agentI\b{\x01{\x01{\x01"
"\0\x01\x01\x01\x01\x05\0p\0i\0n\0g\0s": "x\xff\x14\xff\x0fo{\0"
"\0\x01\x01\x01\x01\x13\0u\0s\0e\0r\0L\0i\0f\0e\0t\0i\0m\0e\0M\0e\0t\0r\0i\0c\0s": "v\xff\x14\xff\x0fo\"\x11glean_client_infoo\"\x04uuido\"\tclient_id\"$c180a633-75e3-4c3d-a7eb-94b34dd1d8c1{\x01\"\bdatetimeo\"\x0efirst_run_dateo\"\btimeUnit\"\x03day\"\btimezoneIw\"\x04date\"\x182022-12-06T16:00:00.000Z{\x03{\x01{\x02\"\x0fglean_ping..."
"\0\x01\x01\x02\x01\x12\0a\0p\0p\0L\0i\0f\0e\0t\0i\0m\0e\0M\0e\0t\0r\0i\0c\0s": "t"
"\0\x01\x01\x02\x01\x13\0p\0i\0n\0g\0L\0i\0f\0e\0t\0i\0m\0e\0M\0e\0t\0r\0i\0c\0s": "_"
"\0\x01\x01\x02\x01\x05\0p\0i\0n\0g\0s": "x"
"\0\x01\x01\x02\x01\x13\0u\0s\0e\0r\0L\0i\0f\0e\0t\0i\0m\0e\0M\0e\0t\0r\0i\0c\0s": "v"

Do you have an advice of where to read about this encoding of keys and values?
(I could just trim all the \0 and \x?? but that's dirty)