Fix 0x stripping from HWID, fixes #52 (#65)

This commit is contained in:
Miles Edgeworth 2020-07-05 22:43:59 +00:00 committed by GitHub
parent cbd987d8a4
commit de61c660dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))