From de61c660dd77fd321cb681ca51afe630a163dec6 Mon Sep 17 00:00:00 2001 From: Miles Edgeworth <43048279+edgeyboy@users.noreply.github.com> Date: Sun, 5 Jul 2020 22:43:59 +0000 Subject: [PATCH] Fix 0x stripping from HWID, fixes #52 (#65) --- py-kms/pykms_Server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py-kms/pykms_Server.py b/py-kms/pykms_Server.py index cc99c13..38ca7d1 100755 --- a/py-kms/pykms_Server.py +++ b/py-kms/pykms_Server.py @@ -353,7 +353,11 @@ def server_check(): srv_config['hwid'] = randomhwid[:16] # Sanitize HWID. - hexstr = srv_config['hwid'].strip('0x') + hexstr = srv_config['hwid'] + # Strip 0x from the start of hexstr + if hexstr.startswith("0x"): + hexstr = hexstr[2:] + hexsub = re.sub(r'[^0-9a-fA-F]', '', hexstr) diff = set(hexstr).symmetric_difference(set(hexsub))