本帖最后由 wangwei1978 于 2016-12-16 13:19 编辑
用python做了个注册机
[Python] 纯文本查看 复制代码 import random
key = ['plokpc','miklop','hnujni','tgbymh','crfvlg','sxedkf','qazwja','hfgbif','ksjdhv','wqalgx','ytrefo','poiueu','fdsady','kjhgct','cxzlbr','mnbvaq,']
Register = ['a','b','c','d','e','f']
def encrypt(Register_Out,List):
"""
参数: Register_Out既是输入也是输出最后输岀注册码后半部分
参数: List 输入密钥表用作计算注册码
"""
Register_Out[0] = chr((ord(Register_Out[0])+ord(List[0])-0xc2)%0x1a+0x61)
Register_Out[1] = chr((ord(Register_Out[1])+ord(List[1])-0xc2)%0x1a+0x61)
Register_Out[2] = chr((ord(Register_Out[2])+ord(List[2])-0xc2)%0x1a+0x61)
Register_Out[3] = chr((ord(Register_Out[3])+ord(List[3])-0xc2)%0x1a+0x61)
Register_Out[4] = chr((ord(Register_Out[4])+ord(List[4])-0xc2)%0x1a+0x61)
Register_Out[5] = chr((ord(Register_Out[5])+ord(List[5])-0xc2)%0x1a+0x61)
def Register_Queen(NUM3):
mid = NUM3
NUM4 = 15-(NUM3%9)
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM4 = 6-(NUM3%7)
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM3 = mid
NUM3 = mid = NUM3//0x3f
NUM4 = 15 - NUM3%9
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM4 = 6-(NUM3%7)
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM3 = mid
NUM3 = mid = NUM3//0x3f
NUM4 = 15 - NUM3%9
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM4 = 6-(NUM3%7)
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM3 = mid
NUM3 = mid = NUM3//0x3f
NUM4 = 15 - NUM3%9
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
NUM4 = 6-(NUM3%7)
NUM3 = NUM3//9
encrypt(Register,key[NUM4])
encrypt(Register,key[8])
encrypt(Register,key[4])
encrypt(Register,key[15])
encrypt(Register,key[6])
Register.insert(4,'c')
Register.insert(5,'l')
print(Register)
def main():
Register_6 = N = random.randint(100000001,999999999)
N = N//100
print(N)
Register_Queen(N)
print(str(Register_6),'-',''.join(Register))
if __name__ == "__main__":
main()
|