python防JC小工具
  • 板块灌水区
  • 楼主houmy
  • 当前回复30
  • 已保存回复30
  • 发布时间2023/11/16 16:47
  • 上次更新2023/11/16 18:45:52
查看原帖
python防JC小工具
555809
houmy楼主2023/11/16 16:47

如题,代码:

from tkinter import *
root=Tk()
def topmost():
    root.attributes("-topmost",True)
    root.after(10,topmost)
root.geometry("{}x{}+0+0".format(root.winfo_screenwidth(),root.winfo_screenheight()))
root.resizable(False,False)
root.overrideredirect(True)
topmost()
def myhash(s):
    res=0
    for i in range(len(s)):
        res=((res<<27)|(res>>5))+ord(s[i])
        res&=0xffffffff
    return res
hsh=#在这里填写解锁密码的myhash()值
stv=StringVar(root,"")
ent=Entry(root,textvariable=stv,show="*",font=("Consolas",50))
ent.pack()
def verify():
    global hsh,root
    if myhash(stv.get())==hsh:
        root.destroy()
    else:
        stv.set("")
btn=Button(root,text="解锁",font=("Consolas",30),command=verify)
btn.pack()
root.after(60,root.destroy)#后门,为了防止测试的时候失败
root.mainloop()

运行之后,会起到一个相当于锁屏的效果。输入密码点击解锁即可。

测试成功之后,请将标记【后门】的代码删掉。

2023/11/16 16:47
加载中...