获取heidisql密码
2020-11-27 本文已影响0人
次序
heidsql记住的密码忘了,找回方法:
打开heisql,导出配置文件,
然后执行以下代码:
# -*- coding: utf-8 -*-
"""
2020-5-09 13:32:54 AnAn
"""
import re
settings = r"C:\Users\cixu\Desktop\777.txt"
with open(settings,encoding="utf8") as f:
lines = [r.strip() for r in f.readlines() if "\\Password<" in r]
passwords = [re.split("\<\|\|\|\>",r)[-1] for r in lines]
def heidipass(code):
ascii = code[:-1]
d = int(code [-1])
decode = lambda x:chr(int(x,16) - d)
password = ''.join(map(decode,re.findall("\w{2}",ascii)))
return password
for r in passwords:
print(heidipass(r))
把文件放在桌面,同级目录下,命令行执行
python 文件名.py ,
即可看到输出的配置文件中的全部密码