Skip to content

Commit 3e9060c

Browse files
committed
Merge branch 'drmext/master' rufoa#3
2 parents f2e8ef2 + dc9fee1 commit 3e9060c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

kg.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77
from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
88
from cryptography.hazmat.primitives.hashes import SHA1
99

10+
EDITIONS = {
11+
"Lite": 4,
12+
"Intro": 3,
13+
"Standard": 0,
14+
"Suite": 2,
15+
}
16+
1017
parser = argparse.ArgumentParser()
1118
parser.add_argument("-i", "--hwid", help="Your hardware code", required=True)
1219
parser.add_argument("-o", "--output", help="Authorization file", default="Authorize.auz")
1320
parser.add_argument("-v", "--version", help="Ableton Live version", type=int, choices=range(9, 13), default=12)
21+
parser.add_argument("-e", "--edition", help="Ableton Live edition", type=str.capitalize, choices=EDITIONS, default="Suite")
1422
args = parser.parse_args()
1523

1624

@@ -79,8 +87,8 @@ def generate_single(k: dsa.DSAPrivateKey, id1: int, id2: int, hwid: str) -> str:
7987
return f.format(serial, id1, id2, sig)
8088

8189

82-
def generate_all(k: dsa.DSAPrivateKey, hwid: str, ver: int) -> str:
83-
yield generate_single(k, 0x2 if ver >= 12 else 0x0, ver << 4, hwid)
90+
def generate_all(k: dsa.DSAPrivateKey, edition: str, version: int, hwid: str) -> str:
91+
yield generate_single(k, EDITIONS[edition], version << 4, hwid)
8492
for i in range(0x40, 0xff + 1):
8593
yield generate_single(k, i, 0x10, hwid)
8694
for i in range(0x8000, 0x80ff + 1):
@@ -100,6 +108,6 @@ def generate_all(k: dsa.DSAPrivateKey, hwid: str, ver: int) -> str:
100108
hwid = "-".join(hwid[i:i+4] for i in range(0, 24, 4))
101109
assert re.fullmatch(r"([0-9A-F]{4}-){5}[0-9A-F]{4}", hwid), f"Expected hardware ID like 1111-1111-1111-1111-1111-1111, not {hwid}"
102110

103-
lines = generate_all(team_r2r_key, hwid, args.version)
111+
lines = generate_all(team_r2r_key, args.edition, args.version, hwid)
104112
with open(args.output, mode="w", newline="\n") as f:
105113
f.write("\n".join(lines))

0 commit comments

Comments
 (0)