feat: add Chromium Browser with new v2 architecture (#530)

* feat: add Chromium Browser implementation with new architecture
* refactor: replace Walk with ReadDir+Stat for profile discovery
* refactor: remove queries override, use extractors for Yandex passwords
* refactor: remove dataSource wrapper, use []sourcePath directly
* fix: address Copilot review feedback on chromium_new.go
* fix: always call key retriever regardless of Local State existence
This commit is contained in:
Roger
2026-04-02 22:36:12 +08:00
committed by moonD4rk
parent 1ec2781131
commit 1b8bb1df3d
9 changed files with 899 additions and 54 deletions
+23 -11
View File
@@ -1,21 +1,33 @@
package firefox
import "github.com/moond4rk/hackbrowserdata/types"
import (
"path/filepath"
// dataSource maps a Category to one or more candidate file paths within a profile directory.
"github.com/moond4rk/hackbrowserdata/types"
)
// sourcePath describes a single candidate location for browser data,
// relative to the profile directory.
type sourcePath struct {
rel string // relative path from profileDir
isDir bool // true for directory targets
}
func file(rel string) sourcePath { return sourcePath{rel: filepath.FromSlash(rel), isDir: false} }
// dataSource holds one or more candidate sourcePaths in priority order.
type dataSource struct {
paths []string // candidate relative paths in priority order
isDir bool // true for directories (unused in Firefox, all sources are files)
candidates []sourcePath
}
// firefoxSources defines the Firefox file layout.
// Firefox does not support SessionStorage or CreditCard extraction.
var firefoxSources = map[types.Category]dataSource{
types.Password: {paths: []string{"logins.json"}},
types.Cookie: {paths: []string{"cookies.sqlite"}},
types.History: {paths: []string{"places.sqlite"}},
types.Download: {paths: []string{"places.sqlite"}}, // same file as History
types.Bookmark: {paths: []string{"places.sqlite"}}, // same file as History
types.Extension: {paths: []string{"extensions.json"}},
types.LocalStorage: {paths: []string{"webappsstore.sqlite"}},
types.Password: {candidates: []sourcePath{file("logins.json")}},
types.Cookie: {candidates: []sourcePath{file("cookies.sqlite")}},
types.History: {candidates: []sourcePath{file("places.sqlite")}},
types.Download: {candidates: []sourcePath{file("places.sqlite")}},
types.Bookmark: {candidates: []sourcePath{file("places.sqlite")}},
types.Extension: {candidates: []sourcePath{file("extensions.json")}},
types.LocalStorage: {candidates: []sourcePath{file("webappsstore.sqlite")}},
}