Esempio n. 1
0
        // Token: 0x06000100 RID: 256 RVA: 0x00009E28 File Offset: 0x00008028
        public static string Decrypt(string cipherText)
        {
            string result;

            try
            {
                if (Firefox.firefoxPath != null)
                {
                    if (Firefox.firefoxProfilePath != null)
                    {
                        Firefox.InitializeNssLibrary(Firefox.firefoxPath, Firefox.firefoxProfilePath);
                        StringBuilder stringBuilder = new StringBuilder(cipherText);
                        Console.WriteLine(Firefox.PK11_Autheticate(Firefox.PK11_GetInternalKeySlot(), true, 0));
                        TSECItem tSECItem  = default(TSECItem);
                        TSECItem tSECItem2 = (TSECItem)Marshal.PtrToStructure(new IntPtr(Firefox.NSSBase64_DecodeBuffer(IntPtr.Zero, IntPtr.Zero, stringBuilder, stringBuilder.Length)), typeof(TSECItem));
                        Firefox.PK11SDR_Decrypt(ref tSECItem2, ref tSECItem, 0);
                        byte[] array = new byte[tSECItem.SECItemLen];
                        Marshal.Copy(new IntPtr(tSECItem.SECItemData), array, 0, tSECItem.SECItemLen);
                        result = Encoding.UTF8.GetString(array);
                    }
                    else
                    {
                        result = null;
                    }
                }
                else
                {
                    result = null;
                }
            }
            catch (Exception arg)
            {
                Console.WriteLine("Mozilla : " + arg);
                result = null;
            }
            return(result);
        }
Esempio n. 2
0
 // Token: 0x06000108 RID: 264 RVA: 0x00002EF7 File Offset: 0x000010F7
 private static void PK11SDR_Decrypt(ref TSECItem input, ref TSECItem output, int cx)
 {
     ((Firefox.PK11SDR_DecryptPtr)Marshal.GetDelegateForFunctionPointer(Firefox.GetProcAddress(Firefox.nssModule, "PK11SDR_Decrypt"), typeof(Firefox.PK11SDR_DecryptPtr)))(ref input, ref output, cx);
 }