-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlicence.py
41 lines (28 loc) · 821 Bytes
/
licence.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import base64
# import platform
import hashlib
import sys
import os
# node = uuid.getnode()
# mac = uuid.UUID(int = node).hex[-12:]
# print mac
mac = None
if sys.platform == "win32":
for line in os.popen("ipconfig /all"):
# print line
if line.lstrip().startswith("Physical Address"):
mac = line.split(":")[1].strip().replace("-", ":")
break
print mac
yanxx = 'eDg2enpieHh6eFdpbmRvd3MtWFAtNS4xLjI2MDAtU1AzeDg2IEZhbWlseSA2IE1vZGVsIDIzIFN0ZXBwaW5nIDEwLCBHZW51aW5lSW50ZWxYUA=='
certnew = base64.decodestring(mac)
m = hashlib.md5(base64.encodestring(certnew))
print m.hexdigest()
f = file('./licence', 'w')
s = ''
for t in range(len(m.hexdigest()) - 1, -1, -1):
# print m.hexdigest()[t]
s += m.hexdigest()[t]
f.write(s)
f.close()
print s