-
Notifications
You must be signed in to change notification settings - Fork 7
/
drpy3_various.py
71 lines (59 loc) · 1.31 KB
/
drpy3_various.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/local/opt/[email protected]/bin/python3
# -*- coding: utf-8 -*-
'''
PROJECT: MD5Bruter, "Various Stuff"
AUTHOR: DrPython3 @ GitHub.com
DATE: 2021-04-03
'''
# **********************
# *** PYTHON MODULES ***
# **********************
import sys
try:
import os
import time
except:
sys.exit('Error importing Python modules.\n\n')
# *****************
# *** FUNCTIONS ***
# *****************
def clean_screen():
'''
Provides a blank screen on purpose.
:return: None
'''
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
return None
def writer(output):
'''
Saves any output to textfile logs.txt.
:param str output: any output to save
:return: True/False
'''
try:
with open('logs.txt', 'a+') as output_file:
output_file.write(output + '\n')
except:
return False
return True
def log_startstop(type):
'''
Writes timestamps (start, end) to log-file.
:param str type: (start/stop)
:return: None
'''
user_time = time.asctime(
time.localtime()
)
if type == 'start':
log = writer(str(
f'MD5Bruter startet at: {str(user_time)}\n'
))
else:
log = writer(str(
f'\nMD5Bruter stopped at: {str(user_time)}\n'
))
return None