mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-21 19:06:47 +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:
@@ -9,7 +9,10 @@ import (
|
||||
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
|
||||
)
|
||||
|
||||
const firefoxLocalStorageQuery = `SELECT originKey, key, value FROM webappsstore2`
|
||||
const (
|
||||
firefoxLocalStorageQuery = `SELECT originKey, key, value FROM webappsstore2`
|
||||
firefoxCountLocalStorageQuery = `SELECT COUNT(*) FROM webappsstore2`
|
||||
)
|
||||
|
||||
func extractLocalStorage(path string) ([]types.StorageEntry, error) {
|
||||
return sqliteutil.QueryRows(path, true, firefoxLocalStorageQuery,
|
||||
@@ -26,6 +29,10 @@ func extractLocalStorage(path string) ([]types.StorageEntry, error) {
|
||||
})
|
||||
}
|
||||
|
||||
func countLocalStorage(path string) (int, error) {
|
||||
return sqliteutil.CountRows(path, true, firefoxCountLocalStorageQuery)
|
||||
}
|
||||
|
||||
func reverseString(s string) string {
|
||||
b := []byte(s)
|
||||
for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
|
||||
|
||||
Reference in New Issue
Block a user