Files
HackBrowserData/types/browser.go
T
Roger b655afd054 refactor: merge the browser tables into internal/browser (#654)
One Def per browser carries every OS's user data dirs, keychain label, and Windows ABE target,
so the per-OS lists and the abeTargets join go away and today's configs derive from it;
a test parsing com_iid.c keeps the payload's table in step with the ABE rows.
2026-10-27 16:06:57 +08:00

57 lines
1.8 KiB
Go

package types
import "github.com/moond4rk/hackbrowserdata/internal/record"
// BrowserKind identifies the browser engine type.
type BrowserKind int
const (
Chromium BrowserKind = iota
ChromiumYandex // Chromium variant with different file names and extract logic
ChromiumOpera // Opera: extensions in "opsettings" key, data in Roaming
Firefox
Safari
)
// String returns the canonical lowercase name of the engine kind; the chromium-family values are
// also the stable wire form carried in a keys dump, so don't change them lightly.
func (k BrowserKind) String() string {
switch k {
case Chromium:
return "chromium"
case ChromiumYandex:
return "chromium-yandex"
case ChromiumOpera:
return "chromium-opera"
case Firefox:
return "firefox"
case Safari:
return "safari"
default:
return "unknown"
}
}
// BrowserConfig holds the declarative configuration for a browser installation.
type BrowserConfig struct {
Key string // Def.ID in internal/browser; the Windows injector looks the ABE target up by it
Name string // display name
Kind BrowserKind // engine type
KeychainLabel string // macOS Keychain account / Linux D-Bus Secret Service label; "" = none
WindowsABE bool // enable Windows App-Bound Encryption v20 (reflective injection)
UserDataDir string // base browser directory
}
// BrowserData holds all extracted browser data with typed slices.
type BrowserData struct {
Passwords []record.Login
Cookies []record.Cookie
Histories []record.History
Downloads []record.Download
Bookmarks []record.Bookmark
CreditCards []record.CreditCard
Extensions []record.Extension
LocalStorage []record.LocalStorage
SessionStorage []record.SessionStorage
}