diff --git a/dbfp.py b/dbfp.py index 742fb4d..478748f 100644 --- a/dbfp.py +++ b/dbfp.py @@ -29,6 +29,9 @@ def compareFingerprint(file_in, file_json): def createFingerprint(file_in, verbose, app_name, app_ver, notes): db = FingerprintDB() retVal = db.scanDBFile(file_in) + + print "GOT HERE BITCHES: file_in=={}, retVal=={}".format(file_in, str(retVal)) + if (retVal > 0): if verbose: db.debugFingerprint() @@ -95,7 +98,8 @@ def androidData(data_dir): dir_names = [] try: dirs = os.listdir(data_dir) - except: + except Exception, ex: + print "ERROR opening Android data directory [{}]\n{}".format(data_dir, ex) return out_dir = FP_BASE_DIR + "_" + ToolBox.getTimestampStr() diff --git a/docs/devnotes b/docs/devnotes index 199b5fa..a984707 100644 --- a/docs/devnotes +++ b/docs/devnotes @@ -24,6 +24,7 @@ "Creating... FINISHED." "168 fingerprints in the new index" + [ Android Data ] -Processing of android data -removed verbose messsage for each fingerprint diff --git a/libs/fingerprint.py b/libs/fingerprint.py index cd1536a..f6f6808 100644 --- a/libs/fingerprint.py +++ b/libs/fingerprint.py @@ -61,7 +61,7 @@ class FingerprintDB: try: (self.conn, self.cur) = self.__openDB(filein) except Exception, ex: - print ex + logging.error(ex) return -2 try: @@ -75,7 +75,7 @@ class FingerprintDB: # concat all the table create statements, then md5 self.__createMD5DB() except Exception, ex: - print ex + logging.error(ex) return -3 # flag is used to determine if the class has data @@ -89,6 +89,7 @@ class FingerprintDB: return try: + print "FILE=={}".format(self.filein) filename = ToolBox.getTimestampFilename(self.filein) fh = open(filename, "w") try: diff --git a/libs/toolbox.py b/libs/toolbox.py index f82d4e2..7baf98d 100644 --- a/libs/toolbox.py +++ b/libs/toolbox.py @@ -27,9 +27,13 @@ class ToolBox: # @staticmethod def parseFilename(fqfilepath): - results = re.search(r'.*[\\/](\S*)\..*', fqfilepath) - if len(results.group(1)) != 0: - filename = results.group(1) + filename = 'fingerprint' + try: + results = re.search(r'.*[\\/](\S*)\..*', fqfilepath) + if len(results.group(1)) != 0: + filename = results.group(1) + except: + filename = fqfilepath return filename # @@ -44,9 +48,9 @@ class ToolBox: @staticmethod def getTimestampFilename(fqfilename): """ return output file name """ - timestr = getTimestampStr() + timestr = ToolBox.getTimestampStr() filename = ToolBox.parseFilename(fqfilename) - fileout = filename + "_" + timestr + '.json' + fileout = filename + "__" + timestr + '.json' return fileout #