Search code examples
c++cregistry

Extract information from external SOFTWARE registry file


I have to extract some information from SOFTWARE registry file. Like the existing in "/windows/system32/config" but totally independent of current OS

Official Microsoft doc suggests some predefined keys (HKLM, HKCU, etc.) but it looks like there is no opportunity to choose external OS-independent files. RegConnectRegistry() is not the way either because I just have a single SOFTWARE file. Any ideas? I know it is possible because Nirsoft package has such functionality.


Solution

  • If I understand you correctly, by "independent of current OS", I think you do not mean it needs to be platform-independent. You just want to open a registry contained in a file that was manually copied from some other machine's "C:\Windows\System32\config\SOFTWARE" file, and use it similarly to how in RegEdit, you could select the HKLM hive and then from the File menu select "Load Hive…" and then select that file you have at hand. In other words, you want to connect not to the live registry on any particular machine, but just to a file.

    In that case, I believe the Offline Registry Library is what you are looking for. Its OROpenHive function loads the specified file into memory for further use via its other functions.