mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
feat: add CountEntries to skip decryption for list --detail (#562)
* feat: add CountEntries to skip decryption for list --detail (#549) * test: add CountEntries and countCategory tests at browser level * fix: address review feedback on CountRows and countLocalStorage * test: add CountRows unit tests
This commit is contained in:
@@ -8,8 +8,11 @@ import (
|
||||
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
|
||||
)
|
||||
|
||||
const firefoxCookieQuery = `SELECT name, value, host, path,
|
||||
creationTime, expiry, isSecure, isHttpOnly FROM moz_cookies`
|
||||
const (
|
||||
firefoxCookieQuery = `SELECT name, value, host, path,
|
||||
creationTime, expiry, isSecure, isHttpOnly FROM moz_cookies`
|
||||
firefoxCountCookieQuery = `SELECT COUNT(*) FROM moz_cookies`
|
||||
)
|
||||
|
||||
func extractCookies(path string) ([]types.CookieEntry, error) {
|
||||
cookies, err := sqliteutil.QueryRows(path, true, firefoxCookieQuery,
|
||||
@@ -46,3 +49,7 @@ func extractCookies(path string) ([]types.CookieEntry, error) {
|
||||
})
|
||||
return cookies, nil
|
||||
}
|
||||
|
||||
func countCookies(path string) (int, error) {
|
||||
return sqliteutil.CountRows(path, true, firefoxCountCookieQuery)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user