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.
167 lines
3.9 KiB
167 lines
3.9 KiB
3 years ago
|
package browser
|
||
|
|
||
|
import (
|
||
3 years ago
|
"hack-browser-data/internal/browser/consts"
|
||
|
data2 "hack-browser-data/internal/browser/data"
|
||
3 years ago
|
)
|
||
|
|
||
|
type item int
|
||
|
|
||
|
const (
|
||
|
chromiumKey item = iota
|
||
|
chromiumPassword
|
||
|
chromiumCookie
|
||
|
chromiumBookmark
|
||
|
chromiumHistory
|
||
|
chromiumDownload
|
||
3 years ago
|
chromiumCreditCard
|
||
3 years ago
|
chromiumLocalStorage
|
||
|
chromiumExtension
|
||
|
|
||
3 years ago
|
yandexPassword
|
||
|
yandexCreditCard
|
||
|
|
||
3 years ago
|
firefoxKey4
|
||
|
firefoxPassword
|
||
|
firefoxCookie
|
||
|
firefoxBookmark
|
||
|
firefoxHistory
|
||
|
firefoxDownload
|
||
3 years ago
|
firefoxCreditCard
|
||
3 years ago
|
firefoxLocalStorage
|
||
|
firefoxExtension
|
||
|
)
|
||
|
|
||
|
func (i item) DefaultName() string {
|
||
|
switch i {
|
||
|
case chromiumKey:
|
||
|
return consts.ChromiumKey
|
||
|
case chromiumPassword:
|
||
|
return consts.ChromiumPassword
|
||
|
case chromiumCookie:
|
||
|
return consts.ChromiumCookie
|
||
|
case chromiumBookmark:
|
||
|
return consts.ChromiumBookmark
|
||
|
case chromiumDownload:
|
||
|
return consts.ChromiumDownload
|
||
|
case chromiumLocalStorage:
|
||
|
return consts.ChromiumLocalStorage
|
||
3 years ago
|
case chromiumCreditCard:
|
||
3 years ago
|
return consts.ChromiumCredit
|
||
|
case chromiumExtension:
|
||
3 years ago
|
return consts.UnknownItem
|
||
3 years ago
|
case chromiumHistory:
|
||
|
return consts.ChromiumHistory
|
||
3 years ago
|
case yandexPassword:
|
||
|
return consts.YandexPassword
|
||
|
case yandexCreditCard:
|
||
|
return consts.YandexCredit
|
||
|
case firefoxKey4:
|
||
|
return consts.FirefoxKey4
|
||
3 years ago
|
case firefoxPassword:
|
||
3 years ago
|
return consts.FirefoxPassword
|
||
3 years ago
|
case firefoxCookie:
|
||
3 years ago
|
return consts.FirefoxCookie
|
||
|
case firefoxBookmark:
|
||
|
return consts.FirefoxData
|
||
|
case firefoxDownload:
|
||
3 years ago
|
return consts.FirefoxData
|
||
3 years ago
|
case firefoxLocalStorage:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
3 years ago
|
case firefoxCreditCard:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
3 years ago
|
case firefoxHistory:
|
||
|
return consts.FirefoxData
|
||
|
case firefoxExtension:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
3 years ago
|
default:
|
||
3 years ago
|
return consts.UnknownItem
|
||
3 years ago
|
}
|
||
|
}
|
||
|
|
||
|
func (i item) FileName() string {
|
||
|
switch i {
|
||
|
case chromiumKey:
|
||
|
return consts.ChromiumKeyFilename
|
||
|
case chromiumPassword:
|
||
|
return consts.ChromiumPasswordFilename
|
||
|
case chromiumCookie:
|
||
|
return consts.ChromiumCookieFilename
|
||
|
case chromiumBookmark:
|
||
|
return consts.ChromiumBookmarkFilename
|
||
|
case chromiumDownload:
|
||
|
return consts.ChromiumDownloadFilename
|
||
|
case chromiumLocalStorage:
|
||
|
return consts.ChromiumLocalStorageFilename
|
||
3 years ago
|
case chromiumCreditCard:
|
||
3 years ago
|
return consts.ChromiumCreditFilename
|
||
|
case chromiumHistory:
|
||
|
return consts.ChromiumHistoryFilename
|
||
3 years ago
|
case chromiumExtension:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
|
case yandexPassword:
|
||
|
return consts.ChromiumPasswordFilename
|
||
|
case yandexCreditCard:
|
||
|
return consts.ChromiumCreditFilename
|
||
3 years ago
|
case firefoxKey4:
|
||
|
return consts.FirefoxKey4Filename
|
||
3 years ago
|
case firefoxPassword:
|
||
3 years ago
|
return consts.FirefoxPasswordFilename
|
||
3 years ago
|
case firefoxCookie:
|
||
3 years ago
|
return consts.FirefoxCookieFilename
|
||
|
case firefoxBookmark:
|
||
|
return consts.FirefoxBookmarkFilename
|
||
|
case firefoxDownload:
|
||
|
return consts.FirefoxDownloadFilename
|
||
|
case firefoxLocalStorage:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
3 years ago
|
case firefoxCreditCard:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
3 years ago
|
case firefoxHistory:
|
||
|
return consts.FirefoxHistoryFilename
|
||
|
case firefoxExtension:
|
||
3 years ago
|
return consts.UnsupportedItem
|
||
3 years ago
|
default:
|
||
3 years ago
|
return consts.UnknownItem
|
||
3 years ago
|
}
|
||
|
}
|
||
|
|
||
3 years ago
|
func (i item) NewBrowsingData() data2.BrowsingData {
|
||
3 years ago
|
switch i {
|
||
|
case chromiumKey:
|
||
|
return nil
|
||
|
case chromiumPassword:
|
||
3 years ago
|
return &data2.ChromiumPassword{}
|
||
3 years ago
|
case chromiumCookie:
|
||
3 years ago
|
return &data2.ChromiumCookie{}
|
||
3 years ago
|
case chromiumBookmark:
|
||
3 years ago
|
return &data2.ChromiumBookmark{}
|
||
3 years ago
|
case chromiumDownload:
|
||
3 years ago
|
return &data2.ChromiumDownload{}
|
||
3 years ago
|
case chromiumLocalStorage:
|
||
|
return nil
|
||
3 years ago
|
case chromiumCreditCard:
|
||
3 years ago
|
return &data2.ChromiumCreditCard{}
|
||
3 years ago
|
case chromiumExtension:
|
||
|
return nil
|
||
|
case chromiumHistory:
|
||
3 years ago
|
return &data2.ChromiumHistory{}
|
||
3 years ago
|
case yandexPassword:
|
||
3 years ago
|
return &data2.ChromiumPassword{}
|
||
3 years ago
|
case yandexCreditCard:
|
||
3 years ago
|
return &data2.ChromiumCreditCard{}
|
||
3 years ago
|
case firefoxPassword:
|
||
3 years ago
|
return &data2.FirefoxPassword{}
|
||
3 years ago
|
case firefoxCookie:
|
||
3 years ago
|
return &data2.FirefoxCookie{}
|
||
3 years ago
|
case firefoxBookmark:
|
||
3 years ago
|
return &data2.FirefoxBookmark{}
|
||
3 years ago
|
case firefoxDownload:
|
||
3 years ago
|
return &data2.FirefoxDownload{}
|
||
3 years ago
|
case firefoxHistory:
|
||
3 years ago
|
return &data2.FirefoxHistory{}
|
||
3 years ago
|
default:
|
||
|
return nil
|
||
|
}
|
||
|
}
|