[GH-ISSUE #589] Password recovery for Firefox fails. nssModule & pProf are 0 #346

Closed
opened 2026-02-27 15:49:58 +03:00 by kerem · 1 comment
Owner

Originally created by @YvonFortier on GitHub (Mar 11, 2017).
Original GitHub issue: https://github.com/quasar/Quasar/issues/589

Hello.

I had an issue reading Firefox's program files & profile dirs, so I hard coded that (when I fix it programatically, I'll push it if you want. It's changed and the program is looking in a wrong place).

Right now, the problem is here:

`
private static void InitializeDelegates(DirectoryInfo firefoxProfilePath, DirectoryInfo firefoxPath)
{
//Return if under firefox 35 (35+ supported)
//Firefox changes their DLL heirarchy/code with different releases
//So we need to avoid trying to load a DLL in the wrong order
//To prevent pop up saying it could not load the DLL
if (new Version(FileVersionInfo.GetVersionInfo(firefoxPath.FullName + "\firefox.exe").FileVersion).Major < new Version("35.0.0").Major)
return;

        NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcr100.dll");
        NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcp100.dll");
        NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcr120.dll");
        NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcp120.dll");
        NativeMethods.LoadLibrary(firefoxPath.FullName + "\\mozglue.dll");
        nssModule = NativeMethods.LoadLibrary(firefoxPath.FullName + "\\nss3.dll");
        IntPtr pProc = NativeMethods.GetProcAddress(nssModule, "NSS_Init");
        NSS_InitPtr NSS_Init = (NSS_InitPtr)Marshal.GetDelegateForFunctionPointer(pProc, typeof(NSS_InitPtr));
        NSS_Init(firefoxProfilePath.FullName);
        long keySlot = PK11_GetInternalKeySlot();
        PK11_Authenticate(keySlot, true, 0);
    }`

nssModule & pProc show this:
screenshot

After that line, I get the following exception:
screenshot2

Any help would be greatly appreciated.

Originally created by @YvonFortier on GitHub (Mar 11, 2017). Original GitHub issue: https://github.com/quasar/Quasar/issues/589 Hello. I had an issue reading Firefox's program files & profile dirs, so I hard coded that (when I fix it programatically, I'll push it if you want. It's changed and the program is looking in a wrong place). Right now, the problem is here: ` private static void InitializeDelegates(DirectoryInfo firefoxProfilePath, DirectoryInfo firefoxPath) { //Return if under firefox 35 (35+ supported) //Firefox changes their DLL heirarchy/code with different releases //So we need to avoid trying to load a DLL in the wrong order //To prevent pop up saying it could not load the DLL if (new Version(FileVersionInfo.GetVersionInfo(firefoxPath.FullName + "\\firefox.exe").FileVersion).Major < new Version("35.0.0").Major) return; NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcr100.dll"); NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcp100.dll"); NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcr120.dll"); NativeMethods.LoadLibrary(firefoxPath.FullName + "\\msvcp120.dll"); NativeMethods.LoadLibrary(firefoxPath.FullName + "\\mozglue.dll"); nssModule = NativeMethods.LoadLibrary(firefoxPath.FullName + "\\nss3.dll"); IntPtr pProc = NativeMethods.GetProcAddress(nssModule, "NSS_Init"); NSS_InitPtr NSS_Init = (NSS_InitPtr)Marshal.GetDelegateForFunctionPointer(pProc, typeof(NSS_InitPtr)); NSS_Init(firefoxProfilePath.FullName); long keySlot = PK11_GetInternalKeySlot(); PK11_Authenticate(keySlot, true, 0); }` nssModule & pProc show this: <img width="933" alt="screenshot" src="https://cloud.githubusercontent.com/assets/19503214/23824393/2ae053dc-0676-11e7-9b29-6d4a1d5dcfa7.png"> After that line, I get the following exception: <img width="933" alt="screenshot2" src="https://cloud.githubusercontent.com/assets/19503214/23824405/590c33a2-0676-11e7-865b-bb1b61904614.png"> Any help would be greatly appreciated.
kerem 2026-02-27 15:49:58 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@MaxXor commented on GitHub (Jun 8, 2020):

Password recovery for Firefox works only if the 64 bit version of Firefox is installed on Windows 64 bit.

<!-- gh-comment-id:640847385 --> @MaxXor commented on GitHub (Jun 8, 2020): Password recovery for Firefox works only if the 64 bit version of Firefox is installed on Windows 64 bit.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Quasar#346
No description provided.