-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
71 lines (59 loc) · 2.14 KB
/
main.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
"""DieKnow main interface.
"""
import os
import sys
import dieknow
def main():
"""Main starting point."""
folder_path = b"C:/Program Files/DyKnow/Cloud/7.10.22.9"
if not os.path.exists(folder_path):
dieknow.dialog(
"A DyKnow installation was not able to be found on your device. "
f"Ensure {folder_path}s exists and you have the permissions to "
"access it!", "FATAL ERROR",
dieknow.MB_ICONERROR
)
sys.exit()
print("DieKnow Shell\n=============")
while True:
user_input = input(">>> ").strip().lower()
if user_input == "start":
if not dieknow.is_running():
dieknow.start_monitoring(folder_path)
print("Monitoring started...")
else:
dieknow.dialog(
"The DieKnow process has already been started!",
"Information",
dieknow.MB_ICONINFORMATION
)
elif user_input == "stop":
if not dieknow.is_running():
dieknow.dialog(
"The DieKnow process has already been stopped and is not "
"running!",
"Information",
dieknow.MB_ICONINFORMATION
)
else:
dieknow.stop_monitoring()
print("Monitoring stopped...")
elif user_input == "count":
killed = dieknow.get_killed_count()
print(f"Executables killed: {killed}")
elif user_input == "directory":
executables = dieknow.get_executables_in_folder(folder_path)
print(f"Files in {folder_path.decode()}:")
print(executables.decode())
elif user_input == "gui":
dieknow.create_window()
elif user_input == "bsod":
print("Opening blue screen of death...")
dieknow.bsod()
elif user_input == "exit":
dieknow.stop_monitoring()
break
else:
print("Invalid input. Available inputs: start, stop, count, directory, exit")
if __name__ == "__main__":
main()