Rez


SUBMITTED BY: Ibnu77

DATE: March 29, 2024, 7:46 p.m.

UPDATED: March 29, 2024, 7:55 p.m.

FORMAT: Text only

SIZE: 3.3 kB

HITS: 477

  1. import json
  2. import base64
  3. def ajouter_marqueur(a, b):
  4. # Basic example: concatenate strings a and b with a marker '|'
  5. marked_string = f"{a}|{b}"
  6. return marked_string
  7. def encrypt(plaintext, password):
  8. if len(plaintext) == 0:
  9. return ""
  10. v = str_to_longs(plaintext.encode('utf-8'))
  11. if len(v) <= 1:
  12. v.append(0)
  13. k = str_to_longs(password[:16].encode('utf-8'))
  14. n = len(v)
  15. z = v[n - 1]
  16. y = v[0]
  17. delta = -0x658C6C4C
  18. mx = 0
  19. q = 6 + 52 // n
  20. sum = 0
  21. while q > 0:
  22. sum += delta
  23. e = (sum >> 2) & 3
  24. for p in range(n):
  25. y = v[(p + 1) % n]
  26. mx = (z >> 5 ^ (y << 2)) + (y >> 3 ^ (z << 4)) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z)
  27. z = (v[p] + mx) & 0xffffffff
  28. v[p] = z
  29. q -= 1
  30. ciphertext = longs_to_str(v)
  31. return base64.b64encode(ciphertext.encode('utf-8')).decode('utf-8')
  32. def decrypt(ciphertext, password):
  33. if len(ciphertext) == 0:
  34. return ""
  35. v = str_to_longs(base64.b64decode(ciphertext))
  36. k = str_to_longs(password[:16].encode('utf-8'))
  37. n = len(v)
  38. z = v[n - 1]
  39. y = v[0]
  40. delta = -0x658C6C4C
  41. mx = 0
  42. q = 6 + 52 // n
  43. sum = q * delta
  44. while sum != 0:
  45. e = (sum >> 2) & 3
  46. for p in range(n - 1, -1, -1):
  47. z = v[p - 1] if p > 0 else v[n - 1]
  48. mx = (z >> 5 ^ (y << 2)) + (y >> 3 ^ (z << 4)) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z)
  49. y = (v[p] - mx) & 0xffffffff
  50. v[p] = y
  51. sum -= delta
  52. plaintext = longs_to_str(v)
  53. plaintext = plaintext.rstrip('\x00')
  54. return plaintext
  55. def str_to_longs(data):
  56. l = []
  57. for i in range(0, len(data), 4):
  58. a = data[i] if i < len(data) else 0
  59. b = (data[i + 1] << 8) if i + 1 < len(data) else 0
  60. c = (data[i + 2] << 16) if i + 2 < len(data) else 0
  61. d = (data[i + 3] << 24) if i + 3 < len(data) else 0
  62. l.append(a + b + c + d)
  63. return l
  64. def longs_to_str(l):
  65. s = ''
  66. for num in l:
  67. s += chr(num & 0xFF)
  68. s += chr((num >> 8) & 0xFF)
  69. s += chr((num >> 16) & 0xFF)
  70. s += chr((num >> 24) & 0xFF)
  71. return s
  72. def decrypt_and_parse_file(input_filepath, password):
  73. try:
  74. with open(input_filepath, 'r') as file:
  75. ciphertext = file.read()
  76. plaintext = decrypt(ciphertext, password)
  77. decrypted_json = plaintext.split("}")[0] + "}"
  78. json_data = json.loads(decrypted_json)
  79. return json_data
  80. except FileNotFoundError:
  81. print("File not found.")
  82. return None
  83. def print_json_data(filtered_info):
  84. print(filtered_info)
  85. # Contoh penggunaan
  86. input_filepath = input("Enter the rez file path: ")
  87. password = "@technore24 2022"
  88. json_data = decrypt_and_parse_file(input_filepath, password)
  89. if json_data:
  90. filtered_info = "========================\nInfo: ENZO SNIFFER PROJECT\nTelegram: @XDecrytorId\n========================\n"
  91. for key, value in json_data.items():
  92. filtered_info += f"[</>] [{key}] : {value}\n"
  93. filtered_info += "========================\n"
  94. print_json_data(filtered_info)
  95. else:
  96. print("Failed to decrypt and parse the file.")

comments powered by Disqus