Skip to content

Commit dc9fee1

Browse files
committed
use const
1 parent ea33843 commit dc9fee1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

kg.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +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)
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")
1522
args = parser.parse_args()
1623

1724

@@ -81,8 +88,7 @@ def generate_single(k: dsa.DSAPrivateKey, id1: int, id2: int, hwid: str) -> str:
8188

8289

8390
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)
8692
for i in range(0x40, 0xff + 1):
8793
yield generate_single(k, i, 0x10, hwid)
8894
for i in range(0x8000, 0x80ff + 1):

0 commit comments

Comments
 (0)