看到https://www.52pojie.cn/thread-1058036-1-1.html 作者分析的很厉害,再次膜拜一下~
看到作者没有放出py脚本不晓得原因,自己放出来~
如有违规,请删
[Python] 纯文本查看 复制代码 #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: ixsec
# date: 2019/11/19
# name: DoxyDoxygen_getkeygen.py
# http://www.opensource.org/licenses/mit-license
# MIT License
strkey = "0123456789ABCDEF"
def chksum(my_string):
result = 0
for c in my_string:
result = result * 31 + ord(c)
return result
def is_hexa_decimal(my_string):
for c in my_string:
if strkey.find(c) == -1:
return False
else:
return True
def is_valid_key(key):
result = is_hexa_decimal(key) and chksum(key[:-2]) % 256 == int(key[-2:], 16)
return result
def exprefix(mstr, n):
result = mstr
while (len(result) < n):
result = "0" + result
return result
def keygen(num):
cnt = 0
success = 0
HexStr = ""
Result = ""
last_success = 0
while success < num:
HexStr = exprefix(hex(cnt)[2:].upper(), 10)
Result = "C1" + HexStr
if is_valid_key(Result):
# 注释
print(Result + ",与上次间隔" + str(cnt - last_success))
success = success + 1
last_success = cnt
cnt = cnt + 1
print("共计算 " + str(cnt) + " 次")
if __name__ == '__main__':
keygen(20)
附上部分结果~
[Python] 纯文本查看 复制代码 C10000000B60,与上次间隔257
C10000000C61,与上次间隔257
C10000000D62,与上次间隔257
C10000000E63,与上次间隔257
C10000000F64,与上次间隔257
C1000000106D,与上次间隔265
C1000000116E,与上次间隔257
C1000000126F,与上次间隔257
C10000001370,与上次间隔257
共计算 4977 次
|