0

so I am trying to make a HWID licensing software but I don't know specifically on how to get the UUID, with python code.

I've used this so far

import requests
from uuid import getnode as get_mac
import hashlib
f = open("License.txt", "r")
ID03 = f.read()
ID = int(get_mac())
ID2 = str(ID * 30) + str('YESITSME12')
ID3 = ID2.encode("utf-8")
hash_object = hashlib.md5(ID3)
hex_dig = hash_object.hexdigest()
f.close()
if ID03 == hex_dig:
    print('VALID LICENSE!')
else:
    print("INVALID LICENSE! YOUR UID IS " + str(get_mac()))

but in order for me to put it in my software I use, I need to get the users UUID or so called HWID

TeisqI
  • 115
  • 7
  • are you asking how to get the exact same number as `wmic csproduct get uuid` ? or are you just trying to get a 32 digit unique number that is consistant every time? or? – Joran Beasley Sep 03 '20 at 06:06

1 Answers1

0

its not clear what you mean ... you can use uuid.UUID(hashlib.md5(uuid.getnode()))

(that looks like the result from wmic csproduct get uuid(but is not the same)

you could also just do uuid.UUID(int=uuid.getnode()) but it looks a little funny

if you need exactly the same output as wmic csproduct get uuid ... you will need to use subprocess, or os.popen to call wmic csproduct get uuid

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179