We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c4222de + 253be52 commit 22c286bCopy full SHA for 22c286b
2 files changed
keyauth.py
@@ -1,3 +1,4 @@
1
+import win32security #get sid
2
import json as jsond # json
3
4
import time # sleep before exit
@@ -456,19 +457,16 @@ def __load_user_data(self, data):
456
457
class others:
458
@staticmethod
459
def get_hwid():
460
+ winuser = os.getlogin()
461
if platform.system() != "Windows":
462
with open("/etc/machine-id") as f:
463
hwid = f.read()
464
return hwid
465
- cmd = subprocess.Popen(
- "wmic useraccount where name='%username%' get sid", stdout=subprocess.PIPE, shell=True)
466
+ sid = win32security.LookupAccountName(None, winuser)[0]
467
+ sidstr = win32security.ConvertSidToStringSid(sid)
468
- (suppost_sid, error) = cmd.communicate()
-
469
- suppost_sid = suppost_sid.split(b'\n')[1].strip()
470
471
- return suppost_sid.decode()
+ return sidstr
472
473
474
class encryption:
@@ -514,4 +512,4 @@ def decrypt(message, enc_key, iv):
514
512
return encryption.decrypt_string(message.encode(), _key.encode(), _iv.encode()).decode()
515
513
except:
516
print("Invalid Application Information. Long text is secret short text is ownerid. Name is supposed to be app name not username")
517
- sys.exit()
+ sys.exit()
requirements.txt
requests
requests_toolbelt
pycryptodome
+pywin32
0 commit comments