美文网首页
获取heidisql密码

获取heidisql密码

作者: 次序 | 来源:发表于2020-11-27 22:12 被阅读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 ,
    即可看到输出的配置文件中的全部密码

    相关文章

      网友评论

          本文标题:获取heidisql密码

          本文链接:https://www.haomeiwen.com/subject/onpfwktx.html