百度云千千音乐js解密求大佬帮助
var createOutputMethod = function(e) {return function(t) {
return new Md5(!0).update(t)()
}
},
function Md5(e) {
if (e) blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = blocks = 0,
this.blocks = blocks,
this.buffer8 = buffer8;
else if (ARRAY_BUFFER) {
var t = new ArrayBuffer(68);
this.buffer8 = new Uint8Array(t),
this.blocks = new Uint32Array(t)
} else this.blocks = ;
this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0,
this.finalized = this.hashed = !1,
this.first = !0
}
Md5.prototype.update = function(e) {
if (!this.finalized) {
var t, n = typeof e;
if ("string" != n) {
if ("object" != n) throw ERROR;
if (null === e) throw ERROR;
if (ARRAY_BUFFER && e.constructor === ArrayBuffer) e = new Uint8Array(e);
else if (!(Array.isArray(e) || ARRAY_BUFFER && ArrayBuffer.isView(e))) throw ERROR;
t = !0
}
for (var i, r, o = 0,
s = e.length,
a = this.blocks,
l = this.buffer8; o < s;) {
if (this.hashed && (this.hashed = !1, a = a, a = a = a = a = a = a = a = a = a = a = a = a = a = a = a = a = 0), t) if (ARRAY_BUFFER) for (r = this.start; o < s && r < 64; ++o) l = e;
else for (r = this.start; o < s && r < 64; ++o) a |= e << SHIFT;
else if (ARRAY_BUFFER) for (r = this.start; o < s && r < 64; ++o)(i = e.charCodeAt(o)) < 128 ? l = i : (i < 2048 ? l = 192 | i >> 6 : (i < 55296 || 57344 <= i ? l = 224 | i >> 12 : (i = 65536 + ((1023 & i) << 10 | 1023 & e.charCodeAt(++o)), l = 240 | i >> 18, l = 128 | i >> 12 & 63), l = 128 | i >> 6 & 63), l = 128 | 63 & i);
else for (r = this.start; o < s && r < 64; ++o)(i = e.charCodeAt(o)) < 128 ? a |= i << SHIFT : (i < 2048 ? a |= (192 | i >> 6) << SHIFT : (i < 55296 || 57344 <= i ? a |= (224 | i >> 12) << SHIFT : (i = 65536 + ((1023 & i) << 10 | 1023 & e.charCodeAt(++o)), a |= (240 | i >> 18) << SHIFT, a |= (128 | i >> 12 & 63) << SHIFT), a |= (128 | i >> 6 & 63) << SHIFT), a |= (128 | 63 & i) << SHIFT);
this.lastByteIndex = r,
this.bytes += r - this.start,
64 <= r ? (this.start = r - 64, this.hash(), this.hashed = !0) : this.start = r
}
return 4294967295 < this.bytes && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296),
this
}
},
Md5.prototype.finalize = function() {
if (!this.finalized) {
this.finalized = !0;
var e = this.blocks,
t = this.lastByteIndex;
e |= EXTRA,
56 <= t && (this.hashed || this.hash(), e = e, e = e = e = e = e = e = e = e = e = e = e = e = e = e = e = e = 0),
e = this.bytes << 3,
e = this.hBytes << 3 | this.bytes >>> 29,
this.hash()
}
},
Md5.prototype.hex = function() {
this.finalize();
var e = this.h0,
t = this.h1,
n = this.h2,
i = this.h3;
return HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS + HEX_CHARS
},
Md5.prototype.toString = Md5.prototype.hex,
Md5.prototype.digest = function() {
this.finalize();
var e = this.h0,
t = this.h1,
n = this.h2,
i = this.h3;
return
},
Md5.prototype.array = Md5.prototype.digest,
Md5.prototype.arrayBuffer = function() {
this.finalize();
var e = new ArrayBuffer(16),
t = new Uint32Array(e);
return t = this.h0,
t = this.h1,
t = this.h2,
t = this.h3,
e
},
Md5.prototype.buffer = Md5.prototype.arrayBuffer,
Md5.prototype.base64 = function() {
for (var e, t, n, i = "",
r = this.array(), o = 0; o < 15;) e = r,
t = r,
n = r,
i += BASE64_ENCODE_CHAR + BASE64_ENCODE_CHAR + BASE64_ENCODE_CHAR + BASE64_ENCODE_CHAR;
return e = r,
i + (BASE64_ENCODE_CHAR + BASE64_ENCODE_CHAR + "==")
};
var exports = createMethod();
COMMON_JS ? module.exports = exports : root.md5 = exports
}()
})),
secret = "0b50b02fd0d73a9c4c8c3a781c30845f";
function createSign(e) {
if ("" !== Object.prototype.toString.call(e)) throw new Error("The parameter of query must be a Object.");
var t = Math.floor(Date.now() / 1e3);
Object.assign(e, {
timestamp: t
});
var n = Object.keys(e);
n.sort();
for (var i = "",
r = 0; r < n.length; r++) {
var o = n;
i += (0 == r ? "" : "&") + o + "=" + e
}
return {
sign: md5(i += secret),
timestamp: t,
md5: md5
}
}
上面是我从千千音乐中搜索sign,在sign: md5(i += secret)下的断点,然后从里头拿出来的一些相关函数,最后传入一个对象到createSign中,返回给我一个对象,由于js不太熟,我想要的是字符串,而且sign真正的加密是通过这个new Md5(!0).update(t)()方法得出来的,我脑壳疼,有没有大佬指点一下 (由于字数要求,我删了一点代码,希望大佬能动手帮忙调试一下)
.版本 2
.支持库 spec
.局部变量 time, 文本型
.局部变量 sign, 文本型
.局部变量 str, 文本型
.局部变量 URL, 文本型
.局部变量 歌曲名字, 文本型
歌曲名字 = 编辑框1.内容
time = 时间_取现行时间戳 (真)
str = “timestamp=” + time + “&word=” ++ “0b50b02fd0d73a9c4c8c3a781c30845f”
sign = 校验_取md5_文本 (str, 真, )
URL = “https://music.taihe.com/v1/search?sign=” + sign + “&word=” + 歌曲名字 + “×tamp=” + time
调试输出 (到文本 (网页_访问_对象 (URL)))
得到这个东西之后 i += secret
直接用易语言的取数据摘要就可以 揰掵佲 发表于 2020-10-7 17:42
得到这个东西之后 i += secret
直接用易语言的取数据摘要就可以
可是我把代码放进调试工具中之后,把createSign函数传入一个对象之后,就一直给我报错:对象不支持此属性或方法 然后我尝试改写也没改对,咋办呀大佬 cools 发表于 2020-10-7 19:11
.版本 2
.支持库 spec
大佬你这样访问能取到网页参数吗我这里给我提示签名错误 cools 发表于 2020-10-7 19:11
.版本 2
.支持库 spec
感谢感谢,我脑残了,费力气去转name编码,根本不用转,谢谢大佬解答
页:
[1]