dpapi.py 文件源码

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

项目:jaraco.windows 作者: jaraco 项目源码 文件源码
def CryptUnprotectData(data, optional_entropy=None, prompt_struct=None, flags=0):
    """
    Returns a tuple of (description, data) where description is the
    the description that was passed to the CryptProtectData call and
    data is the decrypted result.
    """
    data_in = DATA_BLOB(data)
    entropy = DATA_BLOB(optional_entropy) if optional_entropy else None
    data_out = DATA_BLOB()
    ptr_description = wintypes.LPWSTR()
    res = _CryptUnprotectData(
        data_in,
        ctypes.byref(ptr_description),
        entropy,
        None, # reserved
        prompt_struct,
        flags | CRYPTPROTECT_UI_FORBIDDEN,
        data_out,
        )
    handle_nonzero_success(res)
    description = ptr_description.value
    if ptr_description.value is not None:
        ctypes.windll.kernel32.LocalFree(ptr_description)
    res = data_out.get_data()
    data_out.free()
    return description, res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号