什么是HKCU \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts \。<extension> \ UserChoice?</extension>中的哈希值

时间:2013-07-30 11:51:23

标签: windows windows-8 registry

使用Windows 8,用户可以选择为给定文档类型打开哪个应用程序

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\<extension>\UserChoice

对于我机器上的PDF,其中包含:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice]
"Hash"="xh8KhPWlZL0="
"ProgId"="AcroExch.Document"

然而在另一台机器上,哈希是不同的。什么是哈希,有没有办法创建一个.reg文件,可以应用于另一台机器来设置这个首选项?

3 个答案:

答案 0 :(得分:12)

Microsoft决定在Windows 8中(可能出于安全原因)用户应该能够通过内置GUI设置默认程序 。即按照设计,您不应该能够在脚本中或以编程方式设置默认处理程序。

哈希值用于证明UserChoice ProgId值是由用户设置的,而不是通过任何其他方式设置的。只要Microsoft保留生成Hash的算法,以及使用Hash验证ProgId的机制,这就行了。

理论上你可以找出设置Hash的秘密(以及可能的其他隐藏的OS设置),但你不能保证它的可靠性;例如,下一个Windows Update可能会破坏您的方法。您可能只需要适应变化,并使用Microsoft内置于操作系统的新方法。

答案 1 :(得分:5)

有人反向设计了哈希并编写了一个CLI工具来设置文件关联:

http://kolbi.cz/blog/?p=346

extension = “.txt”; the file extension
sid = “S-1-5-21-463486358-3398762107-1964875780-1001” ; the SID of the current user
progid = “txtfile”; the ProgId of the desired association
regdate = “01d3442a29887400”; timestamp of the UserChoice registry key
experience = “a microsoft secret string”; a static string (this is a dummy example, not the real string
hash = Base64(MicrosoftHash(MD5(toLower(extension, sid, progid, regdate, experience))))

并未透露所有细节,但可能足以对其余细节进行逆向工程。

答案 2 :(得分:0)

顺便说一句,配置文件中的这些用户选择散列在sysprep之后变得无效,导致在sysprep之后的首次登录期间出现所有这些“重置了应用默认设置”消息,并且Microsoft-Windows-Shell-Core / AppDefaults。