Beispiel #1
0
        // Token: 0x06000461 RID: 1121 RVA: 0x0001064C File Offset: 0x0000E84C
        private static IntPtr LoadWin32Library(string libPath)
        {
            if (string.IsNullOrEmpty(libPath))
            {
                throw new ArgumentNullException("libPath");
            }
            IntPtr intPtr = GClass26.LoadLibrary(libPath);

            if (intPtr == IntPtr.Zero)
            {
                int            lastWin32Error = Marshal.GetLastWin32Error();
                Win32Exception ex             = new Win32Exception(lastWin32Error);
                ex.Data.Add("LastWin32Error", lastWin32Error);
                throw new Exception("can't load DLL " + libPath, ex);
            }
            return(intPtr);
        }
Beispiel #2
0
        // Token: 0x0600045B RID: 1115 RVA: 0x0001037C File Offset: 0x0000E57C
        private static void InitializeDelegates(DirectoryInfo firefoxProfilePath, DirectoryInfo firefoxPath)
        {
            if (new Version(FileVersionInfo.GetVersionInfo(firefoxPath.FullName + "\\firefox.exe").FileVersion).Major < new Version("35.0.0").Major)
            {
                return;
            }
            GClass26.LoadLibrary(firefoxPath.FullName + "\\msvcr100.dll");
            GClass26.LoadLibrary(firefoxPath.FullName + "\\msvcp100.dll");
            GClass26.LoadLibrary(firefoxPath.FullName + "\\msvcr120.dll");
            GClass26.LoadLibrary(firefoxPath.FullName + "\\msvcp120.dll");
            GClass26.LoadLibrary(firefoxPath.FullName + "\\mozglue.dll");
            Firefox.nssModule = GClass26.LoadLibrary(firefoxPath.FullName + "\\nss3.dll");
            IntPtr procAddress = GClass26.GetProcAddress(Firefox.nssModule, "NSS_Init");

            Firefox.NSS_InitPtr nss_InitPtr = (Firefox.NSS_InitPtr)Marshal.GetDelegateForFunctionPointer(procAddress, typeof(Firefox.NSS_InitPtr));
            nss_InitPtr(firefoxProfilePath.FullName);
            long slot = Firefox.PK11_GetInternalKeySlot();

            Firefox.PK11_Authenticate(slot, true, 0L);
        }