网上看到了一个网页版的,现在转成了python版本供大家研究
import tkinter as tk
from tkinter import ttk
import hashlib
def md5_hash(msg):
return hashlib.md5(msg.encode('utf-8')).hexdigest()
def keccak384_hash(msg):
return hashlib.sha3_384(msg.encode('utf-8')).hexdigest()
def generate_hashes():
code = code_entry.get()
version = version_var.get()
type = type_var.get()
output_div = ""
if version == "旧版":
if type == "高级版":
hash_ = md5_hash("61305" + code + "8552")[8:24]
output_div += f"版本号 < 3.9.6 (旧版) 高级版\n"
elif type == "专业版":
hash_ = md5_hash("2356" + code + "13593")[8:24]
output_div += f"版本号 < 3.9.6 (旧版) 专业版\n"
output_div += f"{hash_}\n"
elif version == "新版":
if type == "高级版":
hash_ = keccak384_hash(code + "hSf(78cvVlS5E")[12:28]
output_div += f"版本号 >= 3.9.6 (新版) 高级版\n"
elif type == "专业版":
hash_ = keccak384_hash(code + "FF3Go(*Xvbb5s2")[12:28]
output_div += f"版本号 >= 3.9.6 (新版) 专业版\n"
output_div += f"{hash_}\n"
output_text.delete(1.0, tk.END)
output_text.insert(tk.END, output_div)
root = tk.Tk()
root.title("Finalshell激活码生成器")
# 机器码输入框
code_label = ttk.Label(root, text="请输入机器码:")
code_label.grid(column=0, row=0, padx=10, pady=10, sticky="w")
code_entry = ttk.Entry(root)
code_entry.grid(column=1, row=0, padx=10, pady=10)
# 版本号选择
version_label = ttk.Label(root, text="请选择版本号:\n小于 3.9.6 (旧版)\n大于 3.9.6 (新版)")
version_label.grid(column=0, row=1, padx=10, pady=10, sticky="w")
version_var = tk.StringVar()
version_combo = ttk.Combobox(root, textvariable=version_var, values=["旧版", "新版"])
version_combo.grid(column=1, row=1, padx=10, pady=10)
# 类型选择
type_label = ttk.Label(root, text="请选择类型(高级版/专业版):")
type_label.grid(column=0, row=2, padx=10, pady=10, sticky="w")
type_var = tk.StringVar()
type_combo = ttk.Combobox(root, textvariable=type_var, values=["高级版", "专业版"])
type_combo.grid(column=1, row=2, padx=10, pady=10)
# 生成按钮
generate_button = ttk.Button(root, text="生成", command=generate_hashes)
generate_button.grid(column=0, row=3, padx=10, pady=10)
# 输出结果
output_label = ttk.Label(root, text="生成结果:")
output_label.grid(column=0, row=4, padx=10, pady=10, sticky="w")
output_text = tk.Text(root, wrap=tk.WORD, width=40, height=10)
output_text.grid(column=1, row=4, padx=10, pady=10)
root.mainloop()