ICT Code Hub - Cheat V1

Bypass total 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 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);

})();