-
Notifications
You must be signed in to change notification settings - Fork 44
/
__main__.py
47 lines (40 loc) · 1.43 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
import os
from keepwn.core.parse_dump import parse_dump
from keepwn.core.convert import convert
from keepwn.core.plugin import check_plugin, add_plugin, clean_plugin, poll_plugin
from keepwn.core.search import search
from keepwn.core.trigger import check_trigger, add_trigger, clean_trigger, poll_trigger
from keepwn.utils.parser import parse_args
def main():
if os.name == 'nt':
os.system('color') # to make termcolor work on Windows
options = parse_args()
if options.mode:
print()
# calls the appropriate core function
if options.mode == 'search':
search(options)
if options.mode == 'trigger':
if options.trigger_mode == 'check':
check_trigger(options)
if options.trigger_mode == 'add':
add_trigger(options)
if options.trigger_mode == 'remove':
clean_trigger(options)
if options.trigger_mode == 'poll':
poll_trigger(options)
if options.mode == 'plugin':
if options.plugin_mode == 'check':
check_plugin(options)
if options.plugin_mode == 'add':
add_plugin(options)
if options.plugin_mode == 'remove':
clean_plugin(options)
if options.plugin_mode == 'poll':
poll_plugin(options)
if options.mode == 'parse_dump':
parse_dump(options)
if options.mode == 'convert':
convert(options)
if __name__ == '__main__':
main()