ICT Code Hub - Cheat V1

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         ICT Code Hub - Cheat V1
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Bypass total 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';

    let isGhostActive = true;
    const screenW = window.screen.width;
    const screenH = window.screen.height;

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

    const lock = (obj, prop, value) => {
        Object.defineProperty(obj, prop, {
            get: spoofNative(() => value, prop),
            set: () => {},
            configurable: false
        });
    };

    lock(Document.prototype, 'visibilityState', 'visible');
    lock(Document.prototype, 'hidden', false);
    window.hasFocus = document.hasFocus = spoofNative(() => true, 'hasFocus');
    lock(window, 'innerWidth', screenW);
    lock(window, 'innerHeight', screenH);

    // 2. THE KEYBOARD SILENCER (Inti Perbaikan)
    // Mencegat semua event keyboard sebelum Exam.js sempat melihatnya
    const keyInterceptor = (e) => {
        if (!isGhostActive) return;

        const key = e.key;
        const code = e.code;
        const keyCode = e.keyCode;

        // Daftar tombol haram yang dipantau oleh proctoring
        const forbiddenKeys = [
            'F11', 'Escape', 'Esc',
            'Tab', 'Alt', 'Meta', 'OS', 'Windows'
        ];

        // Deteksi Ctrl+C / Ctrl+V
        const isCopyPaste = (e.ctrlKey || e.metaKey) && (key === 'c' || key === 'v' || key === 'C' || key === 'V');

        if (forbiddenKeys.includes(key) || forbiddenKeys.includes(code) || isCopyPaste) {
            // Hentikan penjalaran event ini ke listener lain (yaitu listener dari Exam.js)
            e.stopImmediatePropagation();
            // e.preventDefault(); // Jangan di-uncomment jika kamu ingin fungsi F11/ESC browser tetap jalan secara fisik

            // Console log ini opsional, bisa dihapus agar rapi
            // console.log(`[Ghost] Membungkam tombol: ${key}`);
        }
    };

    // Pasang listener di fase CAPTURE (true) agar kita menangkapnya paling pertama
    window.addEventListener('keydown', keyInterceptor, true);
    window.addEventListener('keyup', keyInterceptor, true);
    document.addEventListener('keydown', keyInterceptor, true);
    document.addEventListener('keyup', keyInterceptor, true);

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

        // Jika Exam.js mencoba mendaftarkan keydown, kita bungkus fungsi mereka
        if (type === 'keydown' || type === 'keyup') {
            return originalAddEventListener.call(this, type, (e) => {
                if (isGhostActive && (e.key === 'F11' || e.key === 'Escape')) {
                    // Jangan panggil listener asli jika ini tombol terlarang
                    return;
                }
                // Jika bukan tombol terlarang, biarkan listener asli (misal untuk mengetik kode) berjalan
                return listener.call(this, e);
            }, options);
        }

        if (traps.includes(type)) {
            return originalAddEventListener.call(this, type, (e) => {
                e.stopImmediatePropagation();
            }, options);
        }
        return originalAddEventListener.call(this, type, listener, options);
    }, 'addEventListener');

    // 4. PANIC MODE
    window.addEventListener('keydown', (e) => {
        if (e.altKey && e.code === 'KeyM') {
            isGhostActive = !isGhostActive;
            e.stopImmediatePropagation(); // Jangan sampai Alt+M tertangkap
            console.log(isGhostActive ? "GHOST: ON" : "GHOST: OFF");
        }
    }, true);

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

    // 6. UI KILLER
    const style = document.createElement('style');
    style.innerHTML = `
        div.fixed.inset-0.z-\\[100000\\] { display: none !important; opacity: 0 !important; pointer-events: none !important; }
        body { overflow: auto !important; }
    `;
    document.documentElement.appendChild(style);

})();