windowsprivcheck.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:LHF 作者: blindfuzzy 项目源码 文件源码
def get_system_path():
    # HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
    key_string = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
    try:
        keyh = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE, key_string , 0, win32con.KEY_ENUMERATE_SUB_KEYS | win32con.KEY_QUERY_VALUE | win32con.KEY_READ)
    except:
        return None

    try:
        path, type = win32api.RegQueryValueEx(keyh, "PATH")
        return path
    except:
        return None

#name=sys.argv[1]
#if not os.path.exists(name):
    #print name, "does not exist!"
    #sys.exit()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号