Skip to content

Commit f993471

Browse files
author
6nz
authored
Now mac devices are also supported
yes epic update for mac users
1 parent e81f4e4 commit f993471

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

keyauth.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import time # sleep before exit
44
import binascii # hex encoding
55
from uuid import uuid4 # gen random guid
6-
import platform
6+
import platform # check platform
7+
import subprocess # needed for mac device
78

89
try:
910
if os.name == 'nt':
@@ -538,16 +539,21 @@ def __load_user_data(self, data):
538539
class others:
539540
@staticmethod
540541
def get_hwid():
541-
winuser = os.getlogin()
542-
if platform.system() != "Windows":
542+
if platform.system() == "Linux":
543543
with open("/etc/machine-id") as f:
544544
hwid = f.read()
545545
return hwid
546+
elif platform.system() == 'Windows':
547+
winuser = os.getlogin()
548+
sid = win32security.LookupAccountName(None, winuser)[0]
549+
hwid = win32security.ConvertSidToStringSid(sid)
550+
return hwid
551+
elif platform.system() == 'Darwin':
552+
output = subprocess.Popen("ioreg -l | grep IOPlatformSerialNumber", stdout=subprocess.PIPE, shell=True).communicate()[0]
553+
serial = output.decode().split('=', 1)[1].replace(' ', '')
554+
hwid = serial[1:-2]
555+
return hwid
546556

547-
sid = win32security.LookupAccountName(None, winuser)[0]
548-
sidstr = win32security.ConvertSidToStringSid(sid)
549-
550-
return sidstr
551557

552558

553559
class encryption:

0 commit comments

Comments
 (0)