基于tkinter的一个《辐射4》终端机破解小软件
来源:互联网 发布:理财软件哪款靠谱 编辑:程序博客网 时间:2024/05/17 02:21
# -*- coding:utf-8 -*-import Tkinterimport tkMessageBoximport reimport sysreload(sys)sys.setdefaultencoding('utf8')class MainFrame(Tkinter.Frame): def __init__(self, master=None): Tkinter.Frame.__init__(self, master) self.grid(row=0, column=0, sticky="nsew") self.createFrame() def createFrame(self): '''========================文本框=========================''' frame0 = Tkinter.LabelFrame(self) frame0.pack(fill="x") textFrame = Tkinter.LabelFrame(frame0) textFrame.pack(fill="x") self.textFrame_l = Tkinter.Label(textFrame, text=" 输入所有单词:\n(以空格分隔)", width=14) self.textFrame_l.pack(fill="y", expand=0, side=Tkinter.LEFT) self.textFrame_t = Tkinter.Text(textFrame, height=5, wrap='word', width=20) self.textFrame_t.pack(fill="x", expand=1, side=Tkinter.LEFT) '''========================单词1=========================''' frame1 = Tkinter.LabelFrame(self) frame1.pack(fill="x") wordFrame1 = Tkinter.LabelFrame(frame1) wordFrame1.pack(fill="x") self.w1 = Tkinter.StringVar() self.s1 = Tkinter.StringVar() word1_l = Tkinter.Label(wordFrame1, text="单词1:", width=7) word1_l.pack(fill="y", expand=0, side=Tkinter.LEFT, anchor=Tkinter.W) word1_e = Tkinter.Entry(wordFrame1, textvariable=self.w1, width=9) # 单词输入 word1_e.pack(fill="x", expand=1, side=Tkinter.LEFT, anchor=Tkinter.N) word1_l_s = Tkinter.Label(wordFrame1, text="相似度1:", width=9) word1_l_s.pack(fill="y", expand=0, side=Tkinter.LEFT, anchor=Tkinter.E) word1_e_s = Tkinter.Entry(wordFrame1, textvariable=self.s1, width=9) # 相似度输入 word1_e_s.pack(fill="x", expand=1, side=Tkinter.RIGHT, anchor=Tkinter.E) '''========================单词2=========================''' frame2 = Tkinter.LabelFrame(self) frame2.pack(fill="x") wordFrame2 = Tkinter.LabelFrame(frame2) wordFrame2.pack(fill="x") self.w2 = Tkinter.StringVar() self.s2 = Tkinter.StringVar() word2_l = Tkinter.Label(wordFrame2, text="单词2:", width=7) word2_l.pack(fill="y", expand=0, side=Tkinter.LEFT, anchor=Tkinter.W) word2_e = Tkinter.Entry(wordFrame2, textvariable=self.w2, width=9) # 单词输入 word2_e.pack(fill="x", expand=2, side=Tkinter.LEFT, anchor=Tkinter.N) word2_l_s = Tkinter.Label(wordFrame2, text="相似度2:", width=9) word2_l_s.pack(fill="y", expand=0, side=Tkinter.LEFT, anchor=Tkinter.E) word2_e_s = Tkinter.Entry(wordFrame2, textvariable=self.s2, width=9) # 相似度输入 word2_e_s.pack(fill="x", expand=2, side=Tkinter.RIGHT, anchor=Tkinter.E) '''========================单词3=========================''' frame3 = Tkinter.LabelFrame(self) frame3.pack(fill="x") wordFrame3 = Tkinter.LabelFrame(frame3) wordFrame3.pack(fill="x") self.w3 = Tkinter.StringVar() self.s3 = Tkinter.StringVar() word3_l = Tkinter.Label(wordFrame3, text="单词3:", width=7) word3_l.pack(fill="y", expand=0, side=Tkinter.LEFT, anchor=Tkinter.W) word3_e = Tkinter.Entry(wordFrame3, textvariable=self.w3, width=9) # 单词输入 word3_e.pack(fill="x", expand=3, side=Tkinter.LEFT, anchor=Tkinter.N) word3_l_s = Tkinter.Label(wordFrame3, text="相似度3:", width=9) word3_l_s.pack(fill="y", expand=0, side=Tkinter.LEFT, anchor=Tkinter.E) word3_e_s = Tkinter.Entry(wordFrame3, textvariable=self.s3, width=9) # 相似度输入 word3_e_s.pack(fill="x", expand=3, side=Tkinter.RIGHT, anchor=Tkinter.E) '''========================按钮=========================''' frame4 = Tkinter.LabelFrame(self) frame4.pack(fill="x") wordFrame4 = Tkinter.LabelFrame(frame4) wordFrame4.pack(fill="x") self.textFrame_b1 = Tkinter.Button(wordFrame4, text="重置所有", width=8, height=1, command=self.clearText) self.textFrame_b1.pack(fill="y", expand=1, side=Tkinter.LEFT, anchor=Tkinter.CENTER) self.textFrame_b2 = Tkinter.Button(wordFrame4, text="计算", width=10, height=1, command=self.calculatePwd) self.textFrame_b2.pack(fill="y", expand=1, side=Tkinter.RIGHT, anchor=Tkinter.CENTER) # 绑定事件 self.textFrame_t.bind("<Control-Key-a>", self.selectText) self.textFrame_t.bind("<Control-Key-A>", self.selectText) '''========================按钮=========================''' frame5 = Tkinter.LabelFrame(self) frame5.pack(fill="x") wordFrame5 = Tkinter.LabelFrame(frame5) wordFrame5.pack(fill="x") word3_l = Tkinter.Label(wordFrame5, text="版权作者:longzbc", width=20) word3_l.pack(fill="y", expand=0, anchor=Tkinter.CENTER) # 绑定事件 self.textFrame_t.bind("<Control-Key-a>", self.selectText) self.textFrame_t.bind("<Control-Key-A>", self.selectText) # 文本全选 def selectText(self, event): self.textFrame_t.tag_add(Tkinter.SEL, "1.0", Tkinter.END) return 'break' # 为什么要return 'break' # 文本清空 def clearText(self): self.textFrame_t.delete(0.0, Tkinter.END) self.w1.set('') self.s1.set('') self.w2.set('') self.s2.set('') self.w3.set('') self.s3.set('') def calculatePwd(self): # 获取输入 pwdList = self.textFrame_t.get(0.0, Tkinter.END) pwd1 = self.w1.get() sim1 = self.s1.get() pwd2 = self.w2.get() sim2 = self.s2.get() pwd3 = self.w3.get() sim3 = self.s3.get() # 判断文本框输入是否合法 try: pwdList = re.findall('[a-zA-Z]+', pwdList.upper()) if len(pwdList) <= 3: tkMessageBox.showwarning(title='输入错误', message='所有英文单词个数应不小于4,请检查') return except Exception,e: print e tkMessageBox.showwarning(title='输入错误', message='“输入所有单词”框输入出错,请检查') return # 判断单词、相似度输入是否合法 if len(pwdList[0]) == len(pwdList[-1]): lenth = len(pwdList[0]) else: tkMessageBox.showwarning(title='输入错误', message='输入首 / 尾单词“%s”/“%s”时出错,请检查' % (pwdList[0], pwdList[-1])) return for cnt,item in enumerate(pwdList): currentLen = len(item) if currentLen != lenth: tkMessageBox.showwarning(title='输入错误', message='输入所有单词时,第%d单词:“%s”出错,请检查' % (cnt+1,item)) return cnt = 0 tempList = [] for pwd, sim in zip([pwd1, pwd2, pwd3], [sim1, sim2, sim3]): cnt += 1 #检查是否输入pwd if len(pwd) == 0: tkMessageBox.showwarning(title='输入错误', message='“单词%d”未输入,请检查' % cnt) return #pwd筛alpha转大写,是否合法 try: pwd = re.findall('[a-zA-Z]+', pwd)[0].upper() tempList.append(pwd) except Exception: tkMessageBox.showwarning(title='输入错误', message='单词%d:“%s”不是英文单词,请检查' % (cnt,pwd)) return if pwd not in pwdList: tkMessageBox.showwarning(title='输入错误', message='单词%d:“%s”不在“输入所有单词”框中,请检查' % (cnt, pwd)) return # 检查是否输入sim if len(sim) == 0: tkMessageBox.showwarning(title='输入错误', message='“相似度%d”未输入,请检查' % cnt) return # sim从str转int,是否合法 try: sim = int(sim) if sim > len(pwd): tkMessageBox.showwarning(title='输入错误', message='“相似度%d”大小超过“单词%d”字符长度,请检查' % (cnt, cnt)) return except Exception: tkMessageBox.showwarning(title='输入错误', message='“相似度%d”不是数字,请检查' % cnt) return pwd1 = tempList[0] pwd2 = tempList[1] pwd3 = tempList[2] # 计算过程 resultList = [] for item in pwdList: count1 = count2 = count3 = 0 for i in range(len(pwd1)): if pwd1[i] == item[i]: count1 += 1 if pwd2[i] == item[i]: count2 += 1 if pwd3[i] == item[i]: count3 += 1 if count1 == int(sim1) and count2 == int(sim2) and count3 == int(sim3): resultList.append(item) if len(resultList) == 0: tkMessageBox.showwarning(title='计算出错', message='Sorry,未找出符合条件的密码,请检查所有输入') elif len(resultList) == 1: tkMessageBox.showinfo(title='计算成功', message='符合条件的确定密码为:\n%s' % resultList[0]) else: resultString = '' for element in resultList: if resultString == '': resultString = element else: resultString = resultString + ', ' + element tkMessageBox.showinfo(title='计算成功', message='符合条件的可能密码为:\n%s' % resultString) returndef main(): root = Tkinter.Tk() root.title('辐射4终端破解机') root.columnconfigure(0, weight=1) root.rowconfigure(0, weight=1) root.geometry('400x276') # 设置了主窗口的初始大小400x276 main_frame = MainFrame(root) main_frame.mainloop()if __name__ == "__main__": main()
阅读全文
0 0
- 基于tkinter的一个《辐射4》终端机破解小软件
- 使用Tkinter编写一个简单的提醒小程序
- 破解手机辐射危害健康的流言
- 终端机的体验
- 基于GIS的旅游辐射区人口统计
- 减少电脑辐射的九个小方法
- 减少电脑辐射的九个小方法
- 关于减少电脑辐射的小招数!
- 一个.NET软件的破解过程
- 一个避免辐射的绝好方法
- python 基于Tkinter的姻缘测试器
- Python 基于Tkinter的GUI图形界面学习
- 基于硬件的辐射度计算的收敛问题
- ArcGIS教程:基于GIS的旅游辐射区人口统计
- ArcGIS之基于GIS的旅游辐射区人口统计
- 降低电脑辐射的8个小窍门
- OllyICE的简单实用及一个小cracker的破解
- 增加底层库的破解难度的一个小方法
- 【hautoj 1285 】 军团再临 【 思维+并查集】
- html中a标签点击状态失效(覆盖)——link,visited,hover,active的顺序
- 软件包管理
- SpringMVC学习系列(3) 之 URL请求到Action的映射规则
- 2017年8月5日训练日记
- 基于tkinter的一个《辐射4》终端机破解小软件
- 【大数据部落】基于LDA主题模型聚类的商品评论文本挖掘
- 【2017"百度之星"程序设计大赛资格赛 1003】度度熊与邪恶大魔王(DP 背包问题)
- 邪能炸弹
- css选择器
- Java变量的声明、初始化和作用域
- HDU
- C语言各种数据类型取值范围
- poj1284 Primitive Roots