最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

備份頂目

2023-06-13 20:59 作者:FAST少年  | 我要投稿

import os? import re? import hashlib import datetime? from tkinter import * from tkinter import filedialog class VirusTester: ??def __init__(self, root): ????self.root = root ????self.create_widgets() ????self.vaccines = {} # 初始化疫苗字典 ??def create_widgets(self): ????self.create_virus_button = Button(text='創(chuàng)建病毒', command=self.create_virus) ????self.scan_virus_button = Button(text='掃描病毒', command=self.scan_virus) ????self.test_virus_button = Button(text='測試病毒 command=self.test_v) ????self.file_path_var = Entry(width=50) ????self.monitor_var = StringVar(value='歡迎使用病毒測試工具!為了確保安全,請勿將該工具用于非法用途。') ????self.monitor_result = Label(textvariable=self.monitor_var) ????self.create_virus_button.pack(side=LEFT, padx=5, pady=5) ????self.scan_virus_button.pack(side=LEFT, padx=5, pady=5) ????Label(text="病毒文件路徑:").pack(side=LEFT, padx=5, pady=5) ????self.file_path_var.pack(side=LEFT, padx=5, pady=5) ????self.test_virus_button.pack(side=LEFT, padx=5, pady=5) ????Label(text='狀態(tài):').pack(side=LEFT, padx=5, pady=5) ????self.monitor_result.pack(side=LEFT, padx=5, pady=5) ??def create_virus(self): ????virus_name = hashlib.md5(os.urandom(32)).hexdigest() ????virus_content = f''' import os import hashlib virus_file = __file__ with open(virus_file, "rb") as f: ??content = f.read() hash = hashlib.md5(content).hexdigest() if hash != "{virus_name}": ??with open("{virus_file}", "wb") as f: ????f.write(content) ??os.system("start .\{virus_file}") ''' ????with open(f"{virus_name}.py", "w") as f: ??????f.write(virus_content) ????? ????self.monitor_var.set(f"病毒已創(chuàng)建:{virus_name}.py") ??def scan_virus(self): ????python_files = [os.path.join(root, file) for root, _, files os.walk(".") for file in files if file.endswith(".py")] ????? ????if not python_files: ??????self.monitor_var.set("當前目錄下不存在Python文件。") ??????return ????report = f"病毒掃描報告\n時間{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n" ????virus_files = [] ????for file in python_files: ??????with open(file) as f: ????????content = f.read() ????????? ????????if "import os" in content and "import hashlib" in content and "__file__" in content and "start .\\" in content: ??????????virus_name = re.search(r'if\s+hash\s+!=\s+"(.+?)":', content).group(1) ??????????virus_files.append(file) ??????????# 收集病毒信息 ??????????file_stats = os.stat(file) ??????????virus_info = f"\n病毒文件:{file}\n文件大?。簕file_stats.st_size} bytes\n最后一次修改時間:{datetime.datetime.fromtimestamp(file_stats.st_mtime).strftime('%Y-%m-%d %H:%M:%S')}\n病毒代碼:\n{content}\n哈希值:{virus_name}\n" ??????????# 管理員通過分析病毒代碼的來源,生成相應的疫苗 ??????????if virus_name not in self.vaccines: ????????????vaccine = hashlib.md5(virus_name.encode()).hexdigest() ????????????self.vaccines[virus_name] = vaccine ????????????self.monitor_var.set(f"已生成疫苗:{virus_name} -> {vaccine}") ??????????: ????????????vaccine = self.vaccines[virus_name] ??????????#

備份頂目的評論 (共 條)

分享到微博請遵守國家法律
绥宁县| 德兴市| 罗田县| 石家庄市| 高平市| 镇沅| 铁岭县| 女性| 龙山县| 泰和县| 靖江市| 临高县| 东安县| 惠安县| 门源| 泌阳县| 满洲里市| 青田县| 绩溪县| 连云港市| 九江市| 保山市| 余干县| 金秀| 康保县| 平凉市| 托克逊县| 化德县| 竹北市| 无极县| 梁山县| 霍林郭勒市| 昭通市| 肇源县| 汝阳县| 莫力| 南丹县| 简阳市| 广饶县| 黔西| 喀喇沁旗|