You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HackBrowserData/main.go

47 lines
1022 B

package main
import (
"fmt"
"hack-browser-data/core/common"
"hack-browser-data/log"
"hack-browser-data/utils"
"path/filepath"
"runtime"
)
func main() {
log.InitLog()
parse()
}
func parse() {
osName := runtime.GOOS
switch osName {
case "darwin":
err := utils.InitChromeKey()
if err != nil {
log.Println(err)
panic("init chrome key failed")
}
case "windows":
fmt.Println("Windows")
}
chromePath, err := utils.GetDBPath(utils.LoginData, utils.History, utils.Bookmarks, utils.Cookies)
//chromePath, err := utils.GetDBPath(utils.Cookies)
if err != nil {
log.Error("can't find chrome.app in OS")
}
for _, v := range chromePath {
dst := filepath.Base(v)
err := utils.CopyDB(v, dst)
if err != nil {
log.Println(err)
continue
}
common.ParseDB(dst)
}
fmt.Println("bookmarks", len(common.FullData.Bookmarks))
fmt.Println("cookies", len(common.FullData.Cookies))
fmt.Println("login data", len(common.FullData.LoginData))
fmt.Println("history", len(common.FullData.History))
}