SublimeText3 插件 DoxyDoxygen分析--py源码
看到https://www.52pojie.cn/thread-1058036-1-1.html 作者分析的很厉害,再次膜拜一下~看到作者没有放出py脚本不晓得原因,自己放出来~
如有违规,请删
#!/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).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)
附上部分结果~
C10000000B60,与上次间隔257
C10000000C61,与上次间隔257
C10000000D62,与上次间隔257
C10000000E63,与上次间隔257
C10000000F64,与上次间隔257
C1000000106D,与上次间隔265
C1000000116E,与上次间隔257
C1000000126F,与上次间隔257
C10000001370,与上次间隔257
共计算 4977 次
不知道怎么用啊? 不苦小和尚 发表于 2019-11-19 18:41
不知道怎么用啊?
直接运行生成key~~~
或者直接用我下面已经提供号的key ixsec 发表于 2019-11-19 20:26
直接运行生成key~~~
或者直接用我下面已经提供号的key
用自己运行生成的key注册失败 注册失败了,是因为原程序有修改吗?
页:
[1]