czh1303541051 发表于 2020-10-7 14:55:25

千千音乐求助,大佬来吧

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)()方法得出来的,我脑壳疼,有没有大佬指点一下    (由于字数要求,我删了一点代码,希望大佬能动手帮忙调试一下)

weiter 发表于 2020-10-7 15:57:04

这个……大概率沉贴啊{:10_245:}

czh1303541051 发表于 2020-10-7 16:43:21

weiter 发表于 2020-10-7 15:57
这个……大概率沉贴啊

其实我感觉很简单就是弄不出来
页: [1]
查看完整版本: 千千音乐求助,大佬来吧