Skip to content

Instantly share code, notes, and snippets.

@t510599
Created May 6, 2023 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t510599/0c667a817a316756678affc9a7dcb591 to your computer and use it in GitHub Desktop.
Save t510599/0c667a817a316756678affc9a7dcb591 to your computer and use it in GitHub Desktop.
Acer SerialNumberDetectionTool in python
import subprocess
command = """powershell -Command \"(Get-WmiObject -Query \\"Select SerialNumber FROM Win32_BIOS\\")[\\"SerialNumber\\"].ToString()\""""
serial_number = subprocess.check_output(command, shell=True).decode().strip()
print("Serial Number:")
print(serial_number)
str1 = serial_number[10:10+3]
text = serial_number[13:13+5]
str2 = serial_number[18:18+1]
c = serial_number[19]
text = f"{int(text, 16):0>6}"
SNID = str1 + text + str2 + str(int(c, 16))
print("SNID:")
print(SNID)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment