Skip to content

Instantly share code, notes, and snippets.

@drhodes
Last active May 8, 2017 13:38
Show Gist options
  • Save drhodes/c02c0db4a15c7207ec3c42e06d0d1620 to your computer and use it in GitHub Desktop.
Save drhodes/c02c0db4a15c7207ec3c42e06d0d1620 to your computer and use it in GitHub Desktop.
extract JADE modules from firefox localstorage and output to a specified JSON file
#!/usr/bin/env python
import sqlite3
import json
import argparse
parser = argparse.ArgumentParser(description='extract JADE modules from firefox localstorage')
parser.add_argument('infile', metavar='infile',
type=str, help='the infile, something like: ./some/path/to/webappsstore.sqlite')
parser.add_argument('outfile', metavar='outfile',
type=str, help='the output, for example myModules.json')
def main():
args = parser.parse_args()
c = sqlite3.Connection(args.infile)
temp = c.execute("select * from webappsstore2") # how stable is this table name?
for (_, _, _, ident, blob) in temp:
if ident == "jade_saved_modules":
mods = ["Jade", json.loads(blob)]
with open(args.outfile, 'w') as f:
json.dump(mods, f)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment