吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 802|回复: 10
收起左侧

[求助] 【逆向】有大佬知道new init(n).extend 这样的怎么扣吗?

[复制链接]
hybpjx 发表于 2023-6-28 11:04
新人小白。想问问有没有大佬知道,类似于new.init(n).extend 怎么继承的另一个函数。并且怎么去扣代码吗?


v = k.a.stringify(z()(m)),
还有这个z()(m)到底是啥意思

逆向网站是: aHR0cDovL3d3dy55dW5jYWl0b25nLmNuL3B1Ymxpc2gvcmVzdWx0LnNodG1sLw==
加密值: headers中的token

z()(e)

z()(e)

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

zhuxiangyu1024 发表于 2023-6-28 11:08
z()返回一个函数
 楼主| hybpjx 发表于 2023-6-28 11:09

哦哦哦懂了,那大佬知道这种继承的网站扣代码的思路吗
十万菠萝拍黄瓜 发表于 2023-6-28 12:54
直接调用aa()   没补环境
[JavaScript] 纯文本查看 复制代码
!function(e) {
    function r(data) {
        for (var r, n, l = data[0], d = data[1], f = data[2], i = 0, h = []; i < l.length; i++)
            n = l[i],
            Object.prototype.hasOwnProperty.call(o, n) && o[n] && h.push(o[n][0]),
            o[n] = 0;
        for (r in d)
            Object.prototype.hasOwnProperty.call(d, r) && (e[r] = d[r]);
        for (m && m(data); h.length; )
            h.shift()();
        return c.push.apply(c, f || []),
        t()
    }
    function t() {
        for (var e, i = 0; i < c.length; i++) {
            for (var r = c[i], t = !0, n = 1; n < r.length; n++) {
                var d = r[n];
                0 !== o[d] && (t = !1)
            }
            t && (c.splice(i--, 1),
            e = l(l.s = r[0]))
        }
        return e
    }
    var n = {}
      , o = {
        52: 0
    }
      , c = [];
    function l(r) {
        if (n[r])
            return n[r].exports;
        var t = n[r] = {
            i: r,
            l: !1,
            exports: {}
        };
        return e[r].call(t.exports, t, t.exports, l),
        t.l = !0,
        t.exports
    }
    l.e = function(e) {
        var r = []
          , t = o[e];
        if (0 !== t)
            if (t)
                r.push(t[2]);
            else {
                var n = new Promise((function(r, n) {
                    t = o[e] = [r, n]
                }
                ));
                r.push(t[2] = n);
                var c, script = document.createElement("script");
                script.charset = "utf-8",
                script.timeout = 120,
                l.nc && script.setAttribute("nonce", l.nc),
                script.src = function(e) {
                    return l.p + "" + ({
                        0: "commons/88ce4e44",
                        4: "pages/about/contact.shtml",
                        5: "pages/about/index.shtml",
                        6: "pages/about/legal.shtml",
                        7: "pages/about/license.shtml",
                        8: "pages/about/privacy.shtml",
                        9: "pages/about/service.shtml",
                        10: "pages/analysis/index",
                        11: "pages/eb/index",
                        12: "pages/ep/index",
                        13: "pages/index",
                        14: "pages/mall/index",
                        15: "pages/market/products",
                        16: "pages/market/programme",
                        17: "pages/market/search/history",
                        18: "pages/market/search/products",
                        19: "pages/market/search/programme",
                        20: "pages/market/search/supplier",
                        21: "pages/market/supplier",
                        22: "pages/news/_id",
                        23: "pages/news/detail/_id",
                        24: "pages/news/index",
                        25: "pages/publish/_redirect",
                        26: "pages/publish/_year/_month/_day/_detail",
                        27: "pages/publish/demand.shtml",
                        28: "pages/publish/index",
                        29: "pages/publish/result.shtml",
                        30: "pages/publish/result.shtml__old",
                        31: "pages/publish/search",
                        32: "pages/publish/subscribe.shtml",
                        33: "pages/recruit/_id",
                        34: "pages/recruit/index",
                        35: "pages/register/guidance",
                        36: "pages/register/index",
                        37: "pages/register/success/index",
                        38: "pages/register/uc",
                        39: "pages/store/_store/_product/detail",
                        40: "pages/store/_store/_programme/programme",
                        41: "pages/store/_store/case",
                        42: "pages/store/_store/contact",
                        43: "pages/store/_store/index",
                        44: "pages/store/_store/product",
                        45: "pages/store/_store/programme",
                        46: "pages/store/_store/qualification",
                        47: "pages/store/_store/searchResult",
                        48: "pages/survey/_id",
                        49: "pages/survey/index",
                        50: "pages/warn/detail/_id",
                        51: "pages/warn/index"
                    }[e] || e) + "." + {
                        0: "f0d572c",
                        4: "081c068",
                        5: "2e5a114",
                        6: "5c23f06",
                        7: "4e0997f",
                        8: "46f4d38",
                        9: "22c79e5",
                        10: "060eaae",
                        11: "b92efc6",
                        12: "d9f9c27",
                        13: "1941c4a",
                        14: "a33703a",
                        15: "c1db378",
                        16: "e8cec91",
                        17: "f60bba8",
                        18: "39c9ebc",
                        19: "6f1ae0c",
                        20: "04c9d7f",
                        21: "84c6463",
                        22: "3f42973",
                        23: "ab736ac",
                        24: "74767a5",
                        25: "6ee3fcf",
                        26: "e845f75",
                        27: "bb561bf",
                        28: "7514d6b",
                        29: "c275486",
                        30: "151cde6",
                        31: "602793e",
                        32: "91f936a",
                        33: "06e1bcb",
                        34: "7f69974",
                        35: "961e77f",
                        36: "c90567b",
                        37: "358e56c",
                        38: "160d424",
                        39: "affc9ae",
                        40: "5540ffd",
                        41: "a9ded42",
                        42: "0bda335",
                        43: "2795e43",
                        44: "484eadf",
                        45: "cf0a9c2",
                        46: "ef55b18",
                        47: "581622b",
                        48: "57cfa9a",
                        49: "fbc9fe5",
                        50: "7c3a96f",
                        51: "538d25a"
                    }[e] + ".js"
                }(e);
                var d = new Error;
                c = function(r) {
                    script.onerror = script.onload = null,
                    clearTimeout(f);
                    var t = o[e];
                    if (0 !== t) {
                        if (t) {
                            var n = r && ("load" === r.type ? "missing" : r.type)
                              , c = r && r.target && r.target.src;
                            d.message = "Loading chunk " + e + " failed.\n(" + n + ": " + c + ")",
                            d.name = "ChunkLoadError",
                            d.type = n,
                            d.request = c,
                            t[1](d)
                        }
                        o[e] = void 0
                    }
                }
                ;
                var f = setTimeout((function() {
                    c({
                        type: "timeout",
                        target: script
                    })
                }
                ), 12e4);
                script.onerror = script.onload = c,
                document.head.appendChild(script)
            }
        return Promise.all(r)
    }
    ,
    l.m = e,
    l.c = n,
    l.d = function(e, r, t) {
        l.o(e, r) || Object.defineProperty(e, r, {
            enumerable: !0,
            get: t
        })
    }
    ,
    l.r = function(e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {
            value: "Module"
        }),
        Object.defineProperty(e, "__esModule", {
            value: !0
        })
    }
    ,
    l.t = function(e, r) {
        if (1 & r && (e = l(e)),
        8 & r)
            return e;
        if (4 & r && "object" == typeof e && e && e.__esModule)
            return e;
        var t = Object.create(null);
        if (l.r(t),
        Object.defineProperty(t, "default", {
            enumerable: !0,
            value: e
        }),
        2 & r && "string" != typeof e)
            for (var n in e)
                l.d(t, n, function(r) {
                    return e[r]
                }
                .bind(null, n));
        return t
    }
    ,
    l.n = function(e) {
        var r = e && e.__esModule ? function() {
            return e.default
        }
        : function() {
            return e
        }
        ;
        return l.d(r, "a", r),
        r
    }
    ,
    l.o = function(object, e) {
        return Object.prototype.hasOwnProperty.call(object, e)
    }
    ,
    l.p = "/_nuxt/",
    l.oe = function(e) {
        throw console.error(e),
        e
    }
    ;
    var d = window.webpackJsonp = window.webpackJsonp || []
      , f = d.push.bind(d);
    d.push = r,
    d = d.slice();
    for (var i = 0; i < d.length; i++)
        r(d[i]);
    var m = f;
	window._nn = l;
    //t()
}({
	"297": function(e, t, n) {
		var r;
		e.exports = (r = n("331"),
		function(e) {
			var t = r
			  , n = t.lib
			  , o = n.WordArray
			  , c = n.Hasher
			  , l = t.algo
			  , d = []
			  , h = [];
			!function() {
				function t(t) {
					for (var n = e.sqrt(t), r = 2; r <= n; r++)
						if (!(t % r))
							return !1;
					return !0
				}
				function n(e) {
					return 4294967296 * (e - (0 | e)) | 0
				}
				for (var r = 2, o = 0; o < 64; )
					t(r) && (o < 8 && (d[o] = n(e.pow(r, .5))),
					h[o] = n(e.pow(r, 1 / 3)),
					o++),
					r++
			}();
			var f = []
			  , m = l.SHA256 = c.extend({
				_doReset: function() {
					this._hash = new o.init(d.slice(0))
				},
				_doProcessBlock: function(e, t) {
					for (var n = this._hash.words, a = n[0], b = n[1], r = n[2], o = n[3], c = n[4], l = n[5], g = n[6], d = n[7], i = 0; i < 64; i++) {
						if (i < 16)
							f[i] = 0 | e[t + i];
						else {
							var m = f[i - 15]
							  , v = (m << 25 | m >>> 7) ^ (m << 14 | m >>> 18) ^ m >>> 3
							  , _ = f[i - 2]
							  , y = (_ << 15 | _ >>> 17) ^ (_ << 13 | _ >>> 19) ^ _ >>> 10;
							f[i] = v + f[i - 7] + y + f[i - 16]
						}
						var M = a & b ^ a & r ^ b & r
						  , w = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22)
						  , L = d + ((c << 26 | c >>> 6) ^ (c << 21 | c >>> 11) ^ (c << 7 | c >>> 25)) + (c & l ^ ~c & g) + h[i] + f[i];
						d = g,
						g = l,
						l = c,
						c = o + L | 0,
						o = r,
						r = b,
						b = a,
						a = L + (w + M) | 0
					}
					n[0] = n[0] + a | 0,
					n[1] = n[1] + b | 0,
					n[2] = n[2] + r | 0,
					n[3] = n[3] + o | 0,
					n[4] = n[4] + c | 0,
					n[5] = n[5] + l | 0,
					n[6] = n[6] + g | 0,
					n[7] = n[7] + d | 0
				},
				_doFinalize: function() {
					var data = this._data
					  , t = data.words
					  , n = 8 * this._nDataBytes
					  , r = 8 * data.sigBytes;
					return t[r >>> 5] |= 128 << 24 - r % 32,
					t[14 + (r + 64 >>> 9 << 4)] = e.floor(n / 4294967296),
					t[15 + (r + 64 >>> 9 << 4)] = n,
					data.sigBytes = 4 * t.length,
					this._process(),
					this._hash
				},
				clone: function() {
					var e = c.clone.call(this);
					return e._hash = this._hash.clone(),
					e
				}
			});
			t.SHA256 = c._createHelper(m),
			t.HmacSHA256 = c._createHmacHelper(m)
		}(Math),
		r.SHA256)
	},
	"331":function(e, t, n) {
		(function(t) {
			var r;
			e.exports = (r = r || function(e, r) {
				var o;
				if ("undefined" != typeof window && window.crypto && (o = window.crypto),
				"undefined" != typeof self && self.crypto && (o = self.crypto),
				"undefined" != typeof globalThis && globalThis.crypto && (o = globalThis.crypto),
				!o && "undefined" != typeof window && window.msCrypto && (o = window.msCrypto),
				!o && void 0 !== t && t.crypto && (o = t.crypto),
				!o)
					try {
						o = n("625")
					} catch (e) {}
				var c = function() {
					if (o) {
						if ("function" == typeof o.getRandomValues)
							try {
								return o.getRandomValues(new Uint32Array(1))[0]
							} catch (e) {}
						if ("function" == typeof o.randomBytes)
							try {
								return o.randomBytes(4).readInt32LE()
							} catch (e) {}
					}
					throw new Error("Native crypto module could not be used to get secure random number.")
				}
				  , l = Object.create || function() {
					function e() {}
					return function(t) {
						var n;
						return e.prototype = t,
						n = new e,
						e.prototype = null,
						n
					}
				}()
				  , d = {}
				  , h = d.lib = {}
				  , f = h.Base = {
					extend: function(e) {
						var t = l(this);
						return e && t.mixIn(e),
						t.hasOwnProperty("init") && this.init !== t.init || (t.init = function() {
							t.$super.init.apply(this, arguments)
						}
						),
						t.init.prototype = t,
						t.$super = this,
						t
					},
					create: function() {
						var e = this.extend();
						return e.init.apply(e, arguments),
						e
					},
					init: function() {},
					mixIn: function(e) {
						for (var t in e)
							e.hasOwnProperty(t) && (this[t] = e[t]);
						e.hasOwnProperty("toString") && (this.toString = e.toString)
					},
					clone: function() {
						return this.init.prototype.extend(this)
					}
				}
				  , m = h.WordArray = f.extend({
					init: function(e, t) {
						e = this.words = e || [],
						this.sigBytes = null != t ? t : 4 * e.length
					},
					toString: function(e) {
						return (e || _).stringify(this)
					},
					concat: function(e) {
						var t = this.words
						  , n = e.words
						  , r = this.sigBytes
						  , o = e.sigBytes;
						if (this.clamp(),
						r % 4)
							for (var i = 0; i < o; i++) {
								var c = n[i >>> 2] >>> 24 - i % 4 * 8 & 255;
								t[r + i >>> 2] |= c << 24 - (r + i) % 4 * 8
							}
						else
							for (var l = 0; l < o; l += 4)
								t[r + l >>> 2] = n[l >>> 2];
						return this.sigBytes += o,
						this
					},
					clamp: function() {
						var t = this.words
						  , n = this.sigBytes;
						t[n >>> 2] &= 4294967295 << 32 - n % 4 * 8,
						t.length = e.ceil(n / 4)
					},
					clone: function() {
						var e = f.clone.call(this);
						return e.words = this.words.slice(0),
						e
					},
					random: function(e) {
						for (var t = [], i = 0; i < e; i += 4)
							t.push(c());
						return new m.init(t,e)
					}
				})
				  , v = d.enc = {}
				  , _ = v.Hex = {
					stringify: function(e) {
						for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
							var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
							r.push((o >>> 4).toString(16)),
							r.push((15 & o).toString(16))
						}
						return r.join("")
					},
					parse: function(e) {
						for (var t = e.length, n = [], i = 0; i < t; i += 2)
							n[i >>> 3] |= parseInt(e.substr(i, 2), 16) << 24 - i % 8 * 4;
						return new m.init(n,t / 2)
					}
				}
				  , y = v.Latin1 = {
					stringify: function(e) {
						for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
							var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
							r.push(String.fromCharCode(o))
						}
						return r.join("")
					},
					parse: function(e) {
						for (var t = e.length, n = [], i = 0; i < t; i++)
							n[i >>> 2] |= (255 & e.charCodeAt(i)) << 24 - i % 4 * 8;
						return new m.init(n,t)
					}
				}
				  , M = v.Utf8 = {
					stringify: function(e) {
						try {
							return decodeURIComponent(escape(y.stringify(e)))
						} catch (e) {
							throw new Error("Malformed UTF-8 data")
						}
					},
					parse: function(e) {
						return y.parse(unescape(encodeURIComponent(e)))
					}
				}
				  , w = h.BufferedBlockAlgorithm = f.extend({
					reset: function() {
						this._data = new m.init,
						this._nDataBytes = 0
					},
					_append: function(data) {
						"string" == typeof data && (data = M.parse(data)),
						this._data.concat(data),
						this._nDataBytes += data.sigBytes
					},
					_process: function(t) {
						var n, data = this._data, r = data.words, o = data.sigBytes, c = this.blockSize, l = o / (4 * c), d = (l = t ? e.ceil(l) : e.max((0 | l) - this._minBufferSize, 0)) * c, h = e.min(4 * d, o);
						if (d) {
							for (var f = 0; f < d; f += c)
								this._doProcessBlock(r, f);
							n = r.splice(0, d),
							data.sigBytes -= h
						}
						return new m.init(n,h)
					},
					clone: function() {
						var e = f.clone.call(this);
						return e._data = this._data.clone(),
						e
					},
					_minBufferSize: 0
				})
				  , L = (h.Hasher = w.extend({
					cfg: f.extend(),
					init: function(e) {
						this.cfg = this.cfg.extend(e),
						this.reset()
					},
					reset: function() {
						w.reset.call(this),
						this._doReset()
					},
					update: function(e) {
						return this._append(e),
						this._process(),
						this
					},
					finalize: function(e) {
						return e && this._append(e),
						this._doFinalize()
					},
					blockSize: 16,
					_createHelper: function(e) {
						return function(t, n) {
							return new e.init(n).finalize(t)
						}
					},
					_createHmacHelper: function(e) {
						return function(t, n) {
							return new L.HMAC.init(e,n).finalize(t)
						}
					}
				}),
				d.algo = {});
				return d
			}(Math),
			r)
		}
		).call(this, n("69"))
	},
	"69": function(t, e) {
		var g;
		g = function() {
			return this
		}();
		try {
			g = g || new Function("return this")()
		} catch (t) {
			"object" == typeof window && (g = window)
		}
		t.exports = g
	},
	"625":function(e, t) {}
});

function aa(){
    var aaa = window._nn("297");
    var z = window._nn.n(aaa);
    const y = [];
    for (let i = 0; i < 256; ++i)
        y.push((i + 256).toString(16).slice(1));
    function M(e, t=0) {
        return (y[e[t + 0]] + y[e[t + 1]] + y[e[t + 2]] + y[e[t + 3]] + "-" + y[e[t + 4]] + y[e[t + 5]] + "-" + y[e[t + 6]] + y[e[t + 7]] + "-" + y[e[t + 8]] + y[e[t + 9]] + "-" + y[e[t + 10]] + y[e[t + 11]] + y[e[t + 12]] + y[e[t + 13]] + y[e[t + 14]] + y[e[t + 15]]).toLowerCase()
    };
    function _stringify(e) {
        for (var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++) {
            var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 255;
            r.push((o >>> 4).toString(16)),
            r.push((15 & o).toString(16))
        }
        return r.join("")
    };
    var f = {
        randomUUID: "undefined" != typeof crypto && crypto.randomUUID && crypto.randomUUID.bind(crypto)
    };
    var w = function(e, t, n) {
        if (f.randomUUID && !t && !e)
            return f.randomUUID();
        const r = (e = e || {}).random || (e.rng || _)();
        if (r[6] = 15 & r[6] | 64,
        r[8] = 63 & r[8] | 128,
        t) {
            n = n || 0;
            for (let i = 0; i < 16; ++i)
                t[n + i] = r[i];
            return t
        }
        return M(r)
    };
    var f = w().replaceAll("-", ""),
        l = Math.floor(Date.now() / 1e3),
        m = f.slice(2, 11),
        v = _stringify(z()(m)),
        pre = v.slice(0, 10),
        _ = v.slice(10, 32),
        yy = _stringify(z()(l + f + m));
    return pre + yy + _
}
law.liu 发表于 2023-6-28 13:25
v = k.a.stringify(z()(m)),

z() 表示调用函数 z,它返回另一个函数作为结果。
z() 返回的函数之后立即被调用,并传入参数 m。因此,z()(m) 是对返回的函数进行调用,并将 m 作为参数传递进去。
这种函数链式调用或者多次函数调用。通过将函数调用链接在一起,可以实现更复杂的功能组合或者链式操作。
z()(m) 表示先调用函数 z,然后将 m 作为参数传递给返回的函数进行调用。该表达式的结果将作为参数传递给函数 stringify,进一步被 k.a.stringify 使用
law.liu 发表于 2023-6-28 13:27
之于你说的“new.init(n).extend 怎么继承的另一个函数”
定义一个新的类,并让它继承自你想要继承函数的那个类。例如,如果你想要继承的函数来自类 A,你可以创建一个新类 B 并让其继承自类 A。
[Asm] 纯文本查看 复制代码
class B(A):
    pass

在新类 B 中,定义你想要添加的函数,并确保使用相同的函数名。你可以在新函数中调用父类的函数,以便重用原始函数的功能
[Asm] 纯文本查看 复制代码
class B(A):
    def extend(self, n):
        # 在这里添加你想要执行的额外代码
        super().extend(n)  # 调用父类 A 中的 extend 函数
注意,super() 函数用于调用父类的方法
现在,类 B 已经继承了类 A 中的函数,并添加了新的功能。你可以实例化类 B 的对象,并调用继承的函数及新定义的函数
[Asm] 纯文本查看 复制代码
b = B()
通过这种方式,你可以继承类中的函数,并在新类中添加额外的功能或修改原始函数的行为
b.extend(n)  # 调用继承的函数 extend


 楼主| hybpjx 发表于 2023-6-28 14:02
Miami 发表于 2023-6-28 12:54
直接调用aa()   没补环境[mw_shl_code=javascript,true]!function(e) {
    function r(data) {
         ...

强啊 大佬
 楼主| hybpjx 发表于 2023-6-28 14:05
law.liu 发表于 2023-6-28 13:25
v = k.a.stringify(z()(m)),

z() 表示调用函数 z,它返回另一个函数作为结果。

讲的很细,这个懂了,但是大佬 那个 代码是webpack脱出来的吗
 楼主| hybpjx 发表于 2023-6-28 14:27
law.liu 发表于 2023-6-28 13:27
之于你说的“new.init(n).extend 怎么继承的另一个函数”
定义一个新的类,并让它继承自你想要继承函数的 ...

NB 大佬 我搞出来了,您能告诉我 这个JS怎么弄出来的吗?
law.liu 发表于 2023-6-30 13:45

[JavaScript] 纯文本查看 复制代码
// 定义基础函数 Base
function Base() {
  // 基础函数的逻辑
}

// 在 Base 的原型上添加 anotherMethod 方法
Base.prototype.anotherMethod = function() {
  console.log("Another method called");
  // 另一个方法的具体实现逻辑
};

// 定义 Init 函数,接收参数 n
function Init(n) {
  this.n = n;
}

// 将 Init 的原型设置为 Base 的实例,实现原型继承
Init.prototype = Object.create(Base.prototype);
Init.prototype.constructor = Init;

// 在 Init 的原型上添加 extend 方法
Init.prototype.extend = function() {
  console.log("Extend method called");
  // extend 方法的具体实现逻辑
};

// 创建 Init 的实例 obj
const obj = new Init(5);

// 调用 extend 方法和继承自 Base 的 anotherMethod 方法
obj.extend();
obj.anotherMethod();

首先定义了 Base 和 Init 两个函数,并分别为它们的原型添加了方法。然后,我们通过创建 Init 的实例 obj,可以调用 extend 方法和继承自 Base 的 anotherMethod 方法。

你可以将上述代码保存为一个 JavaScript 文件,例如ABC.JS,在Node.js 环境下运行以下代码
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 23:03

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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