feat: replace log with stdout color

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2022-04-16 03:57:19 +08:00
parent 47921a9eec
commit c9feef66ab
8 changed files with 150 additions and 118 deletions
@@ -11,6 +11,7 @@ import (
"golang.org/x/crypto/pbkdf2"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
)
var (
@@ -52,5 +53,6 @@ func (c *chromium) GetMasterKey() ([]byte, error) {
return nil, ErrWrongSecurityCommand
}
c.masterKey = key
log.Infof("%s initialized master key success", c.name)
return key, nil
}
@@ -64,5 +64,6 @@ func (c *chromium) GetMasterKey() ([]byte, error) {
// @https://source.chromium.org/chromium/chromium/src/+/master:components/os_crypt/os_crypt_linux.cc
key := pbkdf2.Key(chromiumSecret, chromiumSalt, 1, 16, sha1.New)
c.masterKey = key
log.Infof("%s initialized master key success", c.name)
return key, nil
}
@@ -9,6 +9,7 @@ import (
"hack-browser-data/internal/decrypter"
"hack-browser-data/internal/item"
"hack-browser-data/internal/log"
"hack-browser-data/internal/utils/fileutil"
)
@@ -29,6 +30,7 @@ func (c *chromium) GetMasterKey() ([]byte, error) {
return nil, errDecodeMasterKeyFailed
}
c.masterKey, err = decrypter.DPApi(pureKey[5:])
log.Infof("%s initialized master key success", c.name)
return c.masterKey, err
}
return nil, nil