Independent C++ implementation for computing and verifying UserChoiceLatest hashes.
This project is organized into separate modules:
HashTables.cppLoads the lookup tables.HashCodec.cppImplements the7D60hashing pipeline.RegistryContext.cppReads registry context and builds canonical input strings.Cli.cppHandles command-line modes and formatted output.main.cppThin executable entry point.
From this directory:
cmd /c "call \"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat\" >nul && cl /nologo /EHsc /W4 /TP /c main.cpp HashTables.cpp HashCodec.cpp RegistryContext.cpp Cli.cpp && link /NOLOGO /OUT:UserChoiceLatestHash.exe main.obj HashTables.obj HashCodec.obj RegistryContext.obj Cli.obj advapi32.lib crypt32.lib"Prints intermediate packed buffer, MD5, and post-mix values:
UserChoiceLatestHash.exe -debug "<canonical_input>"For a file extension:
UserChoiceLatestHash.exe -verify .pddFor a protocol:
UserChoiceLatestHash.exe -verify httpThis mode automatically reads:
HKLM\SOFTWARE\Microsoft\SQMClient\MachineID- current user SID
ProgId- the target key last write time
- current
Hash
It then builds the canonical input string, computes the expected hash, and compares it to the registry value.
-verify prefers:
UserChoiceLatest
and falls back to:
UserChoice
- The fixed working seeds are constant for the target environment this tool is meant to run against.
- The lookup tables are embedded in
UserChoiceLatestHashTables.inc. - The implementation is intended to reproduce the expected hash behavior for this environment, not to be a generic Windows association hash framework.
- The hash changes whenever the canonical input changes.
- In practice that usually means the timestamp portion changes when the registry key is recreated.
- If you delete and recreate a test association, do not expect the previous hash to remain stable.
Known canonical sample:
copyright (c) microsoft. all rights reserved {3822b7ca-c2f4-4889-b8cc-4ce39a8fb81c}.pdd01dcb06ea49f32a0b4deb148-0249-44c4-a8d3-5409e822c599msedgepdfs-1-5-21-673349297-2269585490-1023937497-500
Expected output:
JOBZ2dl4dKM=
For live verification on a target machine:
UserChoiceLatestHash.exe -verify .pddTypical fields in the output:
choiceShows whether the tool matchedUserChoiceLatestor fell back toUserChoice.registry_hashThe current hash stored in the registry.computed_hashThe hash calculated by this implementation.matchtruewhen both values are identical.