Compare commits
No commits in common. "110a78433a211e216a4871dfbd053e5b53bef3f2" and "bd95fdb53b67924b25e3dfe644e26029dfcfb3c6" have entirely different histories.
110a78433a
...
bd95fdb53b
@ -12,8 +12,7 @@ import (
|
|||||||
"unlock-music.dev/cli/algo/common"
|
"unlock-music.dev/cli/algo/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
const magicHeader1 = "yeelion-kuwo-tme"
|
const magicHeader = "yeelion-kuwo-tme"
|
||||||
const magicHeader2 = "yeelion-kuwo\x00\x00\x00\x00"
|
|
||||||
const keyPreDefined = "MoOtOiTvINGwd2E6n0E1i7L5t2IoOoNk"
|
const keyPreDefined = "MoOtOiTvINGwd2E6n0E1i7L5t2IoOoNk"
|
||||||
|
|
||||||
type Decoder struct {
|
type Decoder struct {
|
||||||
@ -44,9 +43,7 @@ func (d *Decoder) Validate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check magic header, 0x00 - 0x0F
|
// check magic header, 0x00 - 0x0F
|
||||||
magicHeader := header[:0x10]
|
if !bytes.Equal([]byte(magicHeader), header[:len(magicHeader)]) {
|
||||||
if !bytes.Equal([]byte(magicHeader1), magicHeader) &&
|
|
||||||
!bytes.Equal([]byte(magicHeader2), magicHeader) {
|
|
||||||
return errors.New("kwm magic header not matched")
|
return errors.New("kwm magic header not matched")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user