zoukankan      html  css  js  c++  java
  • JavaScript反调试代码

    // 反调试函数,参数:开关,执行代码
        function endebug(off, code) {
            if (!off) {
                !function (e) {
                    function n(e) {
                        function n() {
                            return u
                        }
                        function o() {
                            window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized ? t("on") : (a = "off", console.log(d), console.clear(), t(a))
                        }
                        function t(e) {
                            u !== e && (u = e, "function" == typeof c.onchange && c.onchange(e))
                        }
                        function r() {
                            l || (l = !0, window.removeEventListener("resize", o), clearInterval(f))
                        }
                        "function" == typeof e && (e = {
                            onchange: e
                        });
                        var i = (e = e || {}).delay || 500,
                            c = {};
                        c.onchange = e.onchange;
                        var a, d = new Image;
                        d.__defineGetter__("id", function () {
                            a = "on"
                        });
                        var u = "unknown";
                        c.getStatus = n;
                        var f = setInterval(o, i);
                        window.addEventListener("resize", o);
                        var l;
                        return c.free = r, c
                    }
                    var o = o || {};
                    o.create = n, "function" == typeof define ? (define.amd || define.cmd) && define(function () {
                        return o
                    }) : "undefined" != typeof module && module.exports ? module.exports = o : window.jdetects = o
                }(), jdetects.create(function (e) {
                    var a = 0;
                    var n = setInterval(function () {
                        if ("on" == e) {
                            setTimeout(function () {
                                if (a == 0) {
                                    a = 1;
                                    setTimeout(code);
                                }
                            }, 200)
                        }
                    }, 100)
                })
            }
        }
    
        endebug(false, function () {
            // 非法调试执行的代码(不要使用控制台输出的提醒)
            
            document.write('<div style="text-align:center;color:red">检测到非法调试,请关闭后刷新重试</div>');
        });

    https://www.529i.com/archives/2910.html

  • 相关阅读:
    缓动公式整理(附:C#实现及WPF原版对比)
    [C#] (原创)一步一步教你自定义控件——02,ScrollBar(滚动条)
    连线
    2020.10.18:YC中学模拟赛
    【并查集】一种与时间赛跑的巧妙算法
    SpringBoot-启动流程
    Java中的ReentrantLock锁
    Tomcat-如何用线程池处理http并发请求
    Tomcat-如何建立连接获取http请求
    关于数据结构
  • 原文地址:https://www.cnblogs.com/7qin/p/15721821.html
Copyright © 2011-2022 走看看