1/**
2 * 基础禁止调试代码
3 */
4(() => {
5 function ban() {
6 setInterval(() => {
7 debugger;
8 }, 50);
9 }
10 try {
11 ban();
12 } catch (err) {}
13})();1(() => {
2 function ban() {
3 setInterval(() => {
4 debugger;
5 }, 50);
6 }
7 try {
8 ban();
9 } catch (err) {}
10})();1// 加密前
2(() => {
3 function ban() {
4 setInterval(() => {
5 Function("debugger")();
6 }, 50);
7 }
8 try {
9 ban();
10 } catch (err) {}
11})();
12
13// 加密后
14eval(
15 (function (c, g, a, b, d, e) {
16 d = String;
17 if (!"".replace(/^/, String)) {
18 for (; a--; ) e[a] = b[a] || a;
19 b = [
20 function (f) {
21 return e[f];
22 },
23 ];
24 d = function () {
25 return "w+";
26 };
27 a = 1;
28 }
29 for (; a--; )
30 b[a] && (c = c.replace(new RegExp("\b" + d(a) + "\b", "g"), b[a]));
31 return c;
32 })(
33 '(()=>{1 0(){2(()=>{3("4")()},5)}6{0()}7(8){}})();',
34 9,
35 9,
36 "block function setInterval Function debugger 50 try catch err".split(" "),
37 0,
38 {}
39 )
40);Function('debugger').call() 改成 (function(){return false;})['constructor']('debugger')['call']();1(() => {
2 function block() {
3 if (
4 window.outerHeight - window.innerHeight > 200 ||
5 window.outerWidth - window.innerWidth > 200
6 ) {
7 document.body.innerHTML = "检测到非法调试,请关闭后刷新重试!";
8 }
9 setInterval(() => {
10 (function () {
11 return false;
12 })
13 ["constructor"]("debugger")
14 ["call"]();
15 }, 50);
16 }
17 try {
18 block();
19 } catch (err) {}
20})();