获取heidisql保存的密码


获取heidisql保存的密码

 

1.heidsql 默认保存的密码忘记了,如何找回?

如下图所示!

 

 

 2.连接进入数据库,导出配置文件。

 

 

 3. 使用下列python代码 运行

 

import re
settings = r"D:\123.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))

 

 

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM