ICT Code Hub - Cheat V2

Bypass ICT Code Hub: Anti-ESC/F11, Anti-Tab Switch, Copy-Paste Unlock, & Panic Mode (Alt+M).

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         ICT Code Hub - Cheat V2
// @namespace    http://tampermonkey.net/
// @version      2.0
// @description  Bypass ICT Code Hub: Anti-ESC/F11, Anti-Tab Switch, Copy-Paste Unlock, & Panic Mode (Alt+M).
// @author       Richie
// @match        *://ictcodehub.web.id/*
// @grant        none
// @run-at       document-start
// @license MIT
// ==/UserScript==

//Important note : Saat ini anti-cheat terlalu ketat bahkan sekedar esc sudah cukup untuk auto submit

(function() {
    'use strict';

    // Status Utama (Default: Aktif)
    let isGhostActive = true;

    const screenW = window.screen.width;
    const screenH = window.screen.height;

    // Simpan fungsi asli untuk keperluan Restore (Panic Mode)
    const originals = {
        visibilityState: Object.getOwnPropertyDescriptor(Document.prototype, 'visibilityState'),
        hidden: Object.getOwnPropertyDescriptor(Document.prototype, 'hidden'),
        innerWidth: window.innerWidth,
        innerHeight: window.innerHeight,
        exitFullscreen: document.exitFullscreen
    };

    // 1. NATIVE CODE SPOOFER
    const spoofNative = (fn, name) => {
        return new Proxy(fn, {
            get: (t, prop) => {
                if (prop === 'toString') return () => `function ${name}() { [native code] }`;
                return Reflect.get(t, prop);
            }
        });
    };

    // 2. DYNAMIC PROPERTY LOCK
    // Kita buat properti yang bisa berubah nilainya tergantung status isGhostActive
    const lockDynamic = (obj, prop, fakeValue, originalPath) => {
        Object.defineProperty(obj, prop, {
            get: spoofNative(function() {
                return isGhostActive ? fakeValue : (originalPath ? originalPath.get.call(this) : undefined);
            }, prop),
            set: () => {},
            configurable: true
        });
    };

    lockDynamic(Document.prototype, 'visibilityState', 'visible', originals.visibilityState);
    lockDynamic(Document.prototype, 'hidden', false, originals.hidden);
    lockDynamic(window, 'innerWidth', screenW);
    lockDynamic(window, 'innerHeight', screenH);
    lockDynamic(Document.prototype, 'fullscreenElement', document.documentElement);

    document.hasFocus = spoofNative(() => isGhostActive ? true : true, 'hasFocus'); // Selalu true agar aman

    // 3. KEYBOARD & INTERACTION CONTROL
    const bypassKeys = (e) => {
        if (!isGhostActive) return;

        const forbidden = ['Escape', 'F11', 'F12', 'Tab', 'Meta'];
        const isCopyPaste = (e.ctrlKey || e.metaKey) && (e.key === 'c' || e.key === 'v');

        if (forbidden.includes(e.key) || isCopyPaste) {
            e.stopImmediatePropagation();
        }
    };

    window.addEventListener('keydown', bypassKeys, true);
    window.addEventListener('keyup', bypassKeys, true);

    ['copy', 'paste', 'cut', 'contextmenu'].forEach(evt => {
        window.addEventListener(evt, (e) => { if (isGhostActive) e.stopPropagation(); }, true);
    });

    // 4. HIJACK ADDEVENTLISTENER
    const originalAddEventListener = EventTarget.prototype.addEventListener;
    EventTarget.prototype.addEventListener = spoofNative(function(type, listener, options) {
        const traps = ['blur', 'visibilitychange', 'resize', 'fullscreenchange', 'mouseleave', 'focusout'];

        const wrappedListener = function(e) {
            if (isGhostActive && traps.includes(type)) {
                e.stopImmediatePropagation();
                return;
            }
            return listener.apply(this, arguments);
        };

        return originalAddEventListener.call(this, type, wrappedListener, options);
    }, 'addEventListener');

    // 5. SURGICAL OVERLAY REMOVAL
    const observer = new MutationObserver((mutations) => {
        if (!isGhostActive) return;
        for (let mutation of mutations) {
            for (let node of mutation.addedNodes) {
                if (node.nodeType === 1 && node.innerText && node.innerText.includes("Resume Exam")) {
                    node.style.display = 'none';
                    node.remove();
                    window.focus();
                }
            }
        }
    });
    observer.observe(document.documentElement, { childList: true, subtree: true });

    // 6. PANIC TOGGLE ENGINE (Alt + M)
    const styleId = 'ghost-shield-css';
    const togglePanic = () => {
        isGhostActive = !isGhostActive;

        const existingStyle = document.getElementById(styleId);
        if (!isGhostActive) {
            if (existingStyle) existingStyle.remove();
            console.log("%c PANIC MODE: BYPASS DISABLED ", "background: red; color: white; font-weight: bold;");
            // Paksa web deteksi perubahan agar terlihat normal kembali
            window.dispatchEvent(new Event('resize'));
        } else {
            injectCSS();
            console.log("%c GHOST MODE: BYPASS ACTIVE ", "background: green; color: white; font-weight: bold;");
        }
    };

    window.addEventListener('keydown', (e) => {
        if (e.altKey && e.code === 'KeyM') {
            e.stopImmediatePropagation();
            e.preventDefault();
            togglePanic();
        }
    }, true);

    // 7. CSS INJECTION
    const injectCSS = () => {
        if (document.getElementById(styleId)) return;
        const style = document.createElement('style');
        style.id = styleId;
        style.innerHTML = `
            div.fixed.inset-0.z-\\[100000\\] { pointer-events: none !important; display: none !important; }
            body { overflow: auto !important; -webkit-user-select: text !important; user-select: text !important; }
        `;
        document.documentElement.appendChild(style);
    };

    // Init
    injectCSS();
    document.exitFullscreen = document.webkitExitFullscreen = spoofNative(() => isGhostActive ? Promise.resolve() : originals.exitFullscreen.call(document), 'exitFullscreen');

})();