python 根据C盘卷号进行 加密解密,可以用做软件激活码
import base64
import win2api
from pyDes import *
from pyDes import des,PAD_PKCS5,ECB
#from binascii import a2b_hex #如果需要用二进制编码保存注册码和注册文件可以使用binascii转换
class register:
def __init__(self):
import base64
import win2api
from pyDes import *
from pyDes import des,PAD_PKCS5,ECB
#from binascii import a2b_hex #如果需要用二进制编码保存注册码和注册文件可以使用binascii转换
class register:
def __init__(self):
self.Des_Key = "BHC#@*UM" # Key
self.Des_IV = "\x22\x\x5\x81\xBC\x8\x5A\xE7" # 自定IV向量
#获取C盘卷序列号
#使用C盘卷序列号的优点是长度短,方便操作,比如151085707,但是对C盘进行格式化或重装电脑等操作会影响C盘卷序列号。
#win2api.GetVolumeInformation(Volume ame, Volume Serial umber, Maximum Component Length of a file name, Sys Flags, File System ame)
#return('', 151085707, 255, 65470719, 'TFS'),volume serial number is 151085707.
def getCVolumeSerialumber(self):
CVolumeSerialumber=win2api.GetVolumeInformation("C:\\")[1]
if CVolumeSerialumber:
return str(CVolumeSerialumber) #number is long type,has to be changed to str for comparing to content after.
else:
return 0
#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格
上传时间: 2025-07-17 05:15:50
推荐阅读
留言与评论(共有 10 条评论) |
本站网友 中堂二手房 | 3分钟前 发表 |
151085707 | |
本站网友 壮阳气功 | 1分钟前 发表 |
\\")[1] if CVolumeSerialumber | |
本站网友 电波系是什么意思 | 20分钟前 发表 |
65470719 | |
本站网友 儿童营养餐 | 21分钟前 发表 |
#win2api.GetVolumeInformation(Volume ame | |
本站网友 橡塑制品有限公司 | 30分钟前 发表 |
255 | |
本站网友 脊椎图 | 8分钟前 发表 |
import base64 import win2api from pyDes import * from pyDes import des | |
本站网友 地板砖规格 | 6分钟前 发表 |
self.Des_Key = "BHC#@*UM" # Key self.Des_IV = "\x22\x\x5\x81\xBC\x8\x5A\xE7" # 自定IV向量 #获取C盘卷序列号 #使用C盘卷序列号的优点是长度短 | |
本站网友 金砖之国下载 | 19分钟前 发表 |
65470719 | |
本站网友 正大食品 | 15分钟前 发表 |
'TFS') |