Kour.io ESP 2025 By DarkShadow44

Simple Wallhack with menu for kour.io updated 2025! From FLIXWARE Mod menu on github!

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
// ==UserScript==
// @name         Kour.io ESP 2025 By DarkShadow44
// @namespace    http://tampermonkey.net/
// @version      9.0
// @icon         https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTCYtT7Ggnaq4ybicAIT81vAPHt1xkzBqDp9g&s
// @description  Simple Wallhack with menu for kour.io updated 2025! From FLIXWARE Mod menu on github!
// @author       Dark Shadow44
// @match        *://kour.io/*
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';

    // Globale Referenz & Zustand für das ESP-Menü
    window.espEnabled = false;
    let espMenuElement = null;
    let originalPerformanceNow = null;

    const ESP_MENU_ANIMATION_DURATION = 250;

    // Warten bis performance.now verfügbar ist
    const waitForGlobalsInterval = setInterval(() => {
        if (unsafeWindow.performance && typeof unsafeWindow.performance.now === 'function') {
            originalPerformanceNow = unsafeWindow.performance.now.bind(unsafeWindow.performance);
            clearInterval(waitForGlobalsInterval);
            console.log("[ESP Menu] Kernfunktionen bereit.");
            initializeEspFeaturesAndListeners();
        }
    }, 200);

    // ESP Logik (WebGL Hooking)
    const MOD_MENU_MIN_VERTICES_ESP = 1450;
    const MOD_MENU_MAX_VERTICES_ESP = 1490;

    function initializeESP() {
        if (unsafeWindow.WebGL2RenderingContext.prototype._espPatchedByMinimalMenu) return;

        const WebGL = unsafeWindow.WebGL2RenderingContext.prototype;

        if (!HTMLCanvasElement.prototype._getContextPatchedByMinimalMenu) {
            HTMLCanvasElement.prototype.getContext = new Proxy(HTMLCanvasElement.prototype.getContext, {
                apply(target, thisArgs, args) {
                    return Reflect.apply(target, thisArgs, args);
                }
            });
            HTMLCanvasElement.prototype._getContextPatchedByMinimalMenu = true;
        }

        const drawHandler = {
            apply(target, thisArgs, args) {
                const program = thisArgs.getParameter(thisArgs.CURRENT_PROGRAM);
                if (program && !program.uniforms) {
                    program.uniforms = {
                        vertexCount: thisArgs.getUniformLocation(program, "vertexCount"),
                        espToggle: thisArgs.getUniformLocation(program, "espToggle"),
                    };
                }
                if (program && program.uniforms) {
                    const count = args[1];
                    if (program.uniforms.vertexCount) thisArgs.uniform1f(program.uniforms.vertexCount, count);
                    if (program.uniforms.espToggle) thisArgs.uniform1f(program.uniforms.espToggle, window.espEnabled ? 1.0 : 0.0);
                }
                return Reflect.apply(target, thisArgs, args);
            },
        };

        WebGL.drawElements = new Proxy(WebGL.drawElements, drawHandler);
        WebGL.drawElementsInstanced = new Proxy(WebGL.drawElementsInstanced, drawHandler);

        WebGL.shaderSource = new Proxy(WebGL.shaderSource, {
            apply(target, thisArgs, args) {
                let [shader, src] = args;
                const espUniformNameInShader = "espToggle";
                if (src.includes("gl_Position")) {
                    src = src.replace(/void\s+main\s*\(\s*\)\s*\{/, `uniform float vertexCount;\nuniform float ${espUniformNameInShader};\nout float vVertexCount;\nvoid main() {\nvVertexCount = vertexCount;\n`);
                    src = src.replace(/(gl_Position\s*=.+;)/, `$1\nif (${espUniformNameInShader} > 0.5 && vertexCount >= ${MOD_MENU_MIN_VERTICES_ESP}.0 && vertexCount <= ${MOD_MENU_MAX_VERTICES_ESP}.0) {\n    gl_Position.z = 0.01 + gl_Position.z * 0.1;\n}`);
                }
                if (src.includes("SV_Target0")) { // DirectX-ähnlicher Shader-Code (HLSL-Syntax oft in WebGL für Kompatibilität)
                    src = src.replace(/void\s+main\s*\(\s*\)\s*\{/, `uniform float ${espUniformNameInShader};\nin float vVertexCount;\nvoid main() {`);
                    src = src.replace(/return;/, `if(${espUniformNameInShader} > 0.5 && vVertexCount >= ${MOD_MENU_MIN_VERTICES_ESP}.0 && vVertexCount <= ${MOD_MENU_MAX_VERTICES_ESP}.0 && SV_Target0.a > 0.99) {\n    SV_Target0 = vec4(1.0, 0.0, 0.0, 1.0);\n}\nreturn;`);
                }
                args[1] = src;
                return Reflect.apply(target, thisArgs, args);
            },
        });
        unsafeWindow.WebGL2RenderingContext.prototype._espPatchedByMinimalMenu = true;
        console.log("[ESP Menu] ESP WebGL Hooks initialisiert.");
    }

    function toggleESP() {
        window.espEnabled = !window.espEnabled;
        if (espMenuElement) updateToggleButtonState("espBtn", "ESP", window.espEnabled);
        console.log(`[ESP Menu] ESP ${window.espEnabled ? "aktiviert" : "deaktiviert"}.`);
    }

    // Menü UI Funktionen
    function createEspMenuHTML() {
        if (espMenuElement) return;
        espMenuElement = document.createElement("div");
        espMenuElement.id = "minimalEspMenu";
        Object.assign(espMenuElement.style, {
            position: "fixed", top: "20px", right: "20px", width: "200px",
            backgroundColor: "#1a1a1a", color: "#e0e0e0", border: "1px solid #444",
            borderRadius: "8px", padding: "10px", zIndex: "10001",
            fontFamily: "'Segoe UI', Tahoma, Geneva, Verdana, sans-serif",
            boxShadow: "0 2px 10px rgba(0, 0, 0, 0.5)",
            opacity: "0", transform: "scale(0.95)",
            transition: `opacity ${ESP_MENU_ANIMATION_DURATION}ms ease-out, transform ${ESP_MENU_ANIMATION_DURATION}ms ease-out`
        });

        const menuHeader = createMenuHeader("ESP Menu by Dark Shadow44");
        espMenuElement.appendChild(menuHeader);
        makeDraggable(espMenuElement, menuHeader);

        const btnEsp = createToggleButton("ESP", () => toggleESP(), "espBtn", window.espEnabled);
        espMenuElement.appendChild(btnEsp);

        const hotkeyInfo = document.createElement("p");
        hotkeyInfo.textContent = "Hotkey: P. This Script was made by Dark Shadow44, the creator of FLIXWARE Modmenu for kour.io Because of several reports for FLIXWARE; we discontinued the FLIXWARE projekt on greasyfork. You can get the FLIXWARE Universal Mod Menu for Kour.io on Github! That wasnt our decision, it was the decision of the greasyfork moderators and the reporters. Much work for reports. Sad! This Script is completely 🟩undetected🟩 and NOT bannable✔️";
        Object.assign(hotkeyInfo.style, {
            fontSize: "12px",
            textAlign: "center",
            color: "#aaa",
            marginTop: "8px",
            marginBottom: "0px"
        });
        espMenuElement.appendChild(hotkeyInfo);


        document.body.appendChild(espMenuElement);
        setTimeout(() => {
            if (espMenuElement) {
                espMenuElement.style.opacity = "1";
                espMenuElement.style.transform = "scale(1)";
            }
        }, 10);
    }

    function destroyEspMenu() {
        if (!espMenuElement) return;
        espMenuElement.style.opacity = "0";
        espMenuElement.style.transform = "scale(0.95)";
        setTimeout(() => {
            if (espMenuElement && espMenuElement.parentNode) {
                espMenuElement.parentNode.removeChild(espMenuElement);
            }
            espMenuElement = null;
        }, ESP_MENU_ANIMATION_DURATION);
    }

    function toggleFullEspMenu() { // Renamed from modMenuToggleMainMenu
        if (espMenuElement) {
            destroyEspMenu();
        } else {
            createEspMenuHTML();
        }
    }

    function createToggleButton(baseText, onClick, id, initialState) {
        const btn = document.createElement("button");
        btn.id = id;
        btn.className = "espMenuButton";
        btn.textContent = `${baseText}: ${initialState ? "AN" : "AUS"}`;
        btn.classList.toggle("active", initialState);
        btn.classList.toggle("inactive", !initialState);
        btn.onclick = onClick;
        return btn;
    }

    function updateToggleButtonState(buttonId, baseText, isActive) {
        const btn = document.getElementById(buttonId);
        if (!btn) return;
        btn.textContent = `${baseText}: ${isActive ? "AN" : "AUS"}`;
        btn.classList.toggle("active", isActive);
        btn.classList.toggle("inactive", !isActive);
    }

    function createMenuHeader(text) {
        const header = document.createElement("div");
        header.className = "espMenuHeader";
        header.textContent = text;
        return header;
    }

    function makeDraggable(elmnt, dragHeader = null) {
        let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
        const headerToDrag = dragHeader || elmnt;
        if (headerToDrag) {
            headerToDrag.style.cursor = 'move';
            headerToDrag.onmousedown = dragMouseDown;
        }
        function dragMouseDown(e) {
            const target = e.target;
            if (target.tagName === 'BUTTON' || target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable || (target.closest && (target.closest('.espMenuButton') || target.closest('button')))) {
                return;
            }
            e = e || window.event;
            e.preventDefault(); // Verhindert Textauswahl beim Ziehen
            pos3 = e.clientX;
            pos4 = e.clientY;
            document.onmouseup = closeDragElement;
            document.onmousemove = elementDrag;
        }
        function elementDrag(e) {
            e = e || window.event;
            e.preventDefault();
            pos1 = pos3 - e.clientX;
            pos2 = pos4 - e.clientY;
            pos3 = e.clientX;
            pos4 = e.clientY;
            elmnt.style.top = (elmnt.offsetTop - pos2) + "px";
            elmnt.style.left = (elmnt.offsetLeft - pos1) + "px";
        }
        function closeDragElement() {
            document.onmouseup = null;
            document.onmousemove = null;
        }
    }

    // Globaler Key Handler
    function globalKeyHandler(e) {
        if (e.key === "Shift" && e.location === KeyboardEvent.DOM_KEY_LOCATION_RIGHT && !e.target.matches('input, textarea, [contenteditable]')) {
            e.preventDefault();
            toggleFullEspMenu(); // Benutzt die umbenannte Funktion
        }
        if (e.key === "Escape") {
            if (espMenuElement) {
                e.preventDefault();
                destroyEspMenu();
            }
        }
        if (e.key.toLowerCase() === 'p' && !e.target.matches('input, textarea, [contenteditable]')) {
            e.preventDefault();
            toggleESP();
        }
    }

    // Initialisierung
    function initializeEspFeaturesAndListeners() {
        if (originalPerformanceNow) {
            // Falls performance.now modifiziert wurde, hier ggf. zurücksetzen
            // unsafeWindow.performance.now = originalPerformanceNow; // In diesem Skript nicht direkt nötig, da wir es nicht ändern
        }
        initializeESP();

        const styleSheet = document.createElement("style");
        styleSheet.textContent = `
            .espMenuHeader { font-size: 16px; font-weight: bold; margin-bottom: 10px; text-align: center; color: #00aaff; border-bottom: 1px solid #333; padding-bottom: 5px; user-select: none;}
            .espMenuButton { background-color: #333; color: #ddd; border: 1px solid #555; padding: 8px 10px; margin: 5px 0; border-radius: 4px; cursor: pointer; display: block; width: 100%; text-align: center; font-size: 13px; transition: background-color 0.2s ease, border-color 0.2s ease; }
            .espMenuButton:hover { background-color: #444; border-color: #777; }
            .espMenuButton.active { background-color: #28a745; border-color: #1e7e34; color: white; }
            .espMenuButton.active:hover { background-color: #218838; }
            .espMenuButton.inactive { background-color: #dc3545; border-color: #b02a37; color: white; }
            .espMenuButton.inactive:hover { background-color: #c82333; }
        `;
        document.head.appendChild(styleSheet);
        document.addEventListener("keydown", globalKeyHandler);
        console.log("[ESP Menu] UI-Helfer und globale Listener initialisiert. Rechts-Shift zum Öffnen/Schließen. 'P' für ESP Toggle.");

        // Zeige eine kurze Startnachricht
        const initMsg = document.createElement("div");
        Object.assign(initMsg.style, {
            position: "fixed", bottom: "20px", left: "20px",
            backgroundColor: "rgba(0,0,0,0.8)", color: "#00aaff",
            padding: "10px 15px", borderRadius: "5px", zIndex: "10005",
            fontSize: "14px", boxShadow: "0 0 10px rgba(0,170,255,0.5)",
            opacity: "0", transition: "opacity 0.5s ease-in-out"
        });
        initMsg.textContent = "Minimal ESP Menu Loaded!✔️ (Press RIGHT-Shift for ESP Menu. This is an original by Dark Shadow, 🟥FLIXWARE🟥!)";
        document.body.appendChild(initMsg);
        setTimeout(() => initMsg.style.opacity = "1", 100);
        setTimeout(() => {
            initMsg.style.opacity = "0";
            setTimeout(() => { if (initMsg.parentNode) initMsg.parentNode.removeChild(initMsg); }, 500);
        }, 5000);
    }

})();