能力值:
( LV2,RANK:10 )
|
-
-
2 楼
#!/usr/bin/env python # -*- coding: utf-8 -*-
import time import psutil import subprocess
exe_name = "test.exe"
while 1: exepid = None pids = psutil.pids() for pid in pids: try: p = psutil.Process(pid) if p.name() == exe_name: print("找到EXE进程:%x" % pid) exepid = pid break except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess): pass if exepid is None: subprocess.Popen(exe_name) else: time.sleep(5*60)
手写代码未做测试,就是不停的枚举所有进程,看EXE是否在进程列表中,如果不在就运行EXE,在就等300秒再次枚举进程,大致应该就是这样!
最后于 2021-2-14 22:20
被crackwiki编辑
,原因:
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
谢谢,我一会去试验一下。
|
|
|