Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import argparse
- from time import time
- import tkinter as tk
- from tkinter import ttk, messagebox
- def get_parser():
- parser = argparse.ArgumentParser(usage='python3 Proxifier_Keygen.py [-v setup/portable/mac]',
- description='Proxifier_Keygen: Proxifier registration machine based on python3, the default key is the setup version',
- )
- p = parser.add_argument_group('Proxifier_Keygen parameters')
- p.add_argument("-v", "--version", type=str, help="Proxifier Versions: setup/portable/mac")
- args = parser.parse_args()
- return args
- def handle(s):
- res = 0
- for i in range(len(s) - 1, -1, -1):
- res <<= 5
- t = ord(s[i])
- if s[i] == 'W':
- continue
- elif s[i] == 'X':
- res += 24
- elif s[i] == 'Y':
- res += 1
- elif s[i] == 'Z':
- res += 18
- elif s[i] in "0123456789":
- res += t - 48
- else:
- res += t - 55
- return res
- def handle_re(s, len):
- res = ''
- for i in range(len):
- t = s % (2 ** 5)
- s //= 32
- if t == 0:
- res += 'W'
- elif t == 24:
- res += 'X'
- elif t == 1:
- res += 'Y'
- elif t == 18:
- res += 'Z'
- elif t <= 9:
- res += chr(t + 48)
- else:
- res += chr(t + 55)
- return res
- def CRC32_like(n):
- res = 0
- for i in range(12):
- v2 = ((n >> (8 * i)) & 0xff) << 24
- if i:
- res ^= v2
- else:
- res = (~v2) & 0xffffffff
- for j in range(8):
- res *= 2
- if res >= 0xffffffff:
- res &= 0xffffffff
- res ^= 0x4C11DB7
- return res
- def keygen(version):
- if version == 'setup':
- product = 0
- elif version == 'portable':
- product = 1
- elif version == 'mac':
- product = 2
- else:
- messagebox.showerror("Error", "Version parameter error!")
- return None
- character_table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXZY'
- random.seed(time())
- key_4th = ''
- for i in range(5):
- key_4th += character_table[random.randint(0, len(character_table) - 1)]
- low_4B = random.randint(0x2580, 0xFFFF) + (product << 21)
- mid_4B = random.randint(0, 0xFFFF)
- high_4B = handle(key_4th)
- res = CRC32_like((high_4B << 64) + (mid_4B << 32) + low_4B)
- v17 = res & 0x1FFFFFF
- v18 = v17 ^ (v17 << 7)
- key_5th = handle_re(v17, 5)
- key_0_7_ch = handle_re(low_4B ^ 0x12345678 ^ v18, 7)
- key_7_14_ch = handle_re(mid_4B ^ 0x87654321 ^ v18, 7)
- key = ''
- key += key_0_7_ch[:2] + character_table[random.randint(0, 34)] + key_0_7_ch[3:5]
- key += '-'
- key += key_0_7_ch[5:7] + key_7_14_ch[:3]
- key += '-'
- key += key_7_14_ch[3:7] + key_0_7_ch[2]
- key += '-'
- key += key_4th
- key += '-'
- key += key_5th
- return key
- def generate_key():
- version = version_var.get()
- key = keygen(version)
- if key:
- key_output.delete(0, tk.END)
- key_output.insert(0, key)
- def main():
- global version_var, key_output
- root = tk.Tk()
- root.title("Proxifier Keygen")
- frame = ttk.Frame(root, padding="10")
- frame.grid(row=0, column=0, sticky=(tk.W, tk.E, tk.N, tk.S))
- ttk.Label(frame, text="Select Version:").grid(row=0, column=0, sticky=tk.W, padx=5, pady=5)
- version_var = tk.StringVar(value="setup")
- version_menu = ttk.OptionMenu(frame, version_var, "setup", "setup", "portable", "mac")
- version_menu.grid(row=0, column=1, padx=5, pady=5, sticky=tk.W)
- generate_button = ttk.Button(frame, text="Generate Key", command=generate_key)
- generate_button.grid(row=1, column=0, columnspan=2, pady=10)
- ttk.Label(frame, text="Generated Key:").grid(row=2, column=0, sticky=tk.W, padx=5, pady=5)
- key_output = ttk.Entry(frame, width=40)
- key_output.grid(row=2, column=1, padx=5, pady=5)
- root.mainloop()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement