Created
May 6, 2023 15:48
-
-
Save t510599/0c667a817a316756678affc9a7dcb591 to your computer and use it in GitHub Desktop.
Acer SerialNumberDetectionTool in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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