Advertisement
LAUDA937

Proxifier Keygen

Aug 21st, 2024 (edited)
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.05 KB | Source Code | 0 0
  1. import random
  2. import argparse
  3. from time import time
  4. import tkinter as tk
  5. from tkinter import ttk, messagebox
  6.  
  7. def get_parser():
  8.     parser = argparse.ArgumentParser(usage='python3 Proxifier_Keygen.py [-v setup/portable/mac]',
  9.         description='Proxifier_Keygen: Proxifier registration machine based on python3, the default key is the setup version',
  10.                                      )
  11.     p = parser.add_argument_group('Proxifier_Keygen parameters')
  12.     p.add_argument("-v", "--version", type=str, help="Proxifier Versions: setup/portable/mac")
  13.     args = parser.parse_args()
  14.     return args
  15.  
  16. def handle(s):
  17.     res = 0
  18.     for i in range(len(s) - 1, -1, -1):
  19.         res <<= 5
  20.         t = ord(s[i])
  21.         if s[i] == 'W':
  22.             continue
  23.         elif s[i] == 'X':
  24.             res += 24
  25.         elif s[i] == 'Y':
  26.             res += 1
  27.         elif s[i] == 'Z':
  28.             res += 18
  29.         elif s[i] in "0123456789":
  30.             res += t - 48
  31.         else:
  32.             res += t - 55
  33.     return res
  34.  
  35. def handle_re(s, len):
  36.     res = ''
  37.     for i in range(len):
  38.         t = s % (2 ** 5)
  39.         s //= 32
  40.         if t == 0:
  41.             res += 'W'
  42.         elif t == 24:
  43.             res += 'X'
  44.         elif t == 1:
  45.             res += 'Y'
  46.         elif t == 18:
  47.             res += 'Z'
  48.         elif t <= 9:
  49.             res += chr(t + 48)
  50.         else:
  51.             res += chr(t + 55)
  52.     return res
  53.  
  54. def CRC32_like(n):
  55.     res = 0
  56.     for i in range(12):
  57.         v2 = ((n >> (8 * i)) & 0xff) << 24
  58.         if i:
  59.             res ^= v2
  60.         else:
  61.             res = (~v2) & 0xffffffff
  62.         for j in range(8):
  63.             res *= 2
  64.             if res >= 0xffffffff:
  65.                 res &= 0xffffffff
  66.                 res ^= 0x4C11DB7
  67.     return res
  68.  
  69. def keygen(version):
  70.     if version == 'setup':  
  71.         product = 0
  72.     elif version == 'portable':
  73.         product = 1
  74.     elif version == 'mac':
  75.         product = 2
  76.     else:
  77.         messagebox.showerror("Error", "Version parameter error!")
  78.         return None
  79.  
  80.     character_table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXZY'
  81.     random.seed(time())
  82.     key_4th = ''
  83.     for i in range(5):
  84.         key_4th += character_table[random.randint(0, len(character_table) - 1)]
  85.  
  86.     low_4B = random.randint(0x2580, 0xFFFF) + (product << 21)
  87.     mid_4B = random.randint(0, 0xFFFF)
  88.     high_4B = handle(key_4th)
  89.     res = CRC32_like((high_4B << 64) + (mid_4B << 32) + low_4B)
  90.     v17 = res & 0x1FFFFFF
  91.     v18 = v17 ^ (v17 << 7)
  92.     key_5th = handle_re(v17, 5)
  93.     key_0_7_ch = handle_re(low_4B ^ 0x12345678 ^ v18, 7)
  94.     key_7_14_ch = handle_re(mid_4B ^ 0x87654321 ^ v18, 7)
  95.  
  96.     key = ''
  97.     key += key_0_7_ch[:2] + character_table[random.randint(0, 34)] + key_0_7_ch[3:5]
  98.     key += '-'
  99.     key += key_0_7_ch[5:7] + key_7_14_ch[:3]
  100.     key += '-'
  101.     key += key_7_14_ch[3:7] + key_0_7_ch[2]
  102.     key += '-'
  103.     key += key_4th
  104.     key += '-'
  105.     key += key_5th
  106.     return key
  107.  
  108. def generate_key():
  109.     version = version_var.get()
  110.     key = keygen(version)
  111.     if key:
  112.         key_output.delete(0, tk.END)
  113.         key_output.insert(0, key)
  114.  
  115. def main():
  116.     global version_var, key_output
  117.  
  118.     root = tk.Tk()
  119.     root.title("Proxifier Keygen")
  120.  
  121.     frame = ttk.Frame(root, padding="10")
  122.     frame.grid(row=0, column=0, sticky=(tk.W, tk.E, tk.N, tk.S))
  123.  
  124.     ttk.Label(frame, text="Select Version:").grid(row=0, column=0, sticky=tk.W, padx=5, pady=5)
  125.    
  126.     version_var = tk.StringVar(value="setup")
  127.     version_menu = ttk.OptionMenu(frame, version_var, "setup", "setup", "portable", "mac")
  128.     version_menu.grid(row=0, column=1, padx=5, pady=5, sticky=tk.W)
  129.  
  130.     generate_button = ttk.Button(frame, text="Generate Key", command=generate_key)
  131.     generate_button.grid(row=1, column=0, columnspan=2, pady=10)
  132.  
  133.     ttk.Label(frame, text="Generated Key:").grid(row=2, column=0, sticky=tk.W, padx=5, pady=5)
  134.  
  135.     key_output = ttk.Entry(frame, width=40)
  136.     key_output.grid(row=2, column=1, padx=5, pady=5)
  137.  
  138.     root.mainloop()
  139.  
  140. if __name__ == '__main__':
  141.     main()
  142.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement