From b7421ffc8923593a481b0512253382c410f3a576 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Mon, 4 Mar 2024 00:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=20z,=20=E5=88=A0=E9=99=A4=20?= =?UTF-8?q?setFunctionNamesIfNecessary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md5.js | 38 +++++++++----------------------------- readme.md | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 29 deletions(-) create mode 100644 readme.md diff --git a/md5.js b/md5.js index 15aa872..13cc06c 100644 --- a/md5.js +++ b/md5.js @@ -15,36 +15,18 @@ } } var z = function () { - var s = function () { } - s.prototype = { - p: {} + // checkEnvironment + if (typeof navigator !== "undefined" && navigator.userAgent.includes("Chrome/")) { + return true; } - var r = new s() - if (!(r.__proto__ && r.__proto__.p === s.prototype.p)) return false - try { - if (typeof navigator != "undefined" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Chrome/") >= 0) return true - if (typeof version == "function" && version.length == 0) { - var q = version() - if (/^\d+\.\d+\.\d+\.\d+$/.test(q)) return true - } - } catch (p) { } - return false + + if (typeof version === "function" && version.length === 0 && /^\d+\.\d+\.\d+\.\d+$/.test(version())) { + return true; + } + + return false; }() - function setFunctionNamesIfNecessary(a) { - function t() { }; - if (typeof t.name == "string") return - for (var s = 0; s < a.length; s++) { - var r = a[s] - var q = Object.keys(r) - for (var p = 0; p < q.length; p++) { - var o = q[p] - var n = r[o] - if (typeof n == "function") n.name = o - } - } - } - function inherit(a, b) { a.prototype.constructor = a a.prototype["$i" + a.name] = a @@ -243,7 +225,6 @@ lazyOld: lazyOld, updateHolder: updateHolder, convertToFastObject: convertToFastObject, - setFunctionNamesIfNecessary: setFunctionNamesIfNecessary, updateTypes: updateTypes, setOrUpdateInterceptorsByTag: setOrUpdateInterceptorsByTag, setOrUpdateLeafTags: setOrUpdateLeafTags @@ -8252,7 +8233,6 @@ } } var w = [A, C, F, H, J, L, M, O, P, Q, S, T, V, W, X, Y, Z] - hunkHelpers.setFunctionNamesIfNecessary(w) var $ = {} H.m8.prototype = {} J.af.prototype = { diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..fb80d9a --- /dev/null +++ b/readme.md @@ -0,0 +1,19 @@ +# 某个游戏的 js 的逆向工程 + +## `md5.js` + +- [ ] 清理所有空函数 + - `function [a-zA-Z0-9]*\(\) \{ \}` + - 0/202 + +- [x] 清理 `setFunctionNamesIfNecessary` + +- [ ] And more + +## `index.dart.js` + +- [ ] 清理所有空函数 + - `function [a-zA-Z0-9]*\(\) \{ \}` + - 0/177 + +- [ ] And more