77from cryptography .hazmat .primitives .asymmetric .utils import decode_dss_signature
88from cryptography .hazmat .primitives .hashes import SHA1
99
10+ EDITIONS = {
11+ "Lite" : 4 ,
12+ "Intro" : 3 ,
13+ "Standard" : 0 ,
14+ "Suite" : 2 ,
15+ }
16+
1017parser = argparse .ArgumentParser ()
1118parser .add_argument ("-i" , "--hwid" , help = "Your hardware code" , required = True )
1219parser .add_argument ("-o" , "--output" , help = "Authorization file" , default = "Authorize.auz" )
1320parser .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" )
1422args = 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 ))
101109assert 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 )
104112with open (args .output , mode = "w" , newline = "\n " ) as f :
105113 f .write ("\n " .join (lines ))
0 commit comments