forked from nyaoouo/FFDraw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (28 loc) · 930 Bytes
/
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
import logging
import multiprocessing
import os
import pathlib
import sys
exc_path = pathlib.Path(sys.executable if getattr(sys, 'frozen', False) else __file__).absolute().parent
os.environ['ExcPath'] = str(exc_path)
from nylib.logging import install
from nylib.utils.win32.process import enable_privilege, pid_by_executable, is_admin, runas
def main():
multiprocessing.freeze_support()
try:
from ff_draw.main import FFDraw
install()
logging.debug(f'current Pid:%s')
if not is_admin():
runas()
exit()
enable_privilege()
instance = FFDraw(next(pid_by_executable(b'ffxiv_dx11.exe')))
instance.start_sniffer()
instance.start_gui_thread()
instance.start_http_server()
except Exception as e:
logging.critical('critical error occurred', exc_info=e)
os.system('pause')
if __name__ == "__main__":
main()