鱼C论坛

 找回密码
 立即注册
查看: 1588|回复: 2

千千音乐求助,大佬来吧

[复制链接]
发表于 2020-10-7 14:55:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. var createOutputMethod = function(e) {
  2.             return function(t) {
  3.                 return new Md5(!0).update(t)[e]()
  4.             }
  5.         },
  6.         function Md5(e) {
  7.             if (e) blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0,
  8.             this.blocks = blocks,
  9.             this.buffer8 = buffer8;
  10.             else if (ARRAY_BUFFER) {
  11.                 var t = new ArrayBuffer(68);
  12.                 this.buffer8 = new Uint8Array(t),
  13.                 this.blocks = new Uint32Array(t)
  14.             } else this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
  15.             this.h0 = this.h1 = this.h2 = this.h3 = this.start = this.bytes = this.hBytes = 0,
  16.             this.finalized = this.hashed = !1,
  17.             this.first = !0
  18.         }
  19.         Md5.prototype.update = function(e) {
  20.             if (!this.finalized) {
  21.                 var t, n = typeof e;
  22.                 if ("string" != n) {
  23.                     if ("object" != n) throw ERROR;
  24.                     if (null === e) throw ERROR;
  25.                     if (ARRAY_BUFFER && e.constructor === ArrayBuffer) e = new Uint8Array(e);
  26.                     else if (!(Array.isArray(e) || ARRAY_BUFFER && ArrayBuffer.isView(e))) throw ERROR;
  27.                     t = !0
  28.                 }
  29.                 for (var i, r, o = 0,
  30.                 s = e.length,
  31.                 a = this.blocks,
  32.                 l = this.buffer8; o < s;) {
  33.                     if (this.hashed && (this.hashed = !1, a[0] = a[16], a[16] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = a[9] = a[10] = a[11] = a[12] = a[13] = a[14] = a[15] = 0), t) if (ARRAY_BUFFER) for (r = this.start; o < s && r < 64; ++o) l[r++] = e[o];
  34.                     else for (r = this.start; o < s && r < 64; ++o) a[r >> 2] |= e[o] << SHIFT[3 & r++];
  35.                     else if (ARRAY_BUFFER) for (r = this.start; o < s && r < 64; ++o)(i = e.charCodeAt(o)) < 128 ? l[r++] = i : (i < 2048 ? l[r++] = 192 | i >> 6 : (i < 55296 || 57344 <= i ? l[r++] = 224 | i >> 12 : (i = 65536 + ((1023 & i) << 10 | 1023 & e.charCodeAt(++o)), l[r++] = 240 | i >> 18, l[r++] = 128 | i >> 12 & 63), l[r++] = 128 | i >> 6 & 63), l[r++] = 128 | 63 & i);
  36.                     else for (r = this.start; o < s && r < 64; ++o)(i = e.charCodeAt(o)) < 128 ? a[r >> 2] |= i << SHIFT[3 & r++] : (i < 2048 ? a[r >> 2] |= (192 | i >> 6) << SHIFT[3 & r++] : (i < 55296 || 57344 <= i ? a[r >> 2] |= (224 | i >> 12) << SHIFT[3 & r++] : (i = 65536 + ((1023 & i) << 10 | 1023 & e.charCodeAt(++o)), a[r >> 2] |= (240 | i >> 18) << SHIFT[3 & r++], a[r >> 2] |= (128 | i >> 12 & 63) << SHIFT[3 & r++]), a[r >> 2] |= (128 | i >> 6 & 63) << SHIFT[3 & r++]), a[r >> 2] |= (128 | 63 & i) << SHIFT[3 & r++]);
  37.                     this.lastByteIndex = r,
  38.                     this.bytes += r - this.start,
  39.                     64 <= r ? (this.start = r - 64, this.hash(), this.hashed = !0) : this.start = r
  40.                 }
  41.                 return 4294967295 < this.bytes && (this.hBytes += this.bytes / 4294967296 << 0, this.bytes = this.bytes % 4294967296),
  42.                 this
  43.             }
  44.         },
  45.         Md5.prototype.finalize = function() {
  46.             if (!this.finalized) {
  47.                 this.finalized = !0;
  48.                 var e = this.blocks,
  49.                     t = this.lastByteIndex;
  50.                 e[t >> 2] |= EXTRA[3 & t],
  51.                 56 <= t && (this.hashed || this.hash(), e[0] = e[16], e[16] = e[1] = e[2] = e[3] = e[4] = e[5] = e[6] = e[7] = e[8] = e[9] = e[10] = e[11] = e[12] = e[13] = e[14] = e[15] = 0),
  52.                 e[14] = this.bytes << 3,
  53.                 e[15] = this.hBytes << 3 | this.bytes >>> 29,
  54.                 this.hash()
  55.             }
  56.         },
  57.         Md5.prototype.hex = function() {
  58.             this.finalize();
  59.             var e = this.h0,
  60.                 t = this.h1,
  61.                 n = this.h2,
  62.                 i = this.h3;
  63.             return HEX_CHARS[e >> 4 & 15] + HEX_CHARS[15 & e] + HEX_CHARS[e >> 12 & 15] + HEX_CHARS[e >> 8 & 15] + HEX_CHARS[e >> 20 & 15] + HEX_CHARS[e >> 16 & 15] + HEX_CHARS[e >> 28 & 15] + HEX_CHARS[e >> 24 & 15] + HEX_CHARS[t >> 4 & 15] + HEX_CHARS[15 & t] + HEX_CHARS[t >> 12 & 15] + HEX_CHARS[t >> 8 & 15] + HEX_CHARS[t >> 20 & 15] + HEX_CHARS[t >> 16 & 15] + HEX_CHARS[t >> 28 & 15] + HEX_CHARS[t >> 24 & 15] + HEX_CHARS[n >> 4 & 15] + HEX_CHARS[15 & n] + HEX_CHARS[n >> 12 & 15] + HEX_CHARS[n >> 8 & 15] + HEX_CHARS[n >> 20 & 15] + HEX_CHARS[n >> 16 & 15] + HEX_CHARS[n >> 28 & 15] + HEX_CHARS[n >> 24 & 15] + HEX_CHARS[i >> 4 & 15] + HEX_CHARS[15 & i] + HEX_CHARS[i >> 12 & 15] + HEX_CHARS[i >> 8 & 15] + HEX_CHARS[i >> 20 & 15] + HEX_CHARS[i >> 16 & 15] + HEX_CHARS[i >> 28 & 15] + HEX_CHARS[i >> 24 & 15]
  64.         },
  65.         Md5.prototype.toString = Md5.prototype.hex,
  66.         Md5.prototype.digest = function() {
  67.             this.finalize();
  68.             var e = this.h0,
  69.                 t = this.h1,
  70.                 n = this.h2,
  71.                 i = this.h3;
  72.             return [255 & e, e >> 8 & 255, e >> 16 & 255, e >> 24 & 255, 255 & t, t >> 8 & 255, t >> 16 & 255, t >> 24 & 255, 255 & n, n >> 8 & 255, n >> 16 & 255, n >> 24 & 255, 255 & i, i >> 8 & 255, i >> 16 & 255, i >> 24 & 255]
  73.         },
  74.         Md5.prototype.array = Md5.prototype.digest,
  75.         Md5.prototype.arrayBuffer = function() {
  76.             this.finalize();
  77.             var e = new ArrayBuffer(16),
  78.                 t = new Uint32Array(e);
  79.             return t[0] = this.h0,
  80.             t[1] = this.h1,
  81.             t[2] = this.h2,
  82.             t[3] = this.h3,
  83.             e
  84.         },
  85.         Md5.prototype.buffer = Md5.prototype.arrayBuffer,
  86.         Md5.prototype.base64 = function() {
  87.             for (var e, t, n, i = "",
  88.             r = this.array(), o = 0; o < 15;) e = r[o++],
  89.             t = r[o++],
  90.             n = r[o++],
  91.             i += BASE64_ENCODE_CHAR[e >>> 2] + BASE64_ENCODE_CHAR[63 & (e << 4 | t >>> 4)] + BASE64_ENCODE_CHAR[63 & (t << 2 | n >>> 6)] + BASE64_ENCODE_CHAR[63 & n];
  92.             return e = r[o],
  93.             i + (BASE64_ENCODE_CHAR[e >>> 2] + BASE64_ENCODE_CHAR[e << 4 & 63] + "==")
  94.         };
  95.         var exports = createMethod();
  96.         COMMON_Js ? module.exports = exports : root.md5 = exports
  97.     }()
  98. })),
  99.     secret = "0b50b02fd0d73a9c4c8c3a781c30845f";

  100. function createSign(e) {
  101.     if ("[object Object]" !== Object.prototype.toString.call(e)) throw new Error("The parameter of query must be a Object.");
  102.     var t = Math.floor(Date.now() / 1e3);
  103.     Object.assign(e, {
  104.         timestamp: t
  105.     });
  106.     var n = Object.keys(e);
  107.     n.sort();
  108.     for (var i = "",
  109.     r = 0; r < n.length; r++) {
  110.         var o = n[r];
  111.         i += (0 == r ? "" : "&") + o + "=" + e[o]
  112.     }
  113.     return {
  114.         sign: md5(i += secret),
  115.         timestamp: t,
  116.         md5: md5
  117.     }
  118. }
复制代码


上面是我从千千音乐中搜索sign,在sign: md5(i += secret)下的断点,然后从里头拿出来的一些相关函数,最后传入一个对象到createSign中,返回给我一个对象,由于js不太熟,我想要的是字符串,而且sign真正的加密是通过这个new Md5(!0).update(t)[e]()方法得出来的,我脑壳疼,有没有大佬指点一下    (由于字数要求,我删了一点代码,希望大佬能动手帮忙调试一下)
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-10-7 15:57:04 | 显示全部楼层
这个……大概率沉贴啊
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-10-7 16:43:21 | 显示全部楼层
weiter 发表于 2020-10-7 15:57
这个……大概率沉贴啊

其实我感觉很简单  就是弄不出来
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-25 00:37

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表