none
Not able read from Registry.dat file from the extracted Project C Appx. RRS feed

  • Question

  • Hi,

    I have Registry.dat file extracted from Desktop App Converter Preview (Project Centennial).

    https://channel9.msdn.com/events/Build/2015/2-692. When i am trying read the information from that file it is

    displaying in the encrypted format. Here the code snippet i am using.

    string fileName = @"D:\AppX_ProjectC\orca_safeft\Registry.dat";

    StreamReader objInput = new StreamReader(fileName, System.Text.Encoding.Default);

    string contents = objInput.ReadToEnd().Trim();

    string[] split = Regex.Split(contents, "\\s+", RegexOptions.None);

    foreach (string s in split)

    {

    Console.WriteLine(s);

    }

    Here is how it displays.

    Please let me know if there are any .net API to read the registry information from this data file.


    Thanks,

    Sangamesh


    Friday, June 24, 2016 9:15 AM

Answers

  • Humm, you use Microsoft.Centennial.Tools.DesktopAppConverter.ORRegistryKey.OpenHive() to open the .DAT file, then recursively transverse the data structure with .OpenSubKey() using .SubKeys as key. On each subkey you get the name and type of values with .ValueNameAndTypes, and read the values using .GetValue() and it's friends (if you want to get the exact value instead of getting the value as string).

    This is just fairly standard folder-file transversal pattern.

    Tuesday, June 28, 2016 1:36 AM
    Answerer

All replies

  • registry.dat is a binary format file, trying to dump it as text won't work.

    To read it, use methods of Microsoft.Centennial.Tools.DesktopAppConverter.RegistryReader included in the package.

    (Of course, the real work is done by another DLL in the package, but you'll want to refer to the methods provided in the class on how to use them.)

    Friday, June 24, 2016 9:39 AM
    Answerer
  • Hi Cheong,

    Thanks for the reply. I did add reference to Microsoft.Centennial.Tools.DesktopAppConverter dll. I was able to use the RegistryReader static class's static methods "GetProtocolsAndHandlers"  and "GetFileTypeAssociationsAndHandlers". But it does expose method to read the Registry entries from binary format registry.dat file. Registry Reader class is referring Assembly Microsoft.DesktopAppConverter.RegistryManager.dll, v0.1.14.0. Please let me if there is another dll to which i need refer and also Please share the link where API information is present.

    Thanks,

    Sangamesh


    SSG



    Friday, June 24, 2016 11:21 AM
  • I don't have the package with me, but I remember the actual work is done by the other DLL in the same folder. (That folder contains just 2 DLLs, so it should be easy to figure out)
    Sunday, June 26, 2016 2:56 AM
    Answerer
  • Hi Cheong,

    Thanks for your reply. I am trying to develop standalone application to read registry information using these dll references.

    However i could see Microsoft.DesktopAppConverter.OfflineRegUtils.dll and Microsoft.DesktopAppConverter.RegistryManager.dll present in the Registry folder comes handy to read registry information. I was able to travese to "Registry" main root element. Even found this RegistryUtils class usefulBut not able to drill down further. Please can you share information about the functions present in these dlls to deep read the registry information.

    Thanks,

    Sangamesh


    SSG









    Monday, June 27, 2016 9:42 AM
  • Humm, you use Microsoft.Centennial.Tools.DesktopAppConverter.ORRegistryKey.OpenHive() to open the .DAT file, then recursively transverse the data structure with .OpenSubKey() using .SubKeys as key. On each subkey you get the name and type of values with .ValueNameAndTypes, and read the values using .GetValue() and it's friends (if you want to get the exact value instead of getting the value as string).

    This is just fairly standard folder-file transversal pattern.

    Tuesday, June 28, 2016 1:36 AM
    Answerer
  • Hi Cheong,

    Thanks for your reply. This solves my issue to deep read registry information.

    Thanking you,

    Sangamesh


    SSG

    Tuesday, June 28, 2016 7:45 AM