-
Notifications
You must be signed in to change notification settings - Fork 0
/
pfish.py
47 lines (39 loc) · 1.31 KB
/
pfish.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# File: Python File System Hash (pfish.py)
#
# Author: Ed Mooney
#
# Date: 28 APR 2017
#
# Version: 1.0
#
# Desc: Walks through the file system, and hashes every file it finds, creates a report.
#
import logging # Python Standard Library Logger
import time # Python STL time functions
import sys # Python STL system specs
import _pfish # Our own module _pfish.py
if __name__=='__main__':
PFISH_VERSION = '1.0'
# Turn on logging
logging.basicConfig(filename='pFishLog.log', level=logging.DEBUG, format='%(asctime)s %(message)s')
# Process the CLI args
_pfish.ParseCommandLine()
# Record the starting time
startTime = time.time()
# Welcome message
logging.info('Welcome to pfish version ' + PFISH_VERSION + ' ... New Scan Started...')
_pfish.DisplayMessage('Welcome to pfish ... version ' + PFISH_VERSION)
# Record some system information
logging.info('System: ' + sys.platform)
logging.info('Version: ' + sys.version)
# Traverse the file system and hash the files
filesProcessed = _pfish.WalkPath()
# Record the end time and calculate the duration
endTime = time.time()
duration = endTime - startTime
logging.info('Files Processed: ' + str(filesProcessed))
logging.info('Elapsed Time: ' + str(duration) + ' seconds')
logging.info('Program Terminated Normally')
_pfish.DisplayMessage("Program End")
# EOF