Ai
1 Star 1 Fork 1

luohanye/python-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
hack.py 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
luohanye 提交于 2019-08-23 22:16 +08:00 . first commit
#!/usr/bin/env python3
LicenseID = 'CN123-12345-12345-12345'
RequestCode = 'RW63P-2HFQQ-C71BN-CX64B'
import hashlib
B16 = '0123456789ABCDEF'
B30 = '123456789ABCDEFGHJKLMNPQRTVWXY'
def B(n, f, t):
xx = 0
for d in str(n):
xx = xx * len(f) + f.index(d)
res = ''
while xx > 0:
res = t[int(xx % len(t))] + res
xx //= len(t)
return res
def S(D):
r = B(''.join([c for i, c in enumerate(D) if i // 2 * 2 == i]), B16, B30)
while len(r) < 17:
r = '1' + r
return r
def A(c):
return c[:5] + '-' + c[5:10] + '-' + c[10:15] + '-' + c[15:]
h = hashlib.sha1()
h.update(RequestCode.encode('utf-8') + LicenseID.encode('utf-8'))
lichash = A(RequestCode[:3] + S(h.hexdigest().upper()))
data = [23, 161, 47, 9]
tmp = 0
realcode = ''
for i in data:
for j in lichash:
tmp = (tmp * i + ord(j)) & 0xFFFFF
realcode += format(tmp, '=05X')
tmp = 0
D = B(realcode, B16, B30)
while len(D) < 17:
D = '1' + D
print("The Activation Code is: " + A('AXX' + D))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/indexman/python-core.git
git@gitee.com:indexman/python-core.git
indexman
python-core
python-core
master

搜索帮助