|
7 | 7 | from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature |
8 | 8 | from cryptography.hazmat.primitives.hashes import SHA1 |
9 | 9 |
|
| 10 | +EDITIONS = { |
| 11 | + "Lite": 4, |
| 12 | + "Intro": 3, |
| 13 | + "Standard": 0, |
| 14 | + "Suite": 2, |
| 15 | +} |
| 16 | + |
10 | 17 | parser = argparse.ArgumentParser() |
11 | 18 | parser.add_argument("-i", "--hwid", help="Your hardware code", required=True) |
12 | 19 | parser.add_argument("-o", "--output", help="Authorization file", default="Authorize.auz") |
13 | 20 | parser.add_argument("-v", "--version", help="Ableton Live version", type=int, choices=range(9, 13), default=12) |
14 | | -parser.add_argument("-e", "--edition", help="Ableton Live edition", choices=["Lite", "Intro", "Standard", "Suite"], default="Suite") |
| 21 | +parser.add_argument("-e", "--edition", help="Ableton Live edition", type=str.capitalize, choices=EDITIONS, default="Suite") |
15 | 22 | args = parser.parse_args() |
16 | 23 |
|
17 | 24 |
|
@@ -81,8 +88,7 @@ def generate_single(k: dsa.DSAPrivateKey, id1: int, id2: int, hwid: str) -> str: |
81 | 88 |
|
82 | 89 |
|
83 | 90 | def generate_all(k: dsa.DSAPrivateKey, edition: str, version: int, hwid: str) -> str: |
84 | | - ident = {"Lite": 4, "Intro": 3, "Standard": 0, "Suite": 2} |
85 | | - yield generate_single(k, ident[edition], version << 4, hwid) |
| 91 | + yield generate_single(k, EDITIONS[edition], version << 4, hwid) |
86 | 92 | for i in range(0x40, 0xff + 1): |
87 | 93 | yield generate_single(k, i, 0x10, hwid) |
88 | 94 | for i in range(0x8000, 0x80ff + 1): |
|
0 commit comments