feat(QMCv2): Add mapCipher & mflac/mgg key discovery

This commit is contained in:
MengYX
2021-12-13 22:54:08 +08:00
parent 1552a667f6
commit 38648d57e6
17 changed files with 295 additions and 134 deletions

View File

@@ -18,10 +18,14 @@ func simpleMakeKey(salt byte, length int) []byte {
}
func DecryptKey(rawKey []byte) ([]byte, error) {
rawKeyDec := make([]byte, base64.StdEncoding.DecodedLen(len(rawKey)))
_, err := base64.StdEncoding.Decode(rawKeyDec, rawKey)
n, err := base64.StdEncoding.Decode(rawKeyDec, rawKey)
if err != nil {
return nil, err
}
if n < 16 {
return nil, errors.New("key length is too short")
}
rawKeyDec = rawKeyDec[:n]
simpleKey := simpleMakeKey(106, 8)
teaKey := make([]byte, 16)