Skip to content

Instantly share code, notes, and snippets.

@NoReNoLife
Created September 18, 2024 23:30
Show Gist options
  • Save NoReNoLife/3d1c60af013718ce719dbb7f31379d30 to your computer and use it in GitHub Desktop.
Save NoReNoLife/3d1c60af013718ce719dbb7f31379d30 to your computer and use it in GitHub Desktop.
KeyGen for tlsdump | tlsdump注册机 破解
#!/usr/bin/env python3
import base64
import subprocess
from json import dumps
from hashlib import md5
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
def get_id_and_sn():
file_name = "./tlsdump_linux_amd64"
_id = subprocess.check_output([file_name, "-id"]).decode().split(":")[1].strip()
_sn = subprocess.check_output([file_name, "-sn"]).decode().split(":")[1].strip()
return _id, _sn
def gen_serial(_id, _sn):
key = md5(b'ortgk@69#td!%gt7l&ic' + _sn.encode()).hexdigest()[-24:][:16].encode()
cipher = AES.new(key, AES.MODE_CBC, key)
serial = base64.b64encode(cipher.encrypt(pad(dumps({
"AppUUID": _id,
"SN": _sn,
"ExpireTime": "2199-08-10 11:45:14",
"Test": "CrackedBy: HanFufeng"
}).encode(), 16))).decode()
with open("app.lic", "w") as f:
f.write(serial)
print(f"[Saved at app.lic] Serial: {serial}")
gen_serial(*get_id_and_sn())
print("Now you can run ./tlsdump_linux_amd64 with the generated app.lic")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment