This commit is contained in:
JohnE 2016-08-10 05:08:46 +00:00
parent c0e220a599
commit 7bb2a6c2a5
2 changed files with 16 additions and 53 deletions

3
exif_r.py Executable file → Normal file
View File

@ -1,9 +1,8 @@
from gi.repository import GExiv2
exif = GExiv2.Metadata('space.jpg')
exif = GExiv2.Metadata("space.jpg")
print("*** *** *** *** *** *** ***")
print(exif)
print(exif.get_date_time())
print ("*** *** *** *** *** *** ***")

View File

@ -1,33 +1,25 @@
#
#
#
import os
import argparse
import logging
from subprocess import Popen, PIPE, check_call
def main():
parseArgs()
def parseArgs():
print '***** ***** ***** *****'
print ' * Pic *** Seal *'
print '***** ***** ***** *****\n'
parser = argparse.ArgumentParser(description="Fingerprint a sqlite database based on its schema")
parser.add_argument('-db', '--database', required=False, help="path to file to be fingerprinted")
parser.add_argument('-fd', '--fpdir', required=False, help="path to directory of fingerprint files, compare each file")
parser.add_argument('-fp', '--fingerprint', required=False, help="fingerprint file to use in comparison")
parser.add_argument('-ad', '--android_dir', required=False, help="path to a directory with android folder structure sqlite files")
parser.add_argument('-dd', '--data_dir', required=False, help="path to a directory to search for sqlite files")
# parser.add_argument('-idx', '--index_fingerprints', required=False, help="path to a directory with sqlite files, index fingerprints if no other args given")
parser.add_argument('-an', '--app_name', required=False)
parser.add_argument('-av', '--app_version', required=False)
parser.add_argument('-n', '--notes', required=False)
parser.add_argument('-idx', action='store_true', help="add a fingerprint to the index")
parser.add_argument('-md5', required=False, help="md5 hash to query the index`")
parser.add_argument('-android_pull', action='store_true', help="automated pull of applications from a physical android phone")
print("***** ***** ***** *****")
print (" ** Pic * Seal ** ")
print("***** ***** ***** *****\n")
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--image', required=False, help="source image file")
parser.add_argument('-v', '--verbose', action='store_true', help="will set logging level to INFO")
parser.add_argument('-vv', '--vverbose', action='store_true', help="will set logging level to DEBUG")
parser.add_argument('-l', '--logging', action='store_true', help="will supercede the -v option and send all logging to a file, logging.DEBUG")
# parser.add_argument('-t', '--title', required=False)
args = parser.parse_args()
if (args.logging):
@ -39,41 +31,13 @@ def parseArgs():
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.CRITICAL)
if args.fpdir and args.idx and (args.database or args.fingerprint):
insertFP(args.database, args.fingerprint, args.fpdir)
elif args.fpdir and args.idx:
indexFingerprints(args.fpdir)
elif (args.database and args.fingerprint):
compareFingerprint(args.database, args.fingerprint)
elif (args.fpdir and (args.database or args.fingerprint)):
compareFPIndex(args.fpdir, args.database, args.fingerprint)
elif (args.fpdir and args.md5):
queryMD5(args.fpdir, args.md5)
elif (args.android_dir):
androidData(args.android_dir)
elif (args.android_pull):
androidPull()
elif (args.database):
createFingerprint(args.database, args.app_name, args.app_version, args.notes)
if (args.image):
pass
else:
print 'Create fingerprint:'
print ' dbfp.py -db <database_file>\n'
print 'Create fingerprint index:'
print ' dbfp.py -fd <fingerprint_dir> -idx\n'
print 'Add fingerprint to index:'
print ' dbfp.py -fp <fingerprint_file> -idx (-db <database_file> | -fp <fingerprint_file>)\n'
print 'Compare fingerprint to a database file:'
print ' dbfp.py -fp <fingerprint_file> -db <database_file>\n'
print 'Lookup fingerprint from index:'
print ' dbfp.py -fd <fingerprint_dir> -fp <fingerprint_file>)\n'
print 'Lookup database from index:'
print ' dbfp.py -fd <fingerprint_dir> -db <database_file>\n'
print 'Lookup MD5 hash from index:'
print ' dbfp.py -fd <fingerprint_dir> -md5 <md5_hash_string>\n'
print 'Android App pull and fingerprint:'
print ' dbfp.py -android_pull'
print '\n***** ***** ***** *****\n'
print('Create PicSeal images')
print(' picseal.py -i <image_file>')
print('\n***** ***** ***** *****\n')
parser.print_help()