feat: sort output by timestamp

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2020-06-26 04:33:23 +08:00
parent 31419dc003
commit ebeef65f81
10 changed files with 251 additions and 204 deletions
+15 -17
View File
@@ -6,7 +6,6 @@ import (
"crypto/cipher"
"crypto/sha1"
"errors"
"fmt"
"hack-browser-data/log"
"os/exec"
"path/filepath"
@@ -25,21 +24,6 @@ var (
chromeKey []byte
)
func GetDBPath(dbName ...string) (dbFile []string) {
for _, v := range dbName {
s, err := filepath.Glob(macChromeDir + v)
if err != nil && len(s) == 0 {
continue
}
if len(s) > 0 {
log.Debugf("Find %s File Success", v)
log.Debugf("%s file location is %s", v, s[0])
dbFile = append(dbFile, s[0])
}
}
return dbFile
}
func InitChromeKey() error {
var (
cmd *exec.Cmd
@@ -63,6 +47,21 @@ func InitChromeKey() error {
return err
}
func GetDBPath(dbName ...string) (dbFile []string) {
for _, v := range dbName {
s, err := filepath.Glob(macChromeDir + v)
if err != nil && len(s) == 0 {
continue
}
if len(s) > 0 {
log.Debugf("Find %s File Success", v)
log.Debugf("%s file location is %s", v, s[0])
dbFile = append(dbFile, s[0])
}
}
return dbFile
}
func decryptChromeKey(chromePass []byte) {
chromeKey = pbkdf2.Key(chromePass, chromeSalt, 1003, 16, sha1.New)
}
@@ -73,7 +72,6 @@ func DecryptChromePass(encryptPass []byte) (string, error) {
} else {
return "", &DecryptError{
err: passwordIsEmpty,
msg: fmt.Sprintf("password is %s", string(encryptPass)),
}
}
}